AgriVerify is a decentralized application (DApp) built using Hardhat, Ethereum, and React. It allows users to register crops on the blockchain and display their verification status using a QR code.
There are lots of things to change, for now this is final results!
- No Functionality for verifiers
- No functionality added to register a farmer
- More robust testing required
These issue will be fixed soon :)
Before running this project, make sure you have the following installed:
- Node.js (v20+)
- NPM (v6+)
- Hardhat
- MetaMask (for connecting to the Ethereum network)
git clone https://github.com/your-repository/agriverify.git
cd agriverify
npm i
to run it on local hardhat account
npx hardhat node
copy the contract address to where the contract is deployed and paste it in App.js
npx hardhat run ./scripts/deploy.js --network localhost
- Open
./src/App.js
file in the project - Replace the old address with the new address obtained from the previous step.
const contractAddress = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; // Replace with actual deployed contract address
start the react app
npm run start
This will start the client on http://localhost:3000
. Open your browser, and you can interact with the AgriVerify DApp.
After running npm run start
you will be redirect to webpage similar to the following:
The image above shows how the crop details and verification QR codes are displayed on the frontend.
Scanning the QRcode now generate a json resposne which will be further modified in future work All other issues will be addressed in next update!