0

I added org3 to existing network for balance transfer example once I added I am trying to install new chaincode on peers of org1 and org3 while instantiating I am getting this error

cannot get package for 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

I checked the peers whether the code is existing or not its there at this path

root@9a8377b5940d:/var/hyperledger/production/chaincodes# ls
fabcar.v0  marbles02.v0

this is the command I ran to instantiate version and cc name is unchanged

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\":[]
}"
Darshu Bc
  • 526
  • 5
  • 22

2 Answers2

0

Seems like chaincode install may have been unsuccessful. Before instantiating in the channel through a peer, please make sure that chaincode installation was run on that peer and it completed successfully.

adnan.c
  • 721
  • 5
  • 15
  • I did not get any failed installation message I am getting failed instantiation message – Darshu Bc May 01 '18 at 13:58
  • I had installed code using this for both org1 and org3 echo "POST Install chaincode on Org1" echo curl -s -X POST \ http://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 – Darshu Bc May 03 '18 at 07:43
0

Install the chaincode with correct path (I recomend copying your chaincode to the path of artifacts/src/github inside the balance-transfer folder ) and do go build -o $chaincode_name from that path and try to instantiate the chaincode. It worked for me when I faced the same error.