Skip to content

Latest commit

 

History

History
103 lines (83 loc) · 2.91 KB

RUN.md

File metadata and controls

103 lines (83 loc) · 2.91 KB

Table of Contents


Simulation Setup

  1. Create a simulation in Cooja, with one border router and multiple sensor nodes.

       	sudo ant run
  2. Tunslip6 Commands for border routers

    	sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 -p 60020 -t tun0
    	sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 -p 60002 -t tun1
    	sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 -p 60003 -t tun2
    	sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 -p 60004 -t tun3
    	sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 -p 60005 -t tun4

    Make sure to change the port number based on the Serial Socket server port specified in the Cooja simulator for the border router.

  3. Run the server.js files and wait for data to start generating


Hyperledger Blockchain Deployment

  1. Deploy the test network by navigating to the fabric-samples/test-network folder and running the following command:

    ./network.sh up createChannel -c mychannel -ca

    This creates a channel called mychannel on the Hyperledger blockchain.

  2. Deploy the Org3 using Org3.sh:

    ./Org3.sh up

    This creates a new organization called Org3 on the Hyperledger blockchain.

  3. Deploy the Org3 using Org4.sh:

    ./Org4.sh up

    This creates a new organization called Org4 on the Hyperledger blockchain.

  4. Deploy the Org3 using Org5.sh:

    ./Org5.sh up

    This creates a new organization called Org5 on the Hyperledger blockchain.

  5. Deploy the chaincodes using the following command:

    ./network.sh deployCC -ccn easwar -ccp ../asset-transfer-basic/cc1-easwar/ -ccl node
    ./network.sh deployCC -ccn nitin -ccp ../asset-transfer-basic/cc2-nitin/ -ccl node
    ./network.sh deployCC -ccn rohit -ccp ../asset-transfer-basic/cc3-rohit/ -ccl node
    ./network.sh deployCC -ccn dheeraj -ccp ../asset-transfer-basic/cc4-dheeraj/ -ccl node
    ./network.sh deployCC -ccn farzan -ccp ../asset-transfer-basic/cc5-farzan/ -ccl node
  6. Setting up Hyperledger Rest API[from rest-api-typescript directory]

		npm install
		npm run build
		TEST_NETWORK_HOME=$HOME/fabric-samples/test-network npm run generateEnv
		export REDIS_PASSWORD=$(uuidgen)
		npm run start:redis
		npm run start:dev
  1. Setting up Hyperledger Blockchain Explorer[from explorer directory]
cp -r ../fabric-samples/test-network/organizations/ .
docker-compose up 
  1. Now the blockchain is set up.

Backend Code

  1. Run the backend code in the src folder using:
    npm i && node index.js
    Install any missing dependencies using:
    npm i <packagename>

Frontend Code

  1. Run the frontend code in the frontend folder using:
    npm i && npm start