Deploy a Chaincode

(Hyperledger Fabric v2.2.4) To deploy a chaincode, it must be approved by organizations and then committed to a channel. After a chaincode is deployed, peers are able to accept chaincode invocations and can endorse transactions.

Note the following information:
You must be an administrator to complete this task.
  1. Go to the console and select the Chaincodes tab.
  2. In the Chaincodes tab, locate the chaincode package and click its More Actions menu, and select Deploy.
    The Deploy Chaincode dialog is displayed.
  3. Enter information about where and how to deploy the chaincode.
    Field Description
    Channel Select the channel for the chaincode to run on.
    Chaincode Name Enter a unique name, up to 64 characters long, for the deployed chaincode.
    • Use ASCII alphanumeric characters, dashes (-), and underscores (_).
    • The name must start and end only with ASCII alphanumeric characters.
    • Dashes (-) and underscores (_) must be followed with ASCII alphanumeric characters.
    Version Enter a string value, up to 64 characters long, to specify the chaincode’s version number.
    • Use ASCII alphanumeric characters, dashes (-), underscores (_), periods (.) and plus signs (+).
    Init-required Select if the chaincode requires initialization. If selected, the client application must invoke the Init function explicitly, by specifying the isInit flag, before calling any other function.
    Endorsement Policy In this section, specify the policy required to endorse the chaincode.

    If you don’t specify an endorsement policy, then the default endorsement policy is used. The default endorsement policy gets an endorsement from any peer on the network.

    Private Data Collection In this section, add one or more private data collections. Private data collections specify subsets of organizations that endorse, commit, or query private data on the channel you deploy the chaincode on.
  4. Click Deploy.
    The chaincode is deployed.
  5. To confirm that the chaincode was deployed, go to the Channels tab and click the name of the channel that you deployed the chaincode on. Go to the Deployed Chaincodes tab and confirm that the chaincode is listed in the summary table.