0
votes

After successfully installing the chaincode in dev-mode When I try to instantiate/upgrade my chaincode this error is shown-

Error endorsing chaincode: rpc error: code = Unknown desc = Failed to init chaincode(handler not found for chaincode mycc:1)

These are the commands I used-

Install command(no error in execution)-

peer chaincode install -p chaincodedev/chaincode/chaincode_example02 -n mycc -v 1

Instantiate command-

peer chaincode instantiate -n mycc -v 1 -c '{"Args":["init","a","100","b","200"]}' -C myc

Upgrade command-

peer chaincode upgrade -n mycc -v 2 -c '{"Args":["init","a","100","b","200"]}' -C myc
1

1 Answers

0
votes

Two things to check out:

  1. Are you running your chaincode with following environment variables?

    CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_ADDRESS=127.0.0.1:7052 CORE_CHAINCODE_ID_NAME=mycc:1

  2. In your instantiate and upgrade command you are missing pointer to the ordering service e.g. you need to run it:

    peer chaincode upgrade -n mycc -v 2 -c '{"Args":["init","a","100","b","200"]}' -C myc -o orderingServiceIP:7051

Please also take a look into tutorials.