我添加org3到现有网络进行余额转移示例一旦我添加我试图在org1和org3的对等端安装新的链代码,同时实例化我收到此错误
无法获取chaincode包(marbles02:v0)
recoveryParam: 0 }
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: cannot get package for chaincode (marbles02:v0))
at /home/ubuntu/fabric-samples/balance-transfer/node_modules/grpc/src/node/src/client.js:554:15
[2018-04-28 15:53:46.018] [INFO] instantiate-chaincode - instantiate proposal was good
[2018-04-28 15:53:46.018] [ERROR] instantiate-chaincode - instantiate proposal was bad
[2018-04-28 15:53:46.018] [DEBUG] instantiate-chaincode - Failed to send Proposal and receive all good ProposalResponse
[2018-04-28 15:53:46.019] [ERROR] instantiate-chaincode - Failed to instantiate. cause:Failed to send Proposal and receive all good ProposalResponse
我检查了对等方是否存在代码是否存在于此路径
root@9a8377b5940d:/var/hyperledger/production/chaincodes# ls
fabcar.v0 marbles02.v0
这是我运行实例化版本的命令,cc名称未更改
echo "POST instantiate chaincode on peer1 of Org3"
echo
curl -s -X POST \
http://localhost:4000/channels/mychannel/chaincodes \
-H "authorization: Bearer $ORG3_TOKEN" \
-H "content-type: application/json" \
-d "{
\"chaincodeName\":\"marbles02\",
\"chaincodeVersion\":\"v0\",
\"chaincodeType\": \"$LANGUAGE\",
\"args\":[]
}"
答案 0 :(得分:0)
似乎链码install
可能不成功。在通过对等体在通道中实例化之前,请确保在该对等体上运行了链代码并且它已成功完成。
答案 1 :(得分:0)
以正确的路径安装链码(建议将链码复制到余额转移文件夹中的artifacts/src/github
路径),然后从该路径执行go build -o $chaincode_name
并尝试实例化链码。当我遇到相同的错误时,它对我有用。