Tools, FAQ, Tutorials:
Invoke Operation on Chaincode Container
Which chaincode container runs the chaincode invoke operation?
✍: FYIcenter.com
 The chaincode "mycc" instance is configured in the BYFN (Build Your First Network)
to run in both chaincode containers when one of their peers receives 
the "Invoke" call.
The chaincode "mycc" instance is configured in the BYFN (Build Your First Network)
to run in both chaincode containers when one of their peers receives 
the "Invoke" call.
1. Set up a terminal on the hosting system to follow the log file of the chaincode container linked to "peer0.org1":
$ docker ps --all | grep dev-peer0.org1 cc7aeb60bb85 dev-peer0.org1.example.com-mycc-2.0-04da... $ docker logs --tail 10 -f cc7aeb60bb85
2. Set up another terminal on the hosting system to follow the log file of the chaincode container linked to "peer0.org2":
$ docker ps --all | grep dev-peer0.org2 5e2d37a1099f dev-peer0.org2.example.com-mycc-2.0-03c5... $ docker logs --tail 10 -f 5e2d37a1099f
3. Invoke the chaincode instance from peer0.org1:
$ docker exec -it cli bash
bash-4.4# echo $CORE_PEER_ADDRESS
peer0.org1.example.com:7051
bash-4.4# peer chaincode invoke -o orderer.example.com:7050 --tls true \
   --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto\
   /ordererOrganizations/example.com/orderers/orderer.example.com/msp\
   /tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc \
   --peerAddresses peer0.org1.example.com:9051 --tlsRootCertFiles \
   /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations\
   /org1.example.com/peers/peer0.org1.example.com/tls/ca.crt \
   --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles \
   /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations\
   /org2.example.com/peers/peer0.org2.example.com/tls/ca.crt \
   -c '{"Args":["invoke","a","b","10"]}'
[chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. \
   result: status:200
The same message comes out from both chaincode containers linked to peer0.org1 and peer0.org2:
ex02 Invoke Aval = 70, Bval = 230
⇒ CouchDB Container Used in Hyperledger Fabric
⇐ Watch Chaincode Container Log
2020-06-08, ∼1191🔥, 0💬
Popular Posts:
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
What Azure AD App Registration Manifest? Azure AD App Registration Manifest is JSON file that contai...
What Happens If One Row Has Missing Columns? What happens if one row has missing columns? Most brows...