-
Create a simulation in Cooja, with one border router and multiple sensor nodes.
sudo ant run
-
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.
-
Run the
server.js
files and wait for data to start generating
-
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. -
Deploy the Org3 using
Org3.sh
:./Org3.sh up
This creates a new organization called
Org3
on the Hyperledger blockchain. -
Deploy the Org3 using
Org4.sh
:./Org4.sh up
This creates a new organization called
Org4
on the Hyperledger blockchain. -
Deploy the Org3 using
Org5.sh
:./Org5.sh up
This creates a new organization called
Org5
on the Hyperledger blockchain. -
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
-
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
- Setting up Hyperledger Blockchain Explorer[from explorer directory]
cp -r ../fabric-samples/test-network/organizations/ .
docker-compose up
- Now the blockchain is set up.
- Run the backend code in the
src
folder using:Install any missing dependencies using:npm i && node index.js
npm i <packagename>
- Run the frontend code in the
frontend
folder using:npm i && npm start