Guides on how to run this project
- The first thing you need to do is to setup the fabric network
- while in the project root switch to script dir
# change directory to scripts
cd scripts
- run setup script (this scripts helps setup the network and create a channel "mychannel" with couchDb and CA enabled)
# setup hlf testnet
./setup.sh
- After setting up the fabric testnet, you can deploy the chaincode to the channel (mychannel)
# deploy chaincode to "mychannel"
./deploy.sh
-
Now you can simulate creating a user
- To simulate creation of userA, run the simulate script
# simulate creation of default user [userA] ./simulate.sh
- To simulate creation of another user, pass the username as an argument
# simulate creation of custom user ./simulate.sh userB
The testnetwork should now be completely setup with atleast on user.
To run the gateway application for simulating user activities,
# cd into gateway dir from root
cd gateway
# run go app
go run .
NOTE: To simulate different smart contract functions, you have to make some edits to the app.go for function calls and connect.go to change the current user interacting with the blockchain network.