Skip to content

Peer-to-Peer energy trading platform to trade surplus solar energy using blockchain. #AlgoBharatDevTrackCompetition24

Notifications You must be signed in to change notification settings

utkarshup49/SolarChain

Repository files navigation

Solar Chain

A Peer-to-Peer Energy Trading Platform

Table of Contents

About

This project enables a decentralized platform for trading surplus solar energy using blockchain technology. Our solution empowers individuals and businesses to take full control of their surplus energy. We’re building a future where clean energy is accessible, affordable, and efficient for everyone.

Our platform ensures transparency, security, and efficiency using blockchain technology. blockchain.png

Website Demo

Website.demo.mp4

Project Structure

Directories

Setup

Pre-requisites

  • Python 3.12 or later
  • Docker (only required for LocalNet)
  • Make sure all packages are installed.
    • Run pip install -r requirements.txt to install all required packages.
  • For compiling contract after modification run: algokit compile py <INPUT> --output-arc32 --no-output-teal. No need to run this if contract is not modified.

Initial Setup

1. Clone the Repository

Start by cloning this repository to your local machine.

2. Install Pre-requisites

Ensure the following pre-requisites are installed and properly configured:

  • Docker: Required for running a local Algorand network. Install Docker.
  • AlgoKit CLI: Essential for project setup and operations. Install the latest version from AlgoKit CLI Installation Guide. Verify installation with algokit --version, expecting 2.5.0 or later.
  • Start LocalNet: Use algokit localnet start to initiate a local Algorand network.

For test net just run this file and make sure the variable LOCAL_NET is set to false and accounts are properly setup in the accounts file.

Pycharm was the IDE used.

Running the program.

Run main.py and navigate to the website.

For standalone smart contract testing navigate to Standalone file

NOTE: If using localnet you will have to create new localnet accounts and asset for testing on localnet. If doing so then mention the new accounts' mnemonic in this file in the ACCOUNTS_LOCAL list and update the ASSET_ID_LOCAL_NET variable to the new asset's ID. See this file to create a new asset for localnet.

For using test net make sure that in the file the variable LOCAL_NET is set to false. This will make it automatically use the testnet accounts mentioned in the accounts file.

Common Issues

Docker Errors

Logged in but got unauthorized: incorrect username or password error.

Right-Click on the system tray icon, does it show you logged in as username@domain.com? If so, Sign out, the issue is that you must login to Docker using your hub username, which is different than your email address, even though in some cases, both are interchangeable. You can do this by signing out from the system tray icon, or by logging in at a command prompt, using the syntax docker login --username your_username_here. If you’re not sure of your username, you can login to the Docker Hub, and your username will be displayed on the far right hand side of the menu bar, next to “Dashboard”, “Explore” and such.

Tools Used

This project makes use of Algorand Python to build Algorand smart contracts.

The following tools are in use:

  • AlgoKit - One-stop shop tool for developers building on the Algorand network; docs, intro tutorial
  • Algorand Python - A semantically and syntactically compatible, typed Python language that works with standard Python tooling and allows you to express smart contracts (apps) and smart signatures (logic signatures) for deployment on the Algorand Virtual Machine (AVM); docs, examples
  • AlgoKit Utils - A set of core Algorand utilities that make it easier to build solutions on Algorand.
  • pytest: Automated testing.
  • Docker: For localnet testing
  • Flask: For backend

Contributions are welcome—check out our code and join us in revolutionizing energy sharing!

About

Peer-to-Peer energy trading platform to trade surplus solar energy using blockchain. #AlgoBharatDevTrackCompetition24

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •