Fabric V2.5 test-network启动日志分析

这篇具有很好参考价值的文章主要介绍了Fabric V2.5 test-network启动日志分析。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

背景

分析Fabric网络的启动日志可以帮我们理解搭建区块链网络的过程。本文对输出日志进行详细的分析。

启动网络与创建通道
# verbose 可以输出更详细的日志。
./network.sh up createChannel -verbose
# 使用本机安装的docker and docker-compose
Using docker and docker-compose
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database leveldb with crypto from 'cryptogen'
Bringing up network
# 启动的Fabric版本
LOCAL_VERSION=v2.5.5
DOCKER_IMAGE_VERSION=v2.5.5
# 使用cryptogen创建证书材料,相较于ca更简单,配置文件在./organizations/cryptogen中,如果我们要修改节点数量可以去修改配置文件。
/home/real/project/fabric-samples/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
# 日志中输出的命令使用了`set -x`,结果是命令前会加`+` ,res=0代表脚本运行无异常。
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
+ #创建连接配置文件(connection.json,可用于连接区块链网络)
Generating CCP files for Org1 and Org2
# 启动区块链网络,先是启动Docker网络,然后创建容器的卷,最后启动节点。
[+] Running 8/8
 ⠿ Network fabric_test                      Created                                                                                 0.4s
 ⠿ Volume "compose_orderer.example.com"     Created                                                                                 0.0s
 ⠿ Volume "compose_peer0.org1.example.com"  Created                                                                                 0.0s
 ⠿ Volume "compose_peer0.org2.example.com"  Created                                                                                 0.0s
 ⠿ Container peer0.org2.example.com         Started                                                                                 4.9s
 ⠿ Container peer0.org1.example.com         Started                                                                                 4.0s
 ⠿ Container orderer.example.com            Started                                                                                 3.8s
 ⠿ Container cli                            Started                                                                                11.2s
 # 查看容器的运行状态,0.0.0.0:7050->7050/tcp代表了本机的7050端口映射到了容器内部的7050端口,我们可以通过端口与节点通信。
CONTAINER ID   IMAGE                               COMMAND             CREATED          STATUS                  PORTS                                                                                                                             NAMES
992e8d8d5e30   hyperledger/fabric-tools:latest     "/bin/bash"         12 seconds ago   Up Less than a second                                                                                                                                     cli
1370216ab0c4   hyperledger/fabric-orderer:latest   "orderer"           12 seconds ago   Up 7 seconds            0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:7053->7053/tcp, :::7053->7053/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp   orderer.example.com
f1c2301c3448   hyperledger/fabric-peer:latest      "peer node start"   12 seconds ago   Up 7 seconds            0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:9444->9444/tcp, :::9444->9444/tcp                                              peer0.org1.example.com
4f26366203bc   hyperledger/fabric-peer:latest      "peer node start"   12 seconds ago   Up 6 seconds            0.0.0.0:9051->9051/tcp, :::9051->9051/tcp, 7051/tcp, 0.0.0.0:9445->9445/tcp, :::9445->9445/tcp                                    peer0.org2.example.com
Using docker and docker-compose
# 创建mychannel的创世区块
Generating channel genesis block 'mychannel.block'
Using organization 1
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_ADDRESS=localhost:7051
CORE_PEER_TLS_ROOTCERT_FILE=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
CORE_PEER_MSPCONFIGPATH=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ENABLED=true
/home/real/project/fabric-samples/test-network/../bin/configtxgen
+ '[' 0 -eq 1 ']'
# 默认使用的共识算法是Raft
+ configtxgen -profile ChannelUsingRaft -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel
2024-02-19 10:38:18.428 CST 0001 INFO [common.tools.configtxgen] main -> Loading configuration
2024-02-19 10:38:18.435 CST 0002 INFO [common.tools.configtxgen.localconfig] completeInitialization -> orderer type: etcdraft
2024-02-19 10:38:18.436 CST 0003 INFO [common.tools.configtxgen.localconfig] completeInitialization -> Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216 
2024-02-19 10:38:18.437 CST 0004 INFO [common.tools.configtxgen.localconfig] Load -> Loaded configuration: /home/real/project/fabric-samples/test-network/configtx/configtx.yaml
2024-02-19 10:38:18.464 CST 0005 INFO [common.tools.configtxgen] doOutputBlock -> Generating genesis block
2024-02-19 10:38:18.465 CST 0006 INFO [common.tools.configtxgen] doOutputBlock -> Creating application channel genesis block
2024-02-19 10:38:18.466 CST 0007 INFO [common.tools.configtxgen] doOutputBlock -> Writing genesis block
+ res=0
Creating channel mychannel
# order节点加入通道,如果通过不存在则会创建通道
Adding orderers
+ . scripts/orderer.sh mychannel
+ '[' 0 -eq 1 ']'
+ res=0
Status: 201
{
        "name": "mychannel",
        "url": "/participation/v1/channels/mychannel",
        "consensusRelation": "consenter",
        "status": "active",
        "height": 1
}

Channel 'mychannel' created
# 两个组织的peer节点加入通道
Joining org1 peer to the channel...
Using organization 1
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_ADDRESS=localhost:7051
CORE_PEER_TLS_ROOTCERT_FILE=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
CORE_PEER_MSPCONFIGPATH=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ENABLED=true
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=0
2024-02-19 10:38:24.878 CST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 10:38:24.941 CST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel
Joining org2 peer to the channel...
Using organization 2
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_ADDRESS=localhost:9051
CORE_PEER_TLS_ROOTCERT_FILE=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem
CORE_PEER_MSPCONFIGPATH=/home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ENABLED=true
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=0
2024-02-19 10:38:28.110 CST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 10:38:28.180 CST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel
Setting anchor peer for org1...
# 设置锚节点,更新通道配置 详细可以参考:https://hyperledger-fabric.readthedocs.io/zh-cn/latest/config_update.html
+ peer channel fetch config config_block.pb -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
Using organization 1
Fetching channel config for channel mychannel
Using organization 1
Fetching the most recent configuration block for the channel
2024-02-19 02:38:28.650 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 02:38:28.662 UTC 0002 INFO [cli.common] readBlock -> Received block: 0
2024-02-19 02:38:28.663 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 0
2024-02-19 02:38:28.667 UTC 0004 INFO [cli.common] readBlock -> Received block: 0
+ configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json
Decoding config block to JSON and isolating config to Org1MSPconfig.json
+ jq '.data.data[0].payload.data.config' config_block.json
Generating anchor peer update transaction for Org1 on channel mychannel
+ jq '.channel_group.groups.Application.groups.Org1MSP.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "peer0.org1.example.com","port": 7051}]},"version": "0"}}' Org1MSPconfig.json
+ configtxlator proto_encode --input Org1MSPconfig.json --type common.Config --output original_config.pb
+ configtxlator proto_encode --input Org1MSPmodified_config.json --type common.Config --output modified_config.pb
+ configtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pb
+ configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.json
+ jq .
++ cat config_update.json
+ echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":{' '"channel_id":' '"mychannel",' '"isolated_data":' '{},' '"read_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org1MSP":' '{' '"groups":' '{},' '"mod_policy":' '"",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '},' '"write_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org1MSP":' '{' '"groups":' '{},' '"mod_policy":' '"Admins",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"AnchorPeers":' '{' '"mod_policy":' '"Admins",' '"value":' '{' '"anchor_peers":' '[' '{' '"host":' '"peer0.org1.example.com",' '"port":' 7051 '}' ']' '},' '"version":' '"0"' '},' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"1"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '}}}}'
+ configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope --output Org1MSPanchors.tx
2024-02-19 02:38:29.404 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 02:38:29.430 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update
Anchor peer set for org 'Org1MSP' on channel 'mychannel'
# 同样方式设置org2的锚节点
Setting anchor peer for org2...
Using organization 2
Fetching channel config for channel mychannel
Using organization 2
Fetching the most recent configuration block for the channel
+ peer channel fetch config config_block.pb -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
2024-02-19 02:38:29.952 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 02:38:29.964 UTC 0002 INFO [cli.common] readBlock -> Received block: 1
2024-02-19 02:38:29.964 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 1
2024-02-19 02:38:29.970 UTC 0004 INFO [cli.common] readBlock -> Received block: 1
Decoding config block to JSON and isolating config to Org2MSPconfig.json
+ configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json
+ jq '.data.data[0].payload.data.config' config_block.json
Generating anchor peer update transaction for Org2 on channel mychannel
+ jq '.channel_group.groups.Application.groups.Org2MSP.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "peer0.org2.example.com","port": 9051}]},"version": "0"}}' Org2MSPconfig.json
+ configtxlator proto_encode --input Org2MSPconfig.json --type common.Config --output original_config.pb
+ configtxlator proto_encode --input Org2MSPmodified_config.json --type common.Config --output modified_config.pb
+ configtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pb
+ configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.json
+ jq .
++ cat config_update.json
+ echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":{' '"channel_id":' '"mychannel",' '"isolated_data":' '{},' '"read_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org2MSP":' '{' '"groups":' '{},' '"mod_policy":' '"",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '},' '"write_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org2MSP":' '{' '"groups":' '{},' '"mod_policy":' '"Admins",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"AnchorPeers":' '{' '"mod_policy":' '"Admins",' '"value":' '{' '"anchor_peers":' '[' '{' '"host":' '"peer0.org2.example.com",' '"port":' 9051 '}' ']' '},' '"version":' '"0"' '},' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"1"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '}}}}'
+ configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope --output Org2MSPanchors.tx
2024-02-19 02:38:30.617 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-02-19 02:38:30.650 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update
Anchor peer set for org 'Org2MSP' on channel 'mychannel'
# 通道创建完成
Channel 'mychannel' joined
安装链码

链码的生命周期:https://hyperledger-fabric.readthedocs.io/en/release-2.5/chaincode_lifecycle.html文章来源地址https://www.toymoban.com/news/detail-831359.html

Using docker and docker-compose
# 在mychannel上部署链码
deploying chaincode on channel 'mychannel'
# 链码的信息
executing with the following
- CHANNEL_NAME: mychannel
- CC_NAME: basic
- CC_SRC_PATH: ../asset-transfer-basic/chaincode-go/
- CC_SRC_LANGUAGE: go
- CC_VERSION: 1.0.1
- CC_SEQUENCE: auto
- CC_END_POLICY: NA
- CC_COLL_CONFIG: NA
- CC_INIT_FCN: NA
- DELAY: 3
- MAX_RETRY: 5
- VERBOSE: false
executing with the following
- CC_NAME: basic
- CC_SRC_PATH: ../asset-transfer-basic/chaincode-go/
- CC_SRC_LANGUAGE: go
- CC_VERSION: 1.0.1
# 将链码依赖的外部包复制到项目根目录下的 vendor 目录中
Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go/
~/project/fabric-samples/asset-transfer-basic/chaincode-go ~/project/fabric-samples/test-network
~/project/fabric-samples/test-network
Finished vendoring Go dependencies
+ '[' false = true ']'
# 将链码打包
+ peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go/ --lang golang --label basic_1.0.1
+ res=0
Chaincode is packaged
# 在peer0.org1上安装链码
Installing chaincode on peer0.org1...
Using organization 1
+ peer lifecycle chaincode queryinstalled --output json
+ jq -r 'try (.installed_chaincodes[].package_id)'
+ grep '^basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc$'
+ test 1 -ne 0
+ peer lifecycle chaincode install basic.tar.gz
+ res=0
2024-02-19 10:44:54.109 CST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nLbasic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc\022\013basic_1.0.1" > 
2024-02-19 10:44:54.121 CST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc
Chaincode is installed on peer0.org1
# 在peer0.org2上安装链码
Install chaincode on peer0.org2...
Using organization 2
+ peer lifecycle chaincode queryinstalled --output json
+ jq -r 'try (.installed_chaincodes[].package_id)'
+ grep '^basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc$'
+ test 1 -ne 0
+ peer lifecycle chaincode install basic.tar.gz
+ res=0
2024-02-19 10:46:08.629 CST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nLbasic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc\022\013basic_1.0.1" > 
2024-02-19 10:46:08.630 CST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc
Chaincode is installed on peer0.org2
++ peer lifecycle chaincode querycommitted --channelID mychannel --name basic
++ sed -n '/Version:/{s/.*Sequence: //; s/, Endorsement Plugin:.*$//; p;}'
Error: query failed with status: 404 - namespace basic is not defined
+ COMMITTED_CC_SEQUENCE=
+ res=0
Using organization 1
+ peer lifecycle chaincode queryinstalled --output json
+ jq -r 'try (.installed_chaincodes[].package_id)'
+ grep '^basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc$'
+ res=0
basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc
Query installed successful on peer0.org1 on channel
Using organization 1
# 批准链码
+ peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/real/project/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0.1 --package-id basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc --sequence 1
+ res=0
2024-02-19 10:46:11.491 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [c2c32a622a7d34097918df2a19745e591a3f46fafbf266188f94998ae5b65523] committed with status (VALID) at localhost:7051
Chaincode definition approved on peer0.org1 on channel 'mychannel'
Using organization 1
Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'...
Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
+ peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0.1 --sequence 1 --output json
+ res=0
{
        "approvals": {
                "Org1MSP": true,
                "Org2MSP": false
        }
}
Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel'
Using organization 2
Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'...
Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
+ peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0.1 --sequence 1 --output json
+ res=0
{
        "approvals": {
                "Org1MSP": true,
                "Org2MSP": false
        }
}
Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel'
Using organization 2
# 在org2上批准链码
+ peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/real/project/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0.1 --package-id basic_1.0.1:47d9190a6fc27edcbef163a7ff3058851c35a7cf1a6d6fcabcb0ed9d925695fc --sequence 1
+ res=0
2024-02-19 10:46:20.189 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [badf93e5bfe9c9fabafb5d233e2d33370a7890c8293c7fbf476eaf152ecacefe] committed with status (VALID) at localhost:9051
Chaincode definition approved on peer0.org2 on channel 'mychannel'
Using organization 1
Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'...
Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
+ peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0.1 --sequence 1 --output json
+ res=0
{
        "approvals": {
                "Org1MSP": true,
                "Org2MSP": true
        }
}
Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel'
Using organization 2
Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'...
Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
+ peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0.1 --sequence 1 --output json
+ res=0
{
        "approvals": {
                "Org1MSP": true,
                "Org2MSP": true
        }
}
Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel'
Using organization 1
Using organization 2
# 提交链码定义
+ peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/real/project/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --peerAddresses localhost:7051 --tlsRootCertFiles /home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem --peerAddresses localhost:9051 --tlsRootCertFiles /home/real/project/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem --version 1.0.1 --sequence 1
+ res=0
2024-02-19 10:46:29.117 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [0cc2d54bea837c4bb8cbe3ac958c0254147c1e5cfb0bfd64bac3d17d9664a518] committed with status (VALID) at localhost:7051
2024-02-19 10:46:29.248 CST 0002 INFO [chaincodeCmd] ClientWait -> txid [0cc2d54bea837c4bb8cbe3ac958c0254147c1e5cfb0bfd64bac3d17d9664a518] committed with status (VALID) at localhost:9051
Chaincode definition committed on channel 'mychannel'
Using organization 1
Querying chaincode definition on peer0.org1 on channel 'mychannel'...
Attempting to Query committed status on peer0.org1, Retry after 3 seconds.
+ peer lifecycle chaincode querycommitted --channelID mychannel --name basic
+ res=0
Committed chaincode definition for chaincode 'basic' on channel 'mychannel':
Version: 1.0.1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
Query chaincode definition successful on peer0.org1 on channel 'mychannel'
Using organization 2
Querying chaincode definition on peer0.org2 on channel 'mychannel'...
Attempting to Query committed status on peer0.org2, Retry after 3 seconds.
+ peer lifecycle chaincode querycommitted --channelID mychannel --name basic
+ res=0
Committed chaincode definition for chaincode 'basic' on channel 'mychannel':
Version: 1.0.1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
Query chaincode definition successful on peer0.org2 on channel 'mychannel'
# 链码初始化完成
Chaincode initialization is not required

到了这里,关于Fabric V2.5 test-network启动日志分析的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【Fabric学习】什么是HyperLedger Fabric?

    本文总结自 Fabric官方文档 ,描述了Fabric产生的背景、特性、主要组件。 区块链 是不可更改的交易账本,由同等节点(peer nodes)组成的分布式网络来维护。 比特币:第一个使用区块链的应用; 以太坊:引入 智能合约 来开发分布式应用。 二者都是 公有链 ( public / permissi

    2024年01月19日
    浏览(48)
  • 【Hyperledger Fabric 学习】运行一个Fabric应用

    中文网址:https://hyperledger-fabric.readthedocs.io/zh_CN/latest 英文网址:https://hyperledger-fabric.readthedocs.io/en/latest 一般情况英文网址的内容更全面,版本也比中文新。 本教程介绍了 Fabric 应用程序如何与已部署的区块链网络进行交互。本教程使用使用 Fabric Gateway 客户端 API 构建的示例

    2023年04月08日
    浏览(70)
  • Hyperledger Fabric问题汇总

    Ubuntu 20.04 Hyperledger Fabric 2.3.3 SDK对应的Go 1.17.5 链码对应的Go 1.18 Fabric-sdk-go 1.0.0 Docker 20.10.12 Docker-Compose 2.11.2 调用命令: peer chaincode invoke -o localhost:7050 – ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts

    2024年02月04日
    浏览(47)
  • Hyperledger Fabric架构设计

    目录 1、逻辑架构 答疑:什么叫做背书策略? 2、运行时架构         答疑:什么是锚节点? Hyperledger Fabric从1.X开始,在扩展性及安全性方面有了很大的提升,且新增了诸多特性。 多通道:支持多通道,提高隔离安全性。 可插拔的组件:支持共识组件、权限管理组件等可

    2024年02月11日
    浏览(37)
  • Hyperledger Fabric 架构概览

    fabric 版本 v2.4.1 超级账本 Fabric 自诞生以来已经发布了两个主要版本:1.0 系列版本(2017 年 7 月)和 2.0 系列版本(2020 年 1 月)。2016 年 9 月,Fabric 发布了 v0.6.0 预览版本,通过这一版本社区收集了大量来自实践的反馈和建议,主要集中在性能、安全、可扩展性等方面。2017

    2024年02月01日
    浏览(40)
  • Hyperledger Fabric 环境搭建

    以 fabric:2.2.0 ; ca:1.4.7 为例 官网下载go Downloads - The Go Programming Language (google.cn) 没有问题就完成啦 官方安装脚本(修改过了): 两个简单脚本直接开启/关闭测试区块链: 开启: 关闭:

    2024年02月11日
    浏览(42)
  • Hyperledger Fabric 链码

    懂哪写哪,随时补充 链码在开发过程中需要实现链码接口,交易的类型决定了哪个接口函数将会被调用,链码的接口定义如下: 链码的必要结构如下: shim.ChaincodeStubInterface接口 1、Init方法 Init方法中,首先通过stub的GetFunctionAndParameters()方法提取本次调用的交易中所指定的

    2023年04月08日
    浏览(47)
  • 1.Hyperledger Fabric架构介绍

    Hyperledger是一个开放源代码的区块链项目合作组织,旨在推动跨行业的企业级区块链解决方案的发展。该项目由Linux基金会于2015年发起,致力于建立一个可靠、安全和可扩展的区块链框架和工具集。Hyperledger提供了一个集合,其中包含了多个不同的区块链框架、工具和库,用于

    2024年02月07日
    浏览(39)
  • 区块链hyperledger fabric部署

      新建目录、下载、解压 配置环境   将指定版本的 Hyperledger Fabric 平台特定二进制文件和配置文件安装到 fabric-samples 下的  /bin 和  /config  目录中,下载指定版本的 Hyperledger Fabric docker 镜像 2.2.1 配置镜像源 注:以上curl主要是为了获得一个 bootstrap.sh 的脚本文件并执行,可能

    2024年02月11日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包