Tools, FAQ, Tutorials:
Verify Blockchain on the Channel
How to Verify Blockchain on the Channel?
✍: FYIcenter.com
Since all transactions (changes of assets managed by chaincodes)
are stored in the blockchain shared by all peers of the channel,
you can use the "peer channel" CLI command to look at them.
1. Connect to CLI container:
$ docker exec -it cli bash root@262918fdcbc0:/opt/gopath/src/github.com/hyperledger/fabric/peer# cd root@262918fdcbc0:~#
2. Get blockchain information of the channel:
root@262918fdcbc0:~# peer channel getinfo -c mychannel [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized Blockchain info: {"height":5,"currentBlockHash":"LEA0YQbIFIL/MdR+ii2Z4SrYSqaYs6lYpRDDSzjhe7U=", "previousBlockHash":"SiJr3cuCgeCySsnEIEuwdPQgUw9esibfWjooit+Oo58="}
We have 6 blocks in the blockchain.
3. Fetch the last block:
root@262918fdcbc0:~# peer channel fetch newest ./newest.block -c mychannel root@262918fdcbc0:~# ls -l -rw-r--r-- 1 root root 5815 Apr 1 16:43 newest.block
See next tutorial on how to parse the content of a block file.
Â
⇒ Read Block Data in Blockchain
⇠Verify World State in CouchDB
⇑ WYFA (Writing Your First Application)
⇑⇑ Hyperledger Tutorials
2020-02-20, 901👍, 0💬
Popular Posts:
Can You Specify the "new line" Character in Single-Quoted Strings? You can not specify the "new line...
Can You Specify the "new line" Character in Single-Quoted Strings? You can not specify the "new line...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
How to search for the first match of a regular expression using re.search()? The re.search() functio...