status: 500, message: cannot get package for chaincode

☆樱花仙子☆ 提交于 2019-12-22 18:11:33

问题


root@93272a1da547:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n fabrep -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"

While trying to instantiate my chaincode, I am getting the following error:

2018-06-19 09:03:09.526 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-06-19 09:03:09.526 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error endorsing chaincode: rpc error: code = Unknown desc = chaincode error (status: 500, message: cannot get package for chaincode (fabrep:1.0))

Can anyone tell what this means? and how to resolve the error?


回答1:


  • First check if chaincode is installed on the peer

  • $ peer chaincode list --installed

  • And ran the instantiate command with the exact name of the installed chaincode




回答2:


Ensure that the chaincode is installed first on the peer before attempting to instantiate.

Use the install command:

peer chaincode install ...

You can use the documentation of here as a guide: https://hyperledger-fabric.readthedocs.io/en/release-1.1/commands/peerchaincode.html#peer-chaincode-install



来源:https://stackoverflow.com/questions/50925777/status-500-message-cannot-get-package-for-chaincode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!