It contains 2 directories:
contracts
: contains theContextAwareSmartContract.sol
contract with the artifacts.app
: contains JavaScript application scripts for the DApp (decentralized application).
The app
folder contains app.js script for connecting with the ContextAwareSmartContract.sol
contract.
For the deployment of the contract, address
and totalDevicesPowerValue
should be updated (according to the devices you are testing).
To run a script, type in terminal sudo node app.js
. Remember, Solidity file must be compiled.
- Download all necessary dependencies and libraries required of your system to run and the Quorum blockchain Blockchain:
- Vagrant
- Virtual box/Docker
dApp libraries:
- Node js
- pigpio
- OnOff
- web3.js
Sensors libraries:
- node-dht-sensor
- mcp-spi-adc
- Set up your Quorum client or create the quorum blockchain
- Set up your Quorum nodes number and node urls
- Deploy a decentralized application at the IoT gateway node(s) connected to the blockchain node (s)
- Connect web3 to your Quorum nodes on the DApp
- Deploy the smart contract on Quorum (sandbox) or remix
- Connect DApp with smart contract ( bytecode, json, abi)
- Send a private transactions and interact with contract privately by running the app.js on the terminal.
Output from script will appear in terminal.
L. Ngwira, M. M. Merlec, Y. K. Lee and H. P. In, "Towards Context-Aware Smart Contracts for Blockchain IoT Systems," 2021 International Conference on Information and Communication Technology Convergence (ICTC), 2021, pp. 82-87, doi: 10.1109/ICTC52510.2021.9620961.
https://ibel.korea.ac.kr/ - Korea University