IFB452 | |_____CSS | | | |_____style.css | |_____pages | | | |_____auditorlogin.html | | | |_____senddata.html | | | |_____validatedata.html | | | |_____viewdata.html | |_____index.html | |_____main.sol | |_____readme.md
- Remix IDE; for Solidity development & deployment
- Metamask wallet; for Ethereum
- lite-server
Complie and deploy smart contract
- Open Remix IDE in browser such as Chrome.
- Open the main.sol file in Remix IDE.
- Compile the main.sol contract.
- In the Delpy and run transactions tab, select Injected Provider as the environment to connect Remix with MetaMask.
- Connect your MetaMask wallet when prompted.
- Deploy the contract.
- Copy the deployed contract's address and ABI, and paste it into the appropriate sections of your HTML files.
Run the local web Server
- Open a terminal from the parent project directory
- Run the command lite-server to run the lite webserver
- This will start a local server and open the app in your default browser.
Submitting Environmental Data
- From the homepade (index.html), click the Submit button to submitte senvironmental data. MetaMask will prompt you to allow wallet access and confirm the transaction.
- On successful submission, the data will be stored on the blockchain but will only be visible after the auditor validation.
Auditor Validation
- To validate the submission, click the Validate Action button on the submit data page, or use the Auditor Validation button at the top right corner of the homepage. Both optons lead to the auditor login page.
- For this project the login details are open. You can enter any login details or leave it blank and click Login to get access to the validation page.
- On the validation page, enter the Submission ID which is starting from 1 for the first submission and gets incremented by 1 for each subsequent submission.
- Click Load Submission to retrieve the submission details. This button will load the submission matched to the id to validate. If the submission is already validated, the message will be shown that it is validated already. Otherwise, click If the data is already validated, the message will be shown that it is validated already.alidate button and confirm the transaction via MetaMask to validate the submission.
Viewing Submissions and Scores
- Navigate to the View Scores and Submissions page via the View Score and Submissions button.
- On this page, you can enter the submission id to view the submitted data and to check the score, you can enter the wallet address. The page will display the relevant data and scores accordingly.
- Make sure MetaMask is connected to the same network as your deployed contract