Skip to content

vls-00/ewaste-dapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♻️ Overview

The e-waste is a decentralized application designed to ensure transparency and accountability in the lifecycle of electronic waste — from the moment a device is disposed of, to its final recycling stage. By using blockchain technology, this platform provides immutable tracking of every step in the recycling process, enabling environmental responsibility and regulatory compliance. The application supports the following key user roles:

  • ItemUser – Disposes of electronic devices and creates initial blockchain records for tracking.
  • GreenPoint – Acts as the collection center, confirming receipt and batching items for transport.
  • Transporter – Moves items between locations, updating the blockchain with delivery confirmations.
  • RecyclingUnit – Processes and recycles devices, submitting verified recycling data.
  • EnvironmentalAuditor – Monitors all activities for transparency and compliance with environmental regulations.

🔨 Setup & Installation Guide

  • Install the Ganache app from: https://archive.trufflesuite.com/ganache/
  • Install NodeJS version >=18 from: https://nodejs.org/en/download
  • Open powershell.
  • Run npm install -g truffle.
  • Open Ganache and make a new workspace.
  • Open the new workspace made in Ganache.
  • Edit the truffle-config.js file and change the port to the one from Ganache. You can find the Ganache port by clicking on the settings icon and navigating to the "server" tab.
  • Run truffle compile --all in powershell.
  • Navigate to "Contracts" tab inside Ganache and link the truffle project by selecting the truffle-config.js file.
  • Link the truffle project by selecting the truffle-config.js file.
  • Run truffle migrate --network development in powershell.
  • After successfully deploying the contract using truffle, add the contract address assigned to it from Ganache to the /src/.env file. The address should be visible in the CONTRACTS tab inside Ganache after a successful deployment.
  • Install the metamask browser extension from: https://metamask.io/
  • Follow the instructions in metamask and create a new wallet.
  • In the upper left corner of the metamask window click on Ethereum Mainnet which is the blockchain network.
  • Click Add network -> Add a custom network to add the custom ganache network to metamask. The settings values are (port may vary):
RPC URL: http://localhost:7545
Chain ID: 1337
Currency Symbol: ETH
  • Change the blockchain network in metamask to the newly added test network (which is the local Ganache).

  • In metamask, click on the Account -> Add account or hardware wallet -> private key -> add any private key from the Ganache which can be found in the ACCOUNTS tab to import the local account to metamask. The private key of each account can be found on the right side by clicking the key icon.

  • Open powershell or your IDE console and navigate inside the /frontend folder.

  • Run npm install to install the necessary node packages.

  • Run npm run copy-abi to copy the ABI built from truffle inside the frontend folder.

  • Run npm run dev to start the frontend server

  • Open http://localhost:5173/

  • After deploying the contract, the owner and the admin of the contract will be the first address of Ganache accounts. You will need to import this account into metamask and connect to the application in order to make more users.

Note: After changing something in the solidity and redeploying the contract, a new contract address will be given by Ganache and needs to be replaces in the /src/.env file.

🔃 Editing and Redeploying

For redeploying run the following commands in powershell:

truffle compile --all
truffle migrate --network development
cd ./frontend
npm run copy-abi
npm run dev

About

♻️ A decentralized (web3) application for tracking and managing electronic waste using blockchain (ETH) technology.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors