All Products
Search
Document Center

Blockchain as a Service:Upgrade chaincode

Last Updated:Mar 31, 2026

Upgrade an existing chaincode in a channel to update its source code, version number, deployment channel, endorsement policy, or private data collection configuration.

Note

This topic applies to Fabric V2.2 instances. For Fabric V1.4, see Manage chaincode (V1.4).

Chaincodes implement smart contracts in the Hyperledger Fabric framework and can be written in Node.js, Go, or Java. More languages will be supported in the future.

Prerequisites

Before you begin, ensure that you have:

  • A chaincode already deployed in a channel. If no chaincode is deployed yet, see Deploy chaincodes

Upgrade a chaincode

Step 1: Update and redeploy the chaincode package (optional)

Skip this step if you are only updating the endorsement policy or private data collection configuration without changing the source code.

To update the source code, modify it locally, package it, and deploy it to the channel. Follow the "Upload the chaincode", "Install the chaincode", and "Submit the chaincode definition" sections in Deploy chaincodes.

After deployment, Upgrade appears in the Actions column and the Status in Channel column shows Running.

Step 2: Initiate the upgrade

In the chaincode list, click Upgrade in the Actions column of the chaincode you want to upgrade.

Step 3: Review and modify parameters

In the dialog box that appears, review the parameters and update them as needed.

Modify parameters
Important

Do not change the chaincode name. In the Privacy Set Configuration parameter, the name and blockToLive JSON fields cannot be modified once set — even during an upgrade.

Step 4: Submit the upgrade request

Click Upgrade. A record for the upgraded chaincode appears in the organization's chaincode list, and the Status in Channel column changes to In consensus.

Upgrade a chaincode

Step 5: Confirm and submit the chaincode definition from another organization

In another organization in the channel, confirm and submit the chaincode definition. Follow the "Submit the chaincode definition" section in Deploy chaincodes.

After all required organizations approve the upgrade, the new chaincode record replaces the original. The Status in Channel column changes from In consensus to Running, and both Upgrade and Display Log appear in the Actions column.

Upgraded
Note

By default, at least 50% of the organizations in the channel must approve the chaincode definition before the upgrade takes effect.