fabric createChannel创建通道

fabric createChannel创建通道,第1张

[root@iZ8vbjcbks7pzj9po96hleZ test-network]# ./network.sh createChannel
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
Network Running Already
Using docker and docker-compose
Generating channel genesis block ‘mychannel.block’
/opt/fabric/scripts/fabric-samples/bin/configtxgen

configtxgen -profile TwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel
2022-06-08 14:48:23.792 CST 0001 INFO [common.tools.configtxgen] main -> Loading configuration
2022-06-08 14:48:23.799 CST 0002 INFO [common.tools.configtxgen.localconfig] completeInitialization -> orderer type: etcdraft
2022-06-08 14:48:23.799 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
2022-06-08 14:48:23.799 CST 0004 INFO [common.tools.configtxgen.localconfig] Load -> Loaded configuration: /opt/fabric/scripts/fabric-samples/test-network/configtx/configtx.yaml
2022-06-08 14:48:23.800 CST 0005 INFO [common.tools.configtxgen] doOutputBlock -> Generating genesis block
2022-06-08 14:48:23.800 CST 0006 INFO [common.tools.configtxgen] doOutputBlock -> Creating application channel genesis block
2022-06-08 14:48:23.800 CST 0007 INFO [common.tools.configtxgen] doOutputBlock -> Writing genesis block

res=0
Creating channel mychannel
Using organization 1

osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7053 --ca-file /opt/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --client-cert /opt/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /opt/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key

res=0
Status: 201
{
“name”: “mychannel”,
“url”: “/participation/v1/channels/mychannel”,
“consensusRelation”: “consenter”,
“status”: “active”,
“height”: 1
}

Channel ‘mychannel’ created
Joining org1 peer to the channel…
Using organization 1

peer channel join -b ./channel-artifacts/mychannel.blockres=0
2022-06-08 14:48:29.863 CST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 14:48:29.881 CST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel
Joining org2 peer to the channel…
Using organization 2peer channel join -b ./channel-artifacts/mychannel.blockres=0
2022-06-08 14:48:32.920 CST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 14:48:32.937 CST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel
Setting anchor peer for org1…
Using organization 1
Fetching channel config for channel mychannel
Using organization 1
Fetching the most recent configuration block for the channelpeer 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
2022-06-08 06:48:33.046 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 06:48:33.048 UTC 0002 INFO [cli.common] readBlock -> Received block: 0
2022-06-08 06:48:33.048 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 0
2022-06-08 06:48:33.049 UTC 0004 INFO [cli.common] readBlock -> Received block: 0
Decoding config block to JSON and isolating config to Org1MSPconfig.jsonconfigtxlator proto_decode --input config_block.pb --type common.Block --output config_block.jsonjq ‘.data.data[0].payload.data.config’ config_block.json
Generating anchor peer update transaction for Org1 on channel mychanneljq ‘.channel_group.groups.Application.groups.Org1MSP.values += {“AnchorPeers”:{“mod_policy”: “Admins”,“value”:{“anchor_peers”: [{“host”: “peer0.org1.example.com”,“port”: 7051}]},“version”: “0”}}’ Org1MSPconfig.jsonconfigtxlator proto_encode --input Org1MSPconfig.json --type common.Config --output original_config.pbconfigtxlator proto_encode --input Org1MSPmodified_config.json --type common.Config --output modified_config.pbconfigtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pbconfigtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.jsonjq .
++ cat config_update.jsonecho ‘{“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
2022-06-08 06:48:33.210 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 06:48:33.218 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update
Anchor peer set for org ‘Org1MSP’ on channel ‘mychannel’
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 channelpeer 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
2022-06-08 06:48:33.328 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 06:48:33.330 UTC 0002 INFO [cli.common] readBlock -> Received block: 1
2022-06-08 06:48:33.330 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 1
2022-06-08 06:48:33.331 UTC 0004 INFO [cli.common] readBlock -> Received block: 1configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json
Decoding config block to JSON and isolating config to Org2MSPconfig.jsonjq ‘.data.data[0].payload.data.config’ config_block.json
Generating anchor peer update transaction for Org2 on channel mychanneljq ‘.channel_group.groups.Application.groups.Org2MSP.values += {“AnchorPeers”:{“mod_policy”: “Admins”,“value”:{“anchor_peers”: [{“host”: “peer0.org2.example.com”,“port”: 9051}]},“version”: “0”}}’ Org2MSPconfig.jsonconfigtxlator proto_encode --input Org2MSPconfig.json --type common.Config --output original_config.pbconfigtxlator proto_encode --input Org2MSPmodified_config.json --type common.Config --output modified_config.pbconfigtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pbconfigtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.jsonjq .
++ cat config_update.jsonecho ‘{“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
2022-06-08 06:48:33.505 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2022-06-08 06:48:33.513 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update
Anchor peer set for org ‘Org2MSP’ on channel ‘mychannel’
Channel ‘mychannel’ joined
[root@iZ8vbjcbks7pzj9po96hleZ test-network]#
[root@iZ8vbjcbks7pzj9po96hleZ test-network]#

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/1498500.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-25
下一篇 2022-06-25

发表评论

登录后才能评论

评论列表(0条)

保存