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.
- 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.jsfile 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 --allin powershell. - Navigate to "Contracts" tab inside Ganache and link the truffle project by selecting the
truffle-config.jsfile. - Link the truffle project by selecting the
truffle-config.jsfile. - Run
truffle migrate --network developmentin powershell. - After successfully deploying the contract using truffle, add the contract address assigned to it from Ganache to the
/src/.envfile. The address should be visible in theCONTRACTStab 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 Mainnetwhich is the blockchain network. - Click
Add network->Add a custom networkto 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 theACCOUNTStab 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
/frontendfolder. -
Run
npm installto install the necessary node packages. -
Run
npm run copy-abito copy the ABI built from truffle inside the frontend folder. -
Run
npm run devto start the frontend server -
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.
For redeploying run the following commands in powershell:
truffle compile --all
truffle migrate --network development
cd ./frontend
npm run copy-abi
npm run dev