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
.zipfile, 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.
- Extract the ORDS script
.zipfile to a working directory. - In the
ORDSscriptdirectory, open a terminal. - Run the following commands to confirm that the version of Node.js on your system is supported.
node --version npm install - Configure the
.envfile 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_STRINGparameter is a TNS alias, extract the wallet and configure the Oracle client environment so that thetnsnames.orafile can be found. The compressed wallet.zipfile 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_NAMEandBASE_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_histtables. BESU_TOKEN_CONTRACT- Deployed deposit token proxy contract address.
BESU_ACCOUNT_CONTRACT- Deployed account proxy contract address.
- Enter the following command to run the script.
npm run start- Enter the Oracle database username and password.
- Select Besu as the blockchain platform.
- Select Deposit Token as the application type.
- If a prior run was incomplete, review the rollback prompt before choosing to revert objects.
- Select Yes to create ORDS REST endpoints.
- Select analytics views only when the deployment requires analytics output.
- Select Yes to generate an OAuth client when a new client is required for this deployment.
- 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 } } - 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
Endpoint URLs use the following format.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"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" - 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_PREFIXresolves to_more, _store_state, and _store_histtables. - 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
itemslist 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.
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>';