Explore Oracle Blockchain Platform Using Samples (Hyperledger Fabric v1.4.7)

You can install, instantiate, and invoke the sample chaincodes included in Oracle Blockchain Platform.

You must be an administrator to install and instantiate 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. Instantiate the chaincode.
    1. Click the chaincode’s Instantiate button.
    2. In the Instantiate Chaincode dialog select the channel you want to instantiate the chaincode to, and specify any required parameters. Click Instantiate.
  5. Go to the Channels tab and click the name of the channel that you instantiated the sample chaincode to.
    1. In the Channel Information page, click the Instantiated 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.

    • In the Ledger table, locate the block with the Type of data (sys).

    • Click the block and in the Transactions table, click the arrow icon to display more information about the block. Confirm that the Function Name field displays “deploy.”

  7. If needed, go to the Chaincodes tab and instantiate the chaincode on other channels.
    If you're working on a network that contains multiple members and have instantiated the chaincode on the founder, then you don’t have to instantiate the chaincode on the participants where you installed the same chaincode. In such cases, the chaincode is already instantiated and running on the participants.
    1. Locate the name of the chaincode you want to instantiate in the table and click it.
    2. In the Chaincode Information page, click the Instantiate on a New Chaincode button.
    3. In the Instantiate Chaincode dialog specify the required information.
  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 execute the chaincode.
    4. Click Execute. The Transaction Results shows returned values, and the API details field displays the detailed log of all blockchain processes performed from invoking the transaction.
  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. Confirm that the Ledger pane is selected, and in the Query Ledger table, locate the block number indicating that 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.