Use the advanced deployment option to specify the parameters required to deploy a chaincode into a production environment. For example, you’ll specify which peers to install the chaincode on and the endorsement policy to use.
The process to deploy sample chaincodes is different than the process described in this topic. See Explore Oracle Blockchain Platform Using Samples.
You can use the quick deployment option for chaincode testing. Quick deployment is a one-step deployment that uses default settings, installs the chaincode on all peers in the channel, and instantiates the chaincode using a default endorsement policy. See Use Quick Deployment.
You can’t delete a chaincode from the network.
- Go to the console and select the Chaincodes tab.
- In the Chaincodes tab, click Deploy a New Chaincode.The Deploy Chaincode page is displayed.
- Click Advanced Deployment.The Deploy Chaincode (Advanced) Step 1 of 3: Install page is displayed.
- In the Chaincode Name field, enter a unique name for the chaincode. In the Version field, enter the chaincode’s version number.The Oracle Blockchain Platform chaincode name and version requirements are different than the Hyperledger Fabric requirements. You must use the Oracle Blockchain Platform naming requirements. Use these guidelines when naming the chaincode:
- Use ASCII alphanumeric characters, ('') quotes, dashes (-), and underscores (_).
- The name must start and end only with ASCII alphanumeric characters. For example, you can't use names like _mychaincode or mychaincode_.
- Dashes (-) and underscores (_) must be followed with ASCII alphanumeric characters. For example, you can't use names like my--chaincode or my-_chaincode.
- The name must be 1 to 64 characters long.
- A chaincode version can contain a period (.).
- A chaincode version can contain a plus (+).
- Select one or more network peers to install the chaincode onto. To provide high availability, Oracle suggests that you choose the appropriate number of peers from each partition. Also, the peers you choose must be joined to the channel that you’ll instantiate the chaincode on.
- Click the Chaincode Source field and browse for the chaincode ZIP file to upload and deploy. Click Next.The chaincode is installed and the Deploy Chaincode (Advanced) Step 2 of 3: Instantiate page is displayed.
- Decide if you want to instantiate the chaincode now or later.
The chaincode is instantiated and the Deploy Chaincode (Advanced) Step 3 of 3: Enable in REST Proxy page is displayed.
- Click Close to close the wizard and instantiate later.
- To instantiate now, select the channel to instantiate the chaincode on and the peers to instantiate the chaincode to. If required, enter initial parameters, an endorsement policy, transient map, and private data collections. Note the following information:
Instantiation compiles, builds, and initializes the chaincode on the peers.
If you leave the endorsement policy blank, then Oracle Blockchain Platform uses the default endorsement policy. The default endorsement policy gets an endorsement from any peer on the network.
When instantiation is complete, the peers are able to accept chaincode invocations and can endorse transactions.
- Decide if you want to enable the chaincode in the REST proxy now or later. The REST proxy enables the chaincode to interact and process ledger transactions with the Oracle Blockchain REST APIs rather that the native Hyperledger Fabric APIs.
Click Next.You receive confirmation that the chaincode was deployed successfully. The deployed chaincode’s name is displayed in the Chaincode tab’s table.
- Click Close to close the wizard and to enable in the REST proxy later, if needed.
- To enable now, select one or more REST proxies and the peers required to endorse the transactions. The Peers list contains the peers that have the chaincode installed on them and that are joined to the channel you selected.
Note that if you’ve selected more than one peer, choose one peer from each partition for the purposes of resiliency and high availability. That way if one peer is down, the other peer can perform the endorsement, and if one of the partitions is either slow or not running, then the required endorsement can still be gotten.