Skip to content

BingleBangle-BH/RET

Repository files navigation

Renewable Energy Token(RET)

RET logo

🗺️ Introduction

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.

❓ Problem Statement

Limited Access to Renewable Energy in certain areas. Companies and orgnisation wants to access to renewable energy easily to reduce carbon footprint.

🎯 Project Aim

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.

💡 How it works?

RET pipeline

🎬 Video demo

Demo Video

📑 Slides

pitch deck

📌 Set Up - Secrets

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

Example of secret file branch

📌 Set Up - Backend Instructions

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

📌 Set Up - API / Middleware (GET)

sudo apt install python3
pip3 install -r requirements.txt
cd endpoints
python3 middleware.py

📌 Set Up - Front End Web Application

  1. 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

Example of npx install webapp

  1. 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 under public 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:

Move image

Move file

  1. Start the Web Application
cd webapp
npm run dev

⚙️ Automated Installation and Setup Process

  • 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

💉 Troubleshooting Typescript

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

✏️ Notes

  • The API Middleware runs on port 5000
  • The Front End Web Application runs on port 3000, acceessible via http://localhost:3000/

🛠️ Tech Stack

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •