在Hyperledger Fabric中(在没有Docker的情况下)渠道创建失败

时间:2019-10-01 11:20:39

标签: hyperledger-fabric

我在不使用Docker的情况下在Hyperledger Fabric v1.4.3中创建频道时遇到了一些麻烦。我只需执行cryptogenconfigtxgen,然后启动订购者和同伴,就可以成功生成密钥,证书,创世块和各种工件。但是,当我尝试使用命令

创建频道时

peer channel create -c mychannel -o 127.0.0.1:7050

由于"BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating Readset: existing config does not contain element for [Group] /Channel/application/SampleOrg but was in the read set而失败。

命令列表下方(从fabric-samples/first-network目录执行):

# cryptogen generate --config=./crypto-config.yaml

# export FABRIC_CFG_PATH=$PWD
# mkdir channel-artifacts
# configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
# export CHANNEL_NAME=mychannel
# configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
# configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
# configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP

# sudo mkdir -p /var/hyperledger/production
# sudo chown -R $(whoami):$(whoami) /var/hyperledger
# orderer start

# export set FABRIC_CFG_PATH=$HOME/fabric-samples/config
# peer node start >> peerlog.log 2>&1 &

# peer channel create -o 127.0.0.1:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx

这是尝试创建通道后对等终端的输出:

2019-10-01 12:51:11.955 CEST [ChannelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating ReadSet: existing config does not contain element for [Group] 
 /Channel/Application/Org1MSP but was in the read set

随后在订购者终端中:

2019-10-01 12:51:11.958 CEST [orderer.common.broadcast] ProcessMessage -> WARN 015 [channel: mychannel] Rejecting broadcast of config message from 127.0.0.1:48526 because of error: error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating ReadSet: existing config does not contain element for [Group] 
 /Channel/Application/Org1MSP but was in the read set
2019-10-01 12:51:11.958 CEST [comm.grpc.server] 1 -> INFO016 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=127.0.0.1:48526 grpc.code=OK grpc.call_duration=1.14698ms
2019-10-01 12:51:11.961 CEST [comm.deliver] Handle ->WARN017 Error reading from 127.0.0.1:48524: rpc error: code = Canceled desc = context canceled
2019-10-01 12:51:11.961 CEST [comm.grpc.server] 1 -> INFO 018 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=127.0.0.1:48524 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=5.834477ms

任何帮助将不胜感激,我已经尝试了所有在网上找到的解决方案。预先谢谢你。

修改

这是我在orderer.yaml中修改的:

LocalMSPDir: /home/rfiorini/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp

这是我在core.yaml中修改的:

mspConfigPath: /home/rfiorini/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp

0 个答案:

没有答案