Deploy a Chaincode

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 install the chaincode on the required peers before you can deploy it.
  • You can deploy more than one chaincode on a channel.
  • The process to deploy the sample chaincodes is different than the deployment process described in this topic. See Explore Oracle Blockchain Platform Using Samples.
You must be an administrator to complete this task.
  1. Go to the console and click the Chaincodes tab.
  2. On the Chaincodes page, locate the chaincode package and click its More Actions menu, and then 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 Type Select the language that the chaincode is written in. For external chaincodes (chaincode as a service), select External.
    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 page and click the name of the channel that you deployed the chaincode on. Go to the Deployed Chaincodes page and confirm that the chaincode is listed in the summary table.