For this tutorial, we will be using these files :
Check the files to see the configuration of each organization.
For the chaincode we will be deploying abstore chaincode of fabric-samples.
sudo curl -L https://raw.githubusercontent.com/bxforce/bnc-hlf/master/bin/bnc -o /usr/local/bin/bnc && sudo chmod +x /usr/local/bin/bnc
mkdir config
curl https://raw.githubusercontent.com/bxforce/bnc-hlf/master/tests/single_machine/two-orgs/config-deploy-org1.yaml > $PWD/config/config-deploy-org1.yaml
curl https://raw.githubusercontent.com/bxforce/bnc-hlf/master/tests/single_machine/two-orgs/config-deploy-org2.yaml > $PWD/config/config-deploy-org2.yaml
curl https://raw.githubusercontent.com/bxforce/bnc-hlf/master/tests/single_machine/two-orgs/config-genesis-org1-org2.yaml > $PWD/config/config-genesis-org1-org2.yaml
curl https://raw.githubusercontent.com/bxforce/bnc-hlf/master/tests/single_machine/two-orgs/config-chaincode.yaml > $PWD/config/config-chaincode.yaml
Now we will start by generating crypto material for org2:
bnc generate --config-folder $PWD/config -f config-deploy-org2.yaml
Now we will start by generating crypto material for org1:
bnc generate --config-folder $PWD/config -f config-deploy-org1.yaml -g config-genesis-org1-org2.yaml
bnc start --config-folder $PWD/config -f config-deploy-org2.yaml
bnc start --config-folder $PWD/config -f config-deploy-org1.yaml
bnc channel deploy --config-folder $PWD/config -f config-deploy-org1.yaml
bnc channel deploy --config-folder $PWD/config -f config-deploy-org2.yaml --no-create
The following command will install + approve + commit chaincode
bnc chaincode deploy --config-folder $PWD/config -f config-deploy-org2.yaml -c config-chaincode.yaml
bnc chaincode deploy --config-folder $PWD/config -f config-deploy-org1.yaml -c config-chaincode.yaml
Org1 will do the first invoke
bnc chaincode invoke --config-folder $PWD/config -f config-deploy-org1.yaml -c config-chaincode.yaml -i "Init,a,100,b,100"
query chaincode
bnc chaincode query --config-folder $PWD/config -f config-deploy-org1.yaml -c config-chaincode.yaml -i "query,a"
call the invoke fct to move 10 from a to b
bnc chaincode invoke --config-folder $PWD/config -f config-deploy-org1.yaml -c config-chaincode.yaml -i "invoke,a,b,10"
Invoke as org2
bnc chaincode invoke --config-folder $PWD/config -f config-deploy-org2.yaml -c config-chaincode.yaml -i "invoke,a,b,10"
bnc rm --config-folder $PWD/config -f config-deploy-org1.yaml
bnc rm --config-folder $PWD/config -f config-deploy-org2.yaml