Tools, FAQ, Tutorials:
Download Blocks from Blockchain
How to download blocks from the blockchain on the peer?
✍: FYIcenter.com
You can follow this tutorial to
download blocks from the blockchain on the peer.
1. Connect to the peer container and setup membership variables:
$ docker exec -it peer0.org1.example.com bash root@aedfd08717a5:/opt/gopath/src/github.com/hyperledger/fabric# cd root@aedfd08717a5:~# export CORE_PEER_LOCALMSPID=Org1MSP root@aedfd08717a5:~# export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp
2. Get information about the blockchain of the "mychannel" channel:
root@aedfd08717a5:~# peer channel -c mychannel getinfo Blockchain info: {"height":1, "currentBlockHash":"X9wYVYmoD4HoXkWVlm1n2n9L2gJEa2PYa8AwAN9CdA4="}
3. Get information about the blockchain of the "mychannel" channel:
root@aedfd08717a5:~# peer channel -c mychannel fetch 0 first.block root@aedfd08717a5:~# ls -l -rw-r--r-- 1 root root 9235 Apr 1 02:52 first.block
As you can see, the channel only has one block, the genesis block. We downloaded a copy to a file.
Â
⇒ Check "couchdb" Database Server
⇠Connet to basic-network Peer
⇑ fabric-samples/basic-network
⇑⇑ Hyperledger Tutorials
2020-03-25, 803👍, 0💬
Popular Posts:
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
How To Add Column Headers to a Table? If you want to add column headers to a table, you need to use ...
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to a...