Skip to content

mlecjm/context-aware-smart-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Context-aware smart contracts for blockchain IoT systems

It contains 2 directories:

  1. contracts: contains the ContextAwareSmartContract.sol contract with the artifacts.
  2. app: contains JavaScript application scripts for the DApp (decentralized application).

Directories

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.

Deployment of the system

  1. Download all necessary dependencies and libraries required of your system to run and the Quorum blockchain Blockchain:

dApp libraries:

Sensors libraries:

  • node-dht-sensor
  • mcp-spi-adc
  1. Set up your Quorum client or create the quorum blockchain
  2. Set up your Quorum nodes number and node urls
  3. Deploy a decentralized application at the IoT gateway node(s) connected to the blockchain node (s)
  4. Connect web3 to your Quorum nodes on the DApp
  5. Deploy the smart contract on Quorum (sandbox) or remix
  6. Connect DApp with smart contract ( bytecode, json, abi)
  7. Send a private transactions and interact with contract privately by running the app.js on the terminal.

Output from script will appear in terminal.

iBELab - Intelligent Blockchain Engineering Lab.

https://ibel.korea.ac.kr/ - Korea University