Upgrade a Chaincode

(Hyperledger Fabric v2.2.4) If a developer modifies a chaincode’s source, then you’ll need to deploy it to a new version of the chaincode.

You can deploy different versions of the same chaincode on different channels.
You must be an administrator to perform this task. If you use the console, the upgrade process includes both approving and committing the upgraded chaincode. You can also use the REST API to upgrade a deployed chaincode by using the same calls that you use to install, approve, and commit a chaincode. For more information, see REST API for Oracle Blockchain Platform on Oracle Cloud Infrastructure (Gen 2).
  1. Go to the console and select the Channels tab.
    The Channels tab is displayed and the table lists all of the channels on the network.
  2. Click the channel where the chaincode that you want to upgrade is deployed, and then click Deployed Chaincodes.
  3. Locate the chaincode that you want to upgrade, click More Actions, and select Upgrade.
    The Upgrade Chaincode page is displayed.
  4. Specify a Chaincode Version and select a Package ID to use in the chaincode definition.
  5. If the chaincode requires initialization, select Init-required.
    If Init-required is selected, the client application must invoke the Init function explicitly, by specifying the isInit flag, before calling any other function.
  6. If required, enter an endorsement policy and private data collections, and then click Upgrade.
    The chaincode is upgraded and deployed.