Tools, FAQ, Tutorials:
Watch Chaincode Container Log
How to watch the log file of chaincode Container Log?
✍: FYIcenter.com
You can follow this tutorial to watch the log file of a chaincode container:
1. Set up new 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 ex02 Invoke Query Response:{"Name":"a","Amount":"80"} ex02 Invoke Query Response:{"Name":"b","Amount":"220"}
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 ex02 Invoke Aval = 90, Bval = 210 ex02 Invoke Aval = 80, Bval = 220
3. Query 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 query -C mychannel -n mycc -c '{"Args":["query","a"]}' 80
Only 1 message comes out from the chaincode container linked to peer0.org1.
ex02 Invoke Query Response:{"Name":"a","Amount":"80"}
No message comes out from the chaincode container linked to peer0.org2.
Query chaincode property only runs on the chaincode container linked to the peer who receives the query.
Â
⇒ Invoke Operation on Chaincode Container
⇠Peer Containers Not Joined to Channel
⇑ Hyperledger Fabric Docker Containers
⇑⇑ Hyperledger Tutorials
2020-06-08, 983👍, 0💬
Popular Posts:
How To Merge Cells in a Column? If you want to merge multiple cells vertically in a row, you need to...
Where to find tutorials on API Management Services at Azure Portal? Here is a list of tutorials to a...
How to create Hello-2.0.epub with WinRAR? I have all required files to create Hello-2.0.epub. To cre...
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
How to use the RSS Online Validator at w3.org? You can follow this tutorial to learn how to use the ...