API Gateway

Oracle Blockchain Platform Digital Assets Edition uses API Gateway service to deploy wrapper APIs generated by Blockchain App Builder.

Wrapper API endpoints are published on API Gateway by using a Resource Manager stack on Oracle Cloud Infrastructure (OCI). Stacks deploy and manage groups of cloud resources in a predefined and repeatable manner, which can simplify the orchestration and automation of infrastructure provisioning. The OCI API Gateway service enables you to publish APIs with private endpoints that are accessible from within your network, and which you can expose with public IP addresses if you want them to accept internet traffic.

Oracle Blockchain Platform REST API endpoints require you to pass parameters such as the chaincode name, timeout and sync values, and arguments including the method name every time you invoke the API. In scenarios where the parameters are common to all methods, you can use wrapper APIs to invoke the API using only the method arguments. Each chaincode method will have a distinct wrapper API endpoint. In some cases, multiple REST API endpoints from different chaincodes and also Oracle Identity Cloud Service endpoints can be merged to form a single wrapper API endpoint.

The following example shows calling the associateTokenToAccount method with Oracle Blockchain Platform.

Endpoint: https://<blockchain_instance>:7443/restproxy/api/v2/channels/default/transactions
{
    "chaincode": "{{bc-chaincode-name}}",
    "args": [
        "associateTokenToAccount",
        "oaccount~78b47483e4033a0c6be3b678080264e7967d53f56d4b024edd96eb8957c452d4",
        "t2"
    ],
    "timeout": {{bc-timeout}},
    "sync": {{bc-sync}}
}

With the wrapper APIs supported by Oracle Blockchain Platform Digital Assets Edition, the same invocation looks like the following example:

Endpoint: https://<blockchain_instance>/appbuilder/associate
{
 "accountId":"oaccount~efc22a0316a47dd06679920140717b686c7366a627a707c5e8c89015bb21796a",
 "tokenId":"t1"
}

API Gateway is configured as part of a stack deployment when you deploy your wrapper APIs as described in Deploy Wrapper APIs.