Deploy a Chaincode on a Peer to Test the Chaincode

After you create a chaincode, you must install, instantiate, and invoke it to test that it works correctly.

If you need help writing a chaincode, see Write a Chaincode.

Follow these steps to deploy and test your chaincode.

  1. Identify the channel or create a new channel and add peers to it. See Join a Peer to a Channel.

  2. Install the chaincode on the peers and instantiate it on the channel. See Use Quick Deployment.

  3. Configure a REST proxy node:

    1. You can optionally configure a REST proxy node before you can enable it to interact with chaincodes. See Configure a REST Proxy Node.

    2. Enable your chaincode to be called by a REST proxy node. See Enable a Chaincode in a REST Proxy.

  4. Use the Invoke and query REST APIs to test the chaincode with cURL through the REST proxy. See REST API for Oracle Blockchain Platform for descriptions of each endpoint and correct cURL syntax to invoke each operation.

  5. Go to the Channels tab in the console and locate and click the name of the channel running the blockchain.

  6. In the channel’s Ledger pane, view the chaincode’s ledger summary.