如何解决即使获得所有组织的批准,也无法提交链代码
我已经批准了频道所有组织的链码。正如下面的 checkcommitereadiness 命令输出批准的 json。
#peer lifecycle chaincode checkcommitreadiness -o localhost:9050 --channelID supplychain-channel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/freight.example.com/orderers/orderer0.freight.example.com/msp/tlscacerts/tlsca.freight.example.com-cert.pem --name supplychain --version 1.0 --sequence 1 --output json --init-required --signature-policy "AND ('ShipperMSP.peer','FreightMSP.peer','CarrierMSP.peer','CustomMSP.peer','ConsigneeMSP.peer')"
{
"approvals": {
"CarrierMSP": true,"ConsigneeMSP": true,"CustomMSP": true,"FreightMSP": true,"ShipperMSP": true
}
}
但是在提交时出现以下错误
#peer lifecycle chaincode commit -o orderer0.freight.example.com:9050 --ordererTLSHostnameOverride orderer0.freight.example.com --tls --version 1.0 --sequence 1 --init-required --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/freight.example.com/orderers/orderer0.freight.example.com/msp/tlscacerts/tlsca.freight.example.com-cert.pem --channelID supplychain-channel --name supplychain
Error: proposal failed with status: 500 - failed to invoke backing implementation of 'CommitChaincodeDefinition': chaincode definition not agreed to by this org (FreightMSP)
它是一个多主机结构网络,托管使用 docker swarm。尽管我能够在从主机本身提交链码生命周期中的命令之前执行所有命令。但我收到此错误
Error: failed to retrieve endorser client for commit: endorser client failed to connect to localhost:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7051: connect: connection refused"
为了与 swarm 网络中的所有节点通信,我试图从 CLI 容器执行提交命令,但出现“无法调用‘CommitChaincodeDefinition’的支持实现”错误。
解决方法
它解决了只需要为提交添加--signature-policy:
peer lifecycle chaincode commit -o orderer0.freight.example.com:9050 --ordererTLSHostnameOverride orderer0.freight.example.com --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/freight.example.com/orderers/orderer0.freight.example.com/msp/tlscacerts/tlsca.freight.example.com-cert.pem --channelID supplychain-channel --name supplychain --peerAddresses peer0.shipper.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/shipper.example.com/peers/peer0.shipper.example.com/tls/ca.crt --peerAddresses peer0.freight.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/freight.example.com/peers/peer0.freight.example.com/tls/ca.crt --peerAddresses peer0.carrier.example.com:11051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/carrier.example.com/peers/peer0.carrier.example.com/tls/ca.crt --peerAddresses peer0.custom.example.com:13051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/custom.example.com/peers/peer0.custom.example.com/tls/ca.crt --peerAddresses peer0.consignee.example.com:15051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/consignee.example.com/peers/peer0.consignee.example.com/tls/ca.crt --version 1 --sequence 1 --init-required --signature-policy "AND ('ShipperMSP.peer','FreightMSP.peer','CarrierMSP.peer','CustomMSP.peer','ConsigneeMSP.peer')"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。