By leveraging the Solana blockchain, we can create NFTs that certify the origin and attributes of renewable energy. Each NFT represents a specific quantity of renewable energy generated by a particular source, such as solar, wind, or hydro power. These tokens act as digital proof of ownership, allowing individuals and organizations to offset either their bills or reduce carbon footprint.
Limited Access to Renewable Energy in certain areas. Companies and orgnisation wants to access to renewable energy easily to reduce carbon footprint.
The aim of the project is to leverage the power of Non-Fungible Tokens (NFTs) to promote and support the adoption of renewable energy sources by both consumers and organizations alike.
Create the following files and paste the Token Program's Private Key into ownerSecret.json and the testing wallet's Private Key into destSecret.json. Refer to the README.md in the secrets folder for more information.
- 'destSecret.json'
- 'ownerSecret.json'
Here's an example of how your secret file should look like
If you have trouble with setting up the typescripts you can refer to Troubleshoot
git clone https://github.com/BingleBangle-BH/RET
cd RET/mint-nft
yarn install
yarn add ts-node
npm install ts-node --save-dev
sudo apt install python3
pip3 install -r requirements.txt
cd endpoints
python3 middleware.py
- Install dependencies
- Select Yes for Use 'src/' directory with this project? when prompted and No for the rest of the prompts.
npx create-next-app webapp --ts
It should look like this
- Install Solana Wallet Adaptor & Chakra UI
cd webapp
npm i @solana/web3.js @solana/wallet-adapter-base @solana/wallet-adapter-react @solana/wallet-adapter-wallets
npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion
-
Replace src/pages/index.tsx, src/pages/_app.tsx, src/components/TokenCard.tsx and src/components/Wallets.tsx inside the webapp directory with the files located inside the frontend directory
-
Create a
images
folder underpublic
folder inside the webapp directory and add public/images/RET - animate (large).gif from the frontend directory into the newly created folder.- Tutorial for creating the front end web application can be found here
It should ultimately look like this:
- Start the Web Application
cd webapp
npm run dev
- Enable executable rights for the scripts
cd /RET/setup
chmod +x setupRET.sh setupWebApp.sh createWallet.sh run.sh stop.sh
cd ..
- Automated Setup
.\setupRET.sh
.\setupWebApp.sh
- Create New Wallet
.\createWallet.sh
- Run Middleware and Frontend Web Application
.\run.sh
- Stop Middleware and Frontend Web Application Processes
.\stop.sh
yarn add ts-node
npm install ts-node --save-dev
ts-node
yarn test
yarn getTokenAccounts
sudo rm /usr/bin/ts-node
npm install -g typescript
npm install -g ts-node
ts-node
node --version
v20.2.0 OR v16.2.0
npm --version
9.6.6 OR 8.19.4
nvm --version
0.39.2
nodejs --version
v12.22.9
yarn --version
v1.22.19
- The API Middleware runs on port 5000
- The Front End Web Application runs on port 3000, acceessible via http://localhost:3000/