Deploying Chain Code

**Hyperledger Fabric Standard****Hyperledger Fabric Standard**

Hyperledger Fabric Standard

  1. Choose the Network tab and go to [Console > Fabric > Channel Detail] if you're trying to deploy a chaincode on Luniverse console
  1. Go to a Chaincode List page, and then click the [Chaincode] menu button. You can check the lists of chaincode being deployed or already deployed on the Chaincode List page.
  1. Click on the [Add New Chaincode] button. (Free Trial users need to click on the [Create Chain Code] button). Then, you are directed to a [Chaincode Create] page as shown in the screenshot above. Here, you enter information on chaincode you want to deploy.
  • Chaincode name
    • Your chaincode must be between two and 50 characters long. The underbar (_) and dash (-) are only allowed for special characters.
    • Special characters are not allowed for the first and last digit.
      Ex) *1contract (X) 1contract- (X) 1-contract (O)
  • Chaincode Description
    • Enter short descriptions about your chaincode.
  • Chaincode Version
    • You can enter letters, numbers, underscore, period, and dash. But, special characters are not allowed as the first digit.
  • Initial value of chaincode (for Free Trial)
    • Argument of the init function of chaincode should be in JSON Array format.
  • Chaincode Source File
    • Zip the entire directory containing the chaincode source code and upload it.
    • MAC users should zip files with a command line. Otherwise, your chaincode deployment may fail.
    • Luniverse supports Go, Java, and Node.js, the official languages supported by Hyperledger Fabric.
    • Language will be automatically set and deployed.
  1. Once you click on the [Create] button, your chaincode is registered and is now displayed on the Chaincode List.
  1. Your chaincode has not yet deployed to a channel. To fully deploy your chaincode, you must choose and click your chaincode. You will now see the current deployment status, indicating which peer node the chaincode is installed on, and whether the chaincode is instantiated on the channel.
  1. Click the [Install] button and the chaincode starts installing on the Peer node. It takes less than one minute to install and its status changes from [Installing] to [Installed]. Once successfully created, it is now time to instantiate the chaincode on the Channel. Select the channel for which you want to activate the chaincode and click the [Instantiate] button.
  1. Once you click the [Instantiate] button, you need to enter the initial value of the chaincode. Argument of the init function of chaincode should be in JSON Array format.
  1. Fill in this argument blank and click the [Instantiate] button to start chaincode instantiation on the channel. It takes less than one minute and its status changes from [Instantiating] to [Instantiated].

Now, you're done with all the steps to deploy your chaincode. You can now invoke the chaincode from a DApp by using Hyperledger Fabric SDK.