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

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/689553.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用实例详解Java中的类、对象、继承及多态性,一文理解Java类和对象、多态性的概念

Java中的类、对象、继承及多态性详解 Java作为一门面向对象的编程语言&#xff0c;其核心概念包括类、对象、继承以及多态性。这些概念是Java编程的基础&#xff0c;理解和掌握它们对于编写高效、可维护的Java代码至关重要。本文将结合实例详细讲解这些概念&#xff0c;并解释…

专业140+总分420+南京信息工程大学811信号与系统考研经验南信大电子信息与通信工程,真题,大纲,参考书

今年顺利被南信大电子信息录取&#xff0c;初试420&#xff0c;专业811信号与系统140&#xff08;Jenny老师辅导班上140很多&#xff0c;真是大佬云集&#xff09;&#xff0c;今年应该是南信大电子信息最卷的一年&#xff0c;复试线比往年提高了很多&#xff0c;录取平均分380…

扭蛋机小程序开发:发展优势

商场中精美的扭蛋机一直都是年轻人的心头好&#xff0c;目前&#xff0c;扭蛋机商品也不在局限于各种小型玩具&#xff0c;也逐渐与各类热门IP合作&#xff0c;打造出了各类手办、周边等&#xff0c;深受各个年龄层的喜爱。 如今&#xff0c;扭蛋机在互联网的推动下&#xff0…

算法的基本概念

设么是算法&#xff1f; 什么是好的算法/ 什么是算法&#xff1a; 量水的问题&#xff1a; 方案如下&#xff1a;&#xff08;核心思路就是两个桶差值为2&#xff0c;两次差值为4&#xff0c;7-(5-4) 6&#xff09; 算法&#xff1a;准确描述的 “操作步骤 (问题求解步骤)”&…

数据结构中图的概念以及遍历算法的实现

在数据结构中&#xff0c;图&#xff08;Graph&#xff09;是由节点&#xff08;Vertex&#xff09;和连接节点的边&#xff08;Edge&#xff09;组成的一种非线性数据结构。图可以用来表示各种实际问题中的关系和连接&#xff0c;如社交网络、道路网络、电路等。 图由两个主要…

MFC写入文件中文乱码解决办法

&#x1f482; 个人主页:pp不会算法^ v ^ &#x1f91f; 版权: 本文由【pp不会算法v】原创、在CSDN首发、需要转载请联系博主 &#x1f4ac; 如果文章对你有帮助、欢迎关注、点赞、收藏(一键三连)和订阅专栏哦 产生原因: visual studio的默认编码是Unicode&#xff0c;但是tx…

2023年全球架构师峰会(ArchSummit北京站2023):核心内容与学习收获(附大会核心PPT下载)

本次峰会是一场集结了全球顶级技术专家和行业领袖的盛会。作为一年一度的重要技术交流活动&#xff0c;本次峰会聚焦当前及未来软件架构的发展趋势、技术挑战与创新实践&#xff0c;旨在为参会者提供一个深度交流、学习与合作的平台。在为期两天的会议中&#xff0c;与会者不仅…

SQL Developer 小贴士:Unshared Worksheet

在Oracle SQL Developer中&#xff0c;最常用的功能应该是SQL Worksheet&#xff0c;或Worksheet。 可以创建两类Worksheet&#xff0c;即Worksheet和Unshared Worksheets。前者是共享数据库连接的&#xff0c;后者会单独创建自己的连接。前者的快捷键是AltF10&#xff1b;后者…

ACK One:构建混合云同城容灾系统

作者&#xff1a;蔡靖 对于当前业务运行在 IDC 内的 Kubernetes 集群中&#xff0c;希望通过云计算为云下业务提供同城灾备的高可用冗余能力&#xff0c;可利用阿里云分布式云容器平台 ACK One [ 1] 来提供统一得流量、应用和集群管理&#xff0c;实现业务流量的多集群路由和灾…

学习Android的第十六天

目录 Android 自定义 Adapter Adapter 接口 SpinnerAdapter ListAdapter BaseAdapter 自定义 BaseAdapter 参考文档 Android ListView 列表控件 ListView 的属性和方法 表头表尾分割线的设置 列表从底部开始显示 android:stackFromBottom 设置点击颜色 cacheColorH…

【Linux】28、命令行参数 语法格式

文章目录 一、没有括号二、[]三、{}四、<>五、...六、|七、() 命令行参数很复杂&#xff0c;通过 --help 会看到很多符号&#xff0c;比如 [] {} () <> | …&#xff0c;他们都是什么意思呢&#xff1f;一般格式如下&#xff1a; 命令<必选参数1|必选参数2>…

【自然语言处理】:实验4布置,预训练语言模型实现与应用

清华大学驭风计划 因为篇幅原因实验答案分开上传&#xff0c;自然语言处理专栏持续更新中&#xff0c;期待的小伙伴敬请关注 有任何疑问或者问题&#xff0c;也欢迎私信博主&#xff0c;大家可以相互讨论交流哟~~ 案例简介 2018年&#xff0c;Google提出了预训练语言模型BE…

jbpm4使用的一些问题 ,供挣扎于老项目的码农们参考

这里写自定义目录标题 springboot jbpm4.4mysql 双数据源问题疑问 springboot jbpm4.4mysql 双数据源问题 疑问 basic&#xff1a; 项目同时支持hibernatemybatis 可行 1.jbpm4是否只支持hibernate&#xff1f; 2使用时如何指定jbpm使用的数据源

基于PSO优化的GRU多输入时序回归预测(Matlab)粒子群优化门控循环单元神经网络时序回归预测

目录 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 亮点与优势&#xff1a; 二、实际运行效果&#xff1a; 三、部分程序&#xff1a; 四、完整代码数据分享下载&#xff1a; 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 本代码基于Matlab平台…

扩展语音识别系统:增强功能与多语言支持

一、引言 在之前的博客中&#xff0c;我们成功构建了一个基于LibriSpeech数据集的英文语音识别系统。现在&#xff0c;我们将对系统进行扩展&#xff0c;增加一些增强功能&#xff0c;并尝试支持多语言识别。 二、增加增强功能 语音合成 --除了语音识别&#xff0c;我们还可以…

使用 ChatGPT系统学习一门知识的技巧

如何使用 ChatGPT 高效学习一门知识&#xff1f;我探索到一种比较高效的方式&#xff1a;首先让 ChatGPT 给你一个学习提纲&#xff0c;然后以此把提纲内容逐个发给 ChatGPT&#xff0c;进行详情学习。 下面以“学习八木天线”工作原理为例说明。 以八木天线为切入点&#xff0…

Hexo删除主题

一、找到存放主题的目录 1、一般在入博客中的theme目录&#xff0c;这里以next主题为例。 在theme目录中&#xff0c;打开Git Bash Here&#xff1b; ls 列出主题目录 rm -rf 填需要删除的主题目录 2、另一种情况&#xff0c;以fluid主题为例&#xff1b;之前不知道是用那种…

文物保护系统守护历史岁月,成都青铜展科技闪耀

一、“吉金万里-中国西南青铜文明展”隆重开幕 1月27日&#xff0c;“吉金万里-中国西南青铜文明展”在成都金沙遗址博物馆向公众开放&#xff0c;奉上一场精彩的青铜文明“盛宴”。本次展览汇集了中国西南地区32家文博单位&#xff0c;以青铜器为代表的294件经典文物&#xf…

17.1 SpringMVC框架_SpringMVC入门与数据绑定(❤❤)

17.1 SpringMVC框架_SpringMVC入门与数据绑定 1. SpringMVC入门1.1 MVC介绍1.2 环境配置1. 依赖引入2. web配置文件:DispatchServlet配置3. applicationContext.xml配置4. 开发Controller控制器(❤❤)1.3 MVC处理流程图2. Spring MVC数据绑定2.1 URL Mapping2.2 URL Mapping三个…

java 环境相关

一、MAC上Java相关 1、安装路径 一般默认 安装在&#xff1a;/Library/Java/JavaVirtualMachines 有时也会在&#xff1a;/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 可以通过输入&#xff1a;/usr/libexec/java_home&#xff0c;确认安装目录 wy…