Generate Wrapper APIs Using Visual Studio Code

The enhanced version of Blockchain App Builder enables you to generate wrapper APIs in Visual Studio Code.

When you generate wrapper APIs in Visual Studio Code, you are prompted whether to overwrite any previous wrapper API packages that exist in the selection location.

API Gateway limits the number of routes that can be created in a single deployment to 50. If you try to generate more than 50 wrapper APIs, you are prompted whether to create multiple gateways. Creating multiple gateways with the same deployment path prefix maintains a consistent base path across all wrapper API endpoints. If you choose not to create multiple gateways, wrapper API generation is canceled.

  1. Select the chaincode project in the Chaincodes pane.
  2. Right-click the chaincode name and then select Generate Wrapper API Package. The Oracle Blockchain Platform - Wrapper API Package Generation pane opens.
  3. Enter the configuration variables as described in the following table.
    Field Description Default value
    Compartment OCID The OCID of the compartment in Oracle Cloud Infrastructure (OCI). none
    Compartment Name The name of the OCI compartment. none
    Identity Domain The identity domain to use. none
    Blockchain Channel The name of the Oracle Blockchain Platform channel where the chaincode is deployed. none
    Blockchain URL The Oracle Blockchain Platform URL associated with the chaincode deployment. none
    Location The system directory to generate the wrapper API package in. none
    Deployment Path Prefix The deployment path prefix in API Gateway, which specifies the path where routes are deployed. The deployment path prefix must begin with a slash (/). /<ChaincodeName>
    Blockchain Sync The sync value to include in the payload for API calls. true
    Blockchain Timeout The timeout value to include in the payload for API calls. 6000
    Policy Name The name of the policy that enables controlled management and access to APIs through defined permissions for groups and compartments within the organization ChaincodeName
    VCN Display Name The display name of the OCI virtual cloud network. ChaincodeName
    Application Display Name The display name of the OCI application. ChaincodeName
    Gateway Display Name The display name of API Gateway. ChaincodeName
    Deployment Display Name The display name of API Gateway. ChaincodeName
    OCI Repo Name The OCI Registry repository name, which must be all lowercase letters. ChaincodeName in lowercase characters
  4. Click Save.
  5. Click the Mapping tab. The Mapping pane shows a table of all of the controller APIs that are available in the chaincode. Each method has a corresponding API Endpoint, which you can edit as needed. Select the corresponding Generate Wrapper APIs check box to include the controller API in the wrapper API package. Click Select All to include all controller APIs.
  6. Click Save.
  7. Click Generate. The wrapper API package and associated Postman collection are generated.