In Hyperledger Fabric framework, the chaincode is a ‘smart contract’ that runs on the peers and creates transactions. BaaS currently supports Go and Node.js, and will support languages such as Java in the future.
This document describes how to upgrade a chaincode that already exists in the channel. If you want to install a new chaincode for the channel, see Install chaincodes.
Upgrade the chaincode source files locally and pack the files.
Note: When you pack the files, you need to specify the chaincode name. The name of the chaincode must be the same as the previous version, and the version number must be different.
Add the upgraded chaincodes from above. For more information, see Install chaincodes in Deploy chaincodes.
Install chaincodes in multiple organizations. For more information, see Install chaincodes in Deploy chaincodes.
After you have installed the chaincodes, the chaincode status in the Actions column changes to Upgrade and the chaincode status in the Channels column changes to Upgradable.
In the Actions column, click Upgrade.
In the dialog box that appears, enter the endorsement policy if you need to change the policy
Click Superior in the dialog box, enter the new collection definition JSON file if you need to change it. Attention, once
blockToLiveset, you can’t change it anymore in upgrade.
finally click Upgrade.
This operation may take several seconds to several minutes, depending on the complexity of the chaincode dependency. After the chaincode has been successfully updated, the chaincode status changes from Upgradable to Running, and the value of the Actions column becomes empty.