Explore Oracle Blockchain Platform Using Samples (Hyperledger Fabric v2.2.4)

You can install, deploy, and invoke the sample chaincodes that are included in Oracle Blockchain Platform.

You must be an administrator to install and deploy sample chaincodes. If you've got user permissions, then you can invoke sample chaincodes.
  1. Go to the console and select the Developer Tools tab.
  2. Click the Samples pane.
    The Chaincode Samples page is displayed.
  3. Locate the sample chaincode and install it.
    1. Choose the sample chaincode that you want to use and click the corresponding Install button.
    2. In the Install Chaincode dialog, specify one or more peers to install the chaincode on, and select which chaincode language you want to use (Go, Node.js, or Java). Click Install.
  4. Deploy the chaincode.
    1. Click the chaincode’s Deploy button.
    2. In the Deploy Chaincode dialog select the channel you want to deploy the chaincode on. Click Deploy.
  5. Go to the Channels tab and click the name of the channel that you deployed the sample chaincode on.
    1. In the Channel Information page, click the Deployed Chaincodes pane to confirm the chaincode's deployment on the channel.
    2. You can use the Ledger pane to locate information about individual transactions on the channel.
  6. Click the Ledger pane and confirm the following.
    • The Ledger Summary indicates one deployment occurred. A deployment consists of an approval and a commit.
    • In the Ledger table, locate the two blocks with a Type of data.
    • Click the first block and in the Transactions table, click the arrow icon to display more information about the block. Confirm that the Function Name field displays ApproveChaincodeDefinitionForMyOrg.
    • Click the second block and confirm that the Function Name field displays CommitChaincodeDefinition.
  7. If needed, go to the Chaincodes tab and deploy the chaincode on other channels.
    If you're working on a network that contains multiple members and have deployed the chaincode on the founder, then you don’t have to deploy the chaincode on the participants where you installed the same chaincode. In such cases, the chaincode is already deployed on the participants.
    1. Locate the package ID of the chaincode you want to deploy in the table and click it.
      The Installed Peers Summary page is displayed.
    2. Click Deployed on Channels.
    3. On the Deployed Channels Summary page, click the Deploy on a New Channel button.
    4. In the Deploy Chaincode dialog specify the required information, and then click Deploy.
  8. Invoke the chaincode.
    1. Go to the Chaincode Samples page, locate the chaincode you're working with, and click its Invoke button.
    2. In the Invoke Chaincode dialog, select a channel to run the transaction on.
    3. In the Action field, specify an action to complete using the chaincode.
    4. Click Execute.
  9. Confirm whether the chaincode invoked successfully.
    1. Go to the Channels tab, and locate and click the channel the chaincode was installed on.
    2. In the Ledger Summary table, locate the block number that indicates an invocation occurred.
    3. Click the block and confirm that in the Transactions table you see Success in the Status column.
  10. If needed, go to the Samples page and invoke any other operations on the chaincode.