【问题标题】:unable to Instantiate any chaincodes on peers of newly Added org无法在新添加的组织的对等点上实例化任何链码
【发布时间】:2018-04-28 16:22:01
【问题描述】:

我将 org3 添加到现有网络以进行余额转移示例添加后,我尝试在 org1 和 org3 的对等方上安装新的链代码,同时实例化我收到此错误

无法获取链码 (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\":[]
}"

【问题讨论】:

    标签: hyperledger-fabric blockchain


    【解决方案1】:

    似乎链代码install 可能不成功。在通过对等点在通道中实例化之前,请确保在该对等点上运行链代码安装并成功完成。

    【讨论】:

    • 我没有收到任何失败的安装消息 我收到失败的实例化消息
    • 我已经为 org1 和 org3 安装了代码 echo "POST Install chaincode on Org1" echo curl -s -X POST \ localhost:4000/chaincodes \ -H "authorization: Bearer $ORG1_TOKEN" \ - H "content-type: application/json" \ -d "{ \"peers\": [\"peer0.org1.example.com\",\"peer1.org1.example.com\"], \"chaincodeName \":\"dtwin\", \"chaincodePath\":\"$CC_SRC_PATH\", \"chaincodeType\": \"$LANGUAGE\", \"chaincodeVersion\":\"v0\" }" echo
    【解决方案2】:

    使用正确的路径安装链代码(我建议将您的链代码复制到 balance-transfer 文件夹内的 artifacts/src/github 路径)并从该路径执行 go build -o $chaincode_name 并尝试实例化链代码。当我遇到同样的错误时,它对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-06
      • 1970-01-01
      • 2018-09-27
      • 2019-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多