对等通道 fectch 错误:通道上未定义 MSP SampleOrg

问题描述 投票:0回答:2

我已经部署了 Hyperledger Fabric 并 cd 到 Fabric-samples/test-network,我可以运行命令

./network.sh up createChannel
,容器的状态为“up”,我可以部署链码。 但是,当我打算运行命令时

peer channel fetch config config_block.pb -o $ORDERER_CONTAINER -c $CH_NAME --tls --cafile $TLS_ROOT_CA

要获取通道配置,我得到了

2022-05-17 10:09:31.644 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2022-05-17 10:09:31.647 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{FORBIDDEN}
Error: can't read the block: &{FORBIDDEN}

我检查了订购者的日志,它给出了

2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 061 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 062 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 063 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [common.deliver] deliverBlocks -> WARN 064 [channel: mychannel] Client 12.11.52.5:50846 is not authorized: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied

我注意到在

network.sh up createChannel
日志中,命令正确运行,结果如下

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/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2022-05-16 15:35:42.810 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2022-05-16 15:35:42.816 UTC [cli.common] readBlock -> INFO 002 Received block: 1
2022-05-16 15:35:42.816 UTC [channelCmd] fetch -> INFO 003 Retrieving last config block: 1
2022-05-16 15:35:42.818 UTC [cli.common] readBlock -> INFO 004 Received block: 1
Decoding config block to JSON and isolating config to Org2MSPconfig.json
+ configtxlator proto_decode --input config_block.pb --type common.Block
+ jq '.data.data[0].payload.data.config'

我尝试在日志中复制相同的命令,然后在

cli bash
中运行它 结果还是一样。

我找不到类似的错误,我不明白为什么会出现这个错误。 有人有什么想法吗?

hyperledger-fabric hyperledger msi-patch
2个回答
0
投票

我通过修改

docker-compose-test-net.yaml
解决了这个问题,我将
cli
拆分为
cli1,cli2
,每个组织一个,并且
peer channel fetch
命令正确运行。


0
投票

我最近遇到了这个问题。事实证明,我们使用的组织名称不一致 - 注册对等时的

org1
与执行后续连接时的
Org1

© www.soinside.com 2019 - 2024. All rights reserved.