Use the REST APIs to Develop Applications

The REST APIs provided by Oracle Blockchain Platform have been created with maximum flexibility in mind; you can call a transaction, run a query, or view the status of a transaction. However, this means that you'll likely want to wrap the existing API endpoints in an application to provide object-level control. Applications can support much more fine-grained operations.

Any application that uses the REST APIs requires the following information:

  • The chaincode name and version.
  • The REST server URL and port, and the user ID and password for the REST node.
  • Functions to call transactions against or query the ledger.

See REST API for Oracle Blockchain Platform for information on the existing operations, including examples and usage syntax.

Structuring your Application

Structure your REST API application similar to the following example:

/Application
  /artifacts
    /crypto
      /orderer
        Contains the certificates required for the application to act on the orderer node
        In participant instances only contains TLS certificates
      /peer
        Contains the certificates required for the application to act on the peer node
    /src
  /REST
    Application script containing REST API calls