I am new to hyperledger and is going through the example here . I am tried to play around the chaincode but is now stuck at the part where I am suppose to upgrade the chaincode
I have tried to execute the peer chaincode upgrade within the docker peer node:
peer chaincode upgrade -n tuna-app -p github.com/tuna-app
but end up with the error
Error getting (testchainid) orderer endpoint: Error endorsing GetConfigBlock: rpc error: code = Unknown desc = chaincode error (status: 500, message: "GetConfigBlock" request failed authorization check for channel [testchainid]: [Failed to get policy manager for channel [testchainid]])
Here you have some basic script in bash:
You need of course share some certs to your peer0.org1 and of course the chaincode itself (in js or go), here you have some docker-compose.yml part:
Then you can check the logs by:
I need to say, that upgrading chaincode in development take the same amount of time as just recreate whole blockchain (without pulling new images - this should be removed from ./runApp.sh script).
You need to specify the channel name for which you'd like to upgrade the chaincode, also need to specify args and new version. Moreover you have to specify the ordering service endpoints so peer cli will be able to submit the upgrade transaction:
You can find more here.