Tools, FAQ, Tutorials:
Not All Member Peers Run Chaincode
How to find out which member peers are running a given chaincode?
✍: FYIcenter.com
When a chaincode is instantiated on a channel,
you don't need all member peers to install the chaincode and run it.
But we have to have some member peers to install and run it.
Otherwise, no transactions can be performed on this chaincode instance.
Let's use the BYFN network as an example to find out which member peers are actually have the chaincode installed and kept running.
1. Connect to the CLI container:
$ docker exec -it cli bash bash-4.4#
2. Check installed and instantiated chaincode list on each peer with the help peer switching scripts:
bash-4.4# source peer0-org1.sh bash-4.4# peer chaincode list --installed Get installed chaincodes on peer: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/... bash-4.4# peer chaincode list -C mychannel --instantiated Get instantiated chaincodes on channel mychannel: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/... bash-4.4# source peer1-org1.sh bash-4.4# peer chaincode list --installed Get installed chaincodes on peer: bash-4.4# peer chaincode list -C mychannel --instantiated Get instantiated chaincodes on channel mychannel: Name: mycc, Version: 1.0, Escc: escc, Vscc: vscc bash-4.4# source peer0-org2.sh bash-4.4# peer chaincode list --installed Get installed chaincodes on peer: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/... bash-4.4# peer chaincode list -C mychannel --instantiated Get instantiated chaincodes on channel mychannel: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/... bash-4.4# source peer1-org2.sh bash-4.4# peer chaincode list --installed Get installed chaincodes on peer: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/... bash-4.4# peer chaincode list -C mychannel --instantiated Get instantiated chaincodes on channel mychannel: Name: mycc, Version: 1.0, Path: github.com/chaincode/chaincode_example02/...
As you can see, all 4 peers are members of "mychannel" channel. But only 3 peers, peer0-org1, peer0-org2, and peer1-org2, have "mycc" chaincode installed and running.
1 peer, peer1-org1, does not have "mycc" chaincode installed. But it maintains a copy channel ledger (Blockchain and World State). So it is still synchronized with the latest property values of "mycc" chaincode.
⇒ Impact of Stopping Chaincode Container
2019-04-17, 1049🔥, 0💬
Popular Posts:
How To Protect Special Characters in Query String in PHP? If you want to include special characters ...
FYIcenter.com Online Tools: FYIcenter JSON Validator and Formatter FYIcenter JSON to XML Converter F...
How to use urllib.parse.urlencode() function to encode HTTP POST data? My form data has special char...
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
How to use the "Ctrl-p Ctrl-q" sequence to detach console from the TTY terminal of container's runni...