This series of articles:
Chapter one: nine analyze with you after blasting hyperledger fabric - Quick Start basic-network Sample
Chapter II: nine analyze with you after blasting hyperledger fabric - to quickly build environment GO
Chapter 3: nine analyze with you after blasting hyperledger fabric - Quick Start Sample first-network
Chapter 4: nine analyze with you after blasting hyperledger fabric - system logic architecture articles
Chapter V: nine analyze with you after blasting hyperledger fabirc - Network Node Introduction
Chapter 8: nine analyze with you easily complete explosion hyperledger fabric - Couchdb installation
Chapter 9: nine analyze with you easily complete explosion hyperledger fabric - NVM installation and Nodejs
Chapter 11: nine analyze with you easily complete explosion hyperledger fabric - to create alliances
table of Contents
1 Introduction
2 configtxlator get
3 configtxlator verification
4 View block information
4.1 start configtxlator server
4.2 View block information
1 Introduction
We are talking about the fabric section on the Union, the Organization and related concepts channels, and use configtxgen create a coalition founding block contains channel information. But if you try to use a text editor to view .block block information, they found a binary code. This section will use another tool to view and edit .block configtxlator file.
configtxlator superposition configtx and translator, it is a binary message format conversion tools and json-readable format between.
Because the fabric, the configuration file .tx trading block and file creation .block are binary message format, users can not view and edit. configtxlator tool provides API, allowing users to update the configuration.
2 configtxlator get
configtxlator need to compile the source code can be generated. About fabric Source GO access and configure the build environment, please refer to my chapter and Chapter III .
common / tools / configtxlator directory into the source code under fabirc, as shown below:
Execute the following statement:
go install --tags = nopkcs11 # mac operating system
View $ GOPATH / bin directory found configtxlator executable file has been generated:
3 configtxlator verification
In the second chapter because I have been set up environment variables PATH, and therefore can be verified by executing the following command configtxlator tool is installed successfully:
configtxlator --help
4 View block information
4.1 start configtxlator server
Run the following command to start configtxlator server:
configtxlator start
After successfully starting the shots are as follows:
4.2 View block information
In the nine sections analyze with you in the first-network fabric-sample under's easy to create a founding blocks, the following screenshot:
Name creation block for jiuxi-channel.block, if you open a text editor and found all garbled, we use the following information to the json configtxlator do binary information conversion.
Using the following command can generate json format file according jiuxi-channel.block:
curl -X POST --data-binary @jiuxi-channel.block http://127.0.0.1:7059/protolator/decode/common.Block > jiuxi-channel.json
After the command is executed, it will generate in the directory jiuxi-channel.json file format, and then open the file editing tools, content creation blocks have been found to read the text. As shown in the screenshot below:
Since then, nine analysis has brought you use configtxlator tools to easily complete explosion binary information format to convert json format file.