Tools, FAQ, Tutorials:
Auto-Start of Required Chaincode Container
Why a chaincode container is automatically started?
✍: FYIcenter.com
A chaincode container will be automatically started,
if a chaincode is invoked and the chaincode container's peer
is a required peer for the chaincode.
Let's continue with the previous tutorial to see this behavior.
6. Stop the chaincode container for peer0.org2, which is a required peer for the chaincode.
$ docker stop 4e1b1b131dc5 $ docker ps | grep chaincode CONTAINER ID STATUS NAMES 9b93813390d3 Up 14 hours dev-peer0.org1.example.com-mycc-1.0
7. Submit another transaction on peer0.org1:
$ docker exec -it cli bash bash-4.4# source peer0-org1.sh 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"]}' bash-4.4# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}' 70
8. Verify that the status chaincode container for peer0.org2 is automatically started:
bash-4.4# exit $ docker ps | grep chaincode CONTAINER ID STATUS NAMES 9b93813390d3 Up 14 hours dev-peer0.org1.example.com-mycc-1.0 4e1b1b131dc5 Up 1 minute dev-peer0.org2.example.com-mycc-1.0
The logical chaincode instance "mycc" on the channel is working, because the required peer peer0.org2 forced the chaincode container, dev-peer0.org2.example.com-mycc-1.0, to start to run.
Â
⇒ Blockchain Data Files on Peer Container
⇠Impact of Stopping Chaincode Container
⇑ Hyperledger Fabric Docker Containers
⇑⇑ Hyperledger Tutorials
2020-07-03, 952👍, 2💬
Popular Posts:
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user e...
What is EPUB 2.0 Metadata "dc:creator" and "dc:contributor" elements? EPUB 2.0 Metadata "dc:creator"...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
What Is session_register() in PHP? session_register() is old function that registers global variable...