在上一篇博客中我们已经成功启动了Fabric网络,接下来让我们来看看它在启动过程中发生了什么事。
一、日志输出分析
出现此输出,代表网络启动成功
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
在启动成功后,会自动执行scripts目录下的脚本,去做一些创建通道,加入通道,更新通道以及安装链码等操作。
1、首先创建通道(中间部分过长,省略输出):
Channel name : mychannel
Creating channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
*
*
*
*
*
*
===================== Channel "mychannel" is created successfully =====================
2、让所有节点加入通道:
Having all peers join the channel...
……
……(输出省略)
……
/**组织1的peer0节点加入通道*/
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2019-12-05 13:41:32.281 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-12-05 13:41:32.282 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-12-05 13:41:32.287 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-05 13:41:32.289 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C088C92A4EF0510...E1C0406CFACF1A080A000A000A000A00
2019-12-05 13:41:32.289 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 811F8513657C4F21342ED396947D18FAFB85A40C218788C3208E6C0245A994D3
2019-12-05 13:41:32.431 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2019-12-05 13:41:32.431 UTC [main] main -> INFO 007 Exiting.....
===================== PEER0 joined on the channel "mychannel" =====================
/**组织1的peer1节点加入通道*/
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
2019-12-05 13:41:35.598 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-12-05 13:41:35.598 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-12-05 13:41:35.610 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-05 13:41:35.611 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C088F92A4EF0510...E1C0406CFACF1A080A000A000A000A00
2019-12-05 13:41:35.611 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 321D6D6E235EAAEED1DEEFFC44D5DA1E4FA96F6D9542DD959ABF99A0421F9414
2019-12-05 13:41:35.714 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2019-12-05 13:41:35.714 UTC [main] main -> INFO 007 Exiting.....
===================== PEER1 joined on the channel "mychannel" =====================
/**组织2的peer0节点加入通道*/
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2019-12-05 13:41:38.925 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-12-05 13:41:38.925 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-12-05 13:41:38.929 UTC [ch