这是“Chaincode for Developers Cli error terminal 3”的后续问题。我正在做Chaincode for Developers教程,在运行peer chaincode instantiate -n mycc -v 0 -c '{"Args":["a","10"]}' -C myc
命令时出现以下错误。航站楼3。
命令peer chaincode instantiate -n mycc -v 0 -c '{"Args":["a","10"]}' -C myc
的输出:
Error: Error getting (myc) orderer endpoint: Error endorsing GetConfigBlock: rpc error: code = Unknown desc = chaincode error (status: 500, message: "GetConfigBlock" request failed authorization check for channel [myc]: [Failed to get policy manager for channel [myc]])
命令的输出:
peer chaincode install -p chaincodedev/chaincode/sacc -n mycc -v 0
2017-08-23 15:10:21.852 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP 2017-08-23 15:10:21.852 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity 2017-08-23 15:10:21.852 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc 2017-08-23 15:10:21.852 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc 2017-08-23 15:10:21.904 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS chaincodedev/chaincode/sacc 2017-08-23 15:10:22.080 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt 2017-08-23 15:10:22.081 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim 2017-08-23 15:10:22.081 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer 2017-08-23 15:10:22.082 UTC [golang-platform] GetDeploymentPayload -> DEBU 009 done 2017-08-23 15:10:22.085 UTC [msp/identity] Sign -> DEBU 00a Sign: plaintext: 0AA3080A5B08031A0B08DEB5F6CC0510...DF65FC130000FFFFF65F638E00120000 2017-08-23 15:10:22.085 UTC [msp/identity] Sign -> DEBU 00b Sign: digest: 00E981BB0FC2A7D32706156C0F2E1521E5B62F58E231787D87B2CB57CD10C3FA 2017-08-23 15:10:22.089 UTC [chaincodeCmd] install -> DEBU 00c Installed remotely response: 2017-08-23 15:10:22.089 UTC [main] main -> INFO 00d Exiting.....
我不得不注释掉
command: /bin/bash -c './script.sh
在文件“docker-compose-simple.yaml”中运行命令
docker exec -it cli bash
。谁能告诉我如何解决这个问题?
最佳答案
好吧,我可以看到一些问题,这些问题可能是您所描述的错误的根本原因。首先请注意,在实例化命令期间:
peer chaincode instantiate -n mycc -v 0 -c '{"Args":["a","10"]}' -C myc
您并不是要指向订购服务,因为实例化是一项背书交易,最终必须将其提交给订购服务,因此应该是这样的:
peer chaincode instantiate -o ordererEndpoint:7050 -n mycc -v 0 -c '{"Args":["a","10"]}' -C myc
请注意,您收到的错误会提示您,因为它指出无法获取配置块:
Error: Error getting (myc) orderer endpoint: Error endorsing GetConfigBlock: rpc error: code = Unknown desc = chaincode error (status: 500, message: "GetConfigBlock" request failed authorization check for channel [myc]: [Failed to get policy manager for channel [myc]])
另外,请确保
myc
是现有 channel ,并且您已经正确创建了它。您可以简单地执行以下操作:peer channel list
检索对等已加入的 channel 列表。
关于docker - 实例化Chaincode时Chaincode for Developers教程错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45843791/