- WebPage: hollow-leaf.github.io/inazuma
- Video: https://youtu.be/R0JVhL2DiUE?si=Pclr36mrNvYSxCHE
- Inazuma Contract: 0x651Ccd3E07dEda23a573fdD6759b169F3840Fc35
INAZUMA,the gateway to decentralized green energy.We're revolutionizing eco-friendly energy distribution.The purpose of Inazuma is to encourage the use of green energy among humans, reduce CO2 emissions, and protect environment.
The goal of our project is to realize a decentralized green energy platform provider. We use Co2 storage to store and retrieve the acquired green energy metadata, and sell green energy to buyers, who can obtain Hypercerts environmental certification.
Our solution has the following features and advantages:
- Provide incentives to increase the adoption rate of green energy
- Proof of their ESG commitment
- Enable a transparent and publicly accessible process for energy transactions
- Identify enterprises with high electricity consumption that contribute to environmental pollution
- Use Co2.Storage to store green energy metadata
- Use Hypercerts to mint proof of their ESG commitment
- Use wagmi and RainbowKit to build connect wallet button
- Use Node.js express to build backend
- Use Next.js to build frontend
Seller workflow
sequenceDiagram
participant Power Provider
participant Inazuma
participant Co2.storage
participant Hypercert Contract
participant Inazuma Contract
Power Provider ->> Inazuma: Production
Inazuma ->> Co2.storage: Production Record
Co2.storage ->> Inazuma: CID
Inazuma ->> Co2.storage: Sign CID
Inazuma ->> Hypercert Contract: Mint hypercert with CID
Inazuma ->> Inazuma Contract: Set contributer of CID
Power Provider ->> Inazuma Contract: Verify CID and content and receive payment
Buyer workflow
sequenceDiagram
participant Power Buyer
participant Inazuma
participant Co2.storage
participant Hypercert Contract
participant Inazuma Contract
Power Buyer ->> Inazuma: Amount
Inazuma ->> Power Buyer: list of hypercerts to buy
Power Buyer ->> Inazuma Contract: list of hypercerts
Inazuma Contract ->> Hypercert Contract: Transfer hypercerts to buyer
Power Buyer ->> Co2.storage: Check the CID of hypercerts
Inazuma is a monorepo managed using turbo. You can find the source code for each package in the
apps/web
andapps/backend
directory.
apps/web
is the web frontend for Inazuma. It is built using Next.js.apps/backend
is the web backend for Inazuma.It is built using AWS EC2 , Express , Co2.Storage-api , docker and ipfs-unixfs.
cd apps/backend
Create a new .env file and add variables as below. ESTUARY_API_KEY and FG_TOKEN can get from co2.storage. INFURA_API_KEY get from Infura. PK: 0x{Your private key} PKI: Your private key ADDRESS: Your address
ESTUARY_API_KEY=
INFURA_API_KEY=
PK=
FG_TOKEN=
ADDRESS=
PKI=
cd src/contracts
There are two contracts in the folder, we have to deploy both of them.
- Deploy Greencoin.sol and record the contract’s address.
- Mint enough Greencoin to use.
- Change the _greencoin_address
address constant _greencoin_address = //Your Greencoin contract address;
- Deploy the contract
-
Go hypercert contract and set setApprovalForAll to your contract address. This makes your contract can transfer hypercert you mint.
-
In the Greencoin contract, set approve to your Inazuma contract. This makes Inazuma contract can transfer your greencoin to provider as payment.
cd ..
cd blcokchain
There is blockchain.js here and edit inazuma inside to your inazuma contract address.
const inazuma ="0x65....c35";
const hypercert="0x82....d07";
Go apps/web/service from root of project you can find contract.ts and api.ts. First, in contract,ts edit contract address to your inazuma contract address in line 111. Next, open api.ts and set host as “http://127.0.0.1:8080”.
const contractAddress: any = {
'Goerli': '0x65....c35'
}
Go apps/web/components from root of project and find greenCoinBalance.tsx, and edit address variable to your greencoin contract address.
you can run:
turbo dev
now Inazuma is displayed.
- Backend + Inazuma Contract: SoloLin
- Frontend: JakeKuo
- Frontend: EricLin
- CI/CD + technology support: kidneyweakx