Run the ORDS Script for the Deposit Token Application

After you create the instance and deploy the application, you can run the ORDS script.

You must meet the following prerequisites:
  • Node.js version 20.19 or later, 22.13 or later, or 23.5 or later.
  • You must have the ORDS script .zip file, which is downloadable from the service console.

Do not place production secrets in source control. Store database passwords, wallet files, OAuth client secrets, and bearer tokens in an approved secret management system. The script's committed .env file is a placeholder template only.

  1. Extract the ORDS script .zip file to a working directory.
  2. In the ORDSscript directory, open a terminal.
  3. Run the following commands to confirm that the version of Node.js on your system is supported.
    node --version
    npm install
  4. Configure the .env file by replacing placeholder values in the provided template. Do not add database passwords to this file; the command-line interface prompts for them interactively.
    # Common ORDS configuration
    CONNECTION_STRING="<Oracle connection string or TNS service alias>"
    VIEW_PREFIX="<unique deployment namespace>"
    MODULE_NAME="<unique ORDS module name>"
    BASE_PATH="<unique/ords/base/path/>"
    ITEMS_PER_PAGE="100"
    ORDS_REST_BASE_URL="https://<ords-host>"
    ALIAS_NAME="<REST-enabled schema alias>"
    ROLE_NAME="<unique ORDS role>"
    PRIVILEGE_NAME="<unique ORDS privilege>"
    LABEL="<privilege label>"
    DESCRIPTION="<deployment description>"
    CLIENT_NAME="<OAuth client name>"
    OWNER="<OAuth client owner>"
    SUPPORT_EMAIL="<support email>"
    
    # Besu Deposit Token configuration
    BESU_TABLE_PREFIX="<exact prefix before _more, _store_state and _store_hist>"
    BESU_TOKEN_CONTRACT="0x<deployed Deposit Token token proxy address>"
    BESU_ACCOUNT_CONTRACT="0x<deployed Account proxy address>"
    
    CONNECTION_STRING
    If the CONNECTION_STRING parameter is a TNS alias, extract the wallet and configure the Oracle client environment so that the tnsnames.ora file can be found. The compressed wallet .zip file alone is not sufficient.
    VIEW_PREFIX
    Unique namespace for operational and optional analytics views. Use a different prefix for each deployment that shares an Oracle schema.
    MODULE_NAME and BASE_PATH
    These parameters define the ORDS module identity and URL path. Keep both deployment-specific and unique.
    ALIAS_NAME
    REST-enabled Oracle schema alias used in the public ORDS URL and token URL.
    BESU_TABLE_PREFIX
    Exact rich history table prefix; it determines the source _more, _store_state, and _store_hist tables.
    BESU_TOKEN_CONTRACT
    Deployed deposit token proxy contract address.
    BESU_ACCOUNT_CONTRACT
    Deployed account proxy contract address.
  5. Enter the following command to run the script.
    npm run start
    1. Enter the Oracle database username and password.
    2. Select Besu as the blockchain platform.
    3. Select Deposit Token as the application type.
    4. If a prior run was incomplete, review the rollback prompt before choosing to revert objects.
    5. Select Yes to create ORDS REST endpoints.
    6. Select analytics views only when the deployment requires analytics output.
    7. Select Yes to generate an OAuth client when a new client is required for this deployment.
  6. If you selected endpoint and OAuth creation, retain the generated output in an approved secret store. The output contains the callable endpoint map, OAuth client ID, OAuth client secret, and a short-lived bearer-token response. Do not copy the client secret or bearer token to any source control system, file, wiki, or project management software that does not support approved secret handling. The following text shows sample output.
    {
      "ORDSEndpoint": "<generated endpoint URL or endpoint map>",
      "clientId": "<OAuth client ID>",
      "clientSecret": "<OAuth client secret>",
      "bearerToken": {
        "access_token": "<short-lived access token>",
        "token_type": "bearer",
        "expires_in": 3600
      }
    }
  7. If you selected OAuth client generation, retain the reported client ID and client secret in an approved secret store and use them to call an endpoint to verify system function. The following text shows the form of a token request
    curl --request POST \
      "https://<ords-host>/ords/<ALIAS_NAME>/oauth/token" \
      --user "<client-id>:<client-secret>" \
      --header "Content-Type: application/x-www-form-urlencoded" \
      --data "grant_type=client_credentials"
    Endpoint URLs use the following format.
    https://<ords-host>/ords/<ALIAS_NAME>/<BASE_PATH>/<route>
    The following command shows an example verification test.
    curl --location \
      "https://<ords-host>/ords/<ALIAS_NAME>/<BASE_PATH>/getAllDepositTokenAccounts?token_id=<TOKEN_ID>" \
      --header "Authorization: Bearer <access-token>" \
      --header "Accept: application/json"
  8. Verify that the script ran successfully by running the following checks.
    Blockchain Platform Manager profile
    The Oracle AI Database rich history profile exists and is selected for the instance.
    Rich history tables
    The configured BESU_TABLE_PREFIX resolves to _more, _store_state, and _store_hist tables.
    Indexed data
    At least one representative deposit token transaction is shown in the rich history data.
    Views
    All operational views exist under the configured VIEW_PREFIX.
    ORDS module
    The configured module is published at the expected BASE_PATH.
    OAuth
    A client credentials request returns an access token.
    API
    A valid authenticated request returns HTTP 200. An empty items list is acceptable when no matching ledger data exists.
    Isolation
    Views, module, role, privilege, client, and alias names are unique for deployments sharing one Oracle database.
    The following SQL queries are useful for validation.
    SELECT view_name
    FROM user_views
    WHERE view_name LIKE UPPER('<VIEW_PREFIX>') || '_%'
    ORDER BY view_name;
    
    SELECT name, uri_prefix, items_per_page, status
    FROM user_ords_modules
    WHERE name = '<MODULE_NAME>';