Stablecoin Analytics

Oracle Blockchain Platform Digital Assets Edition includes a sample Oracle Analytics workbook for the stablecoin scenario.

To use the sample Oracle Analytics workbook, you must run the Oracle REST Data Services (ORDS) script to set up the database view definitions, and then import the workbook files to configure Oracle Analytics Cloud.

Oracle Database View Definitions for Stablecoin

You must set up the database view definitions before you can use the Oracle Analytics workbook in the stablecoin scenario.

  1. Enable and configure the rich history database.
    For more information, see Enable and Configure the Rich History Database in Using Oracle Blockchain Platform.
  2. Enable rich history on the channels that contain the chaincode data that you want to write to the rich history database. For more information, see Configure the Channels that Write Data to the Rich History Database in Using Oracle Blockchain Platform.
  3. Download and install Node.js version 18 or later.
  4. On the Digital Assets page in Oracle Blockchain Platform, select Stablecoin.
  5. Click Download the Database View Definitions package.
  6. Extract the downloaded archive file.
  7. Navigate to the ORDSscript folder and install the required dependencies by running the following command.
    npm install
  8. Edit the .env file that is supplied with the script to configure it for your environment.
    Oracle REST Data Services endpoints use the following general format.
    <base_URL>/<user_name>/<resource_link>
    Environment / Configuration Type Environment / Configuration Variables Description Example
    DB Connection CONNECTION_STRING The connection string for the database.
    CONNECTION_STRING="(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)
    (host=adg.ap-sydney-1.example.com))(connect_data=
    (service_name=g536390e55ee33f4_db_high.adg.example.com))(security=(ssl_server_dn_match=yes)))"
    View Configuration CHAINCODE_NAME The name of the chaincode to fetch transaction details from in the rich history database. CHAINCODE_NAME="Stablecoin"
    View Configuration INSTANCE_NAME The name of the instance where the chaincode is deployed. INSTANCE_NAME="Stablecoin"
    View Configuration CHANNEL_NAME The name of the channel where the chaincode is deployed. CHANNEL_NAME="default"
    ORDS Endpoint Setup MODULE_NAME The name of the ORDS module to use. This can be any value that does not conflict with existing assets in the database. MODULE_NAME="demotest"
    ORDS Endpoint Setup BASE_PATH The base path of the ORDS URL. This can be any value that does not conflict with existing assets in the database. BASE_PATH="demotest"
    ORDS Endpoint Setup PATTERN The pattern name of the ORDS URL. This can be any value that does not conflict with existing assets in the database. PATTERN="accountTransactionDetails"
    ORDS REST Endpoint ORDS_REST_BASE_URL The base URL of the ORDS REST endpoint of the database. ORDS_REST_BASE_URL="https://g536390e55ee33f4_db_high.adg.ap-sydney-1.example.com"
    Alias Configuration ALIAS_NAME The alias to use in place of a user name in the REST endpoint URL. This can be any value that does not conflict with existing assets in the database. ALIAS_NAME="demotestAlias"
    ORDS Role ROLE_NAME The ORDS role that is assigned to the user. This can be any value that does not conflict with existing assets in the database. ROLE_NAME="demotest_role"
    ORDS Privilege PRIVILEGE_NAME The ORDS privilege that is assigned to the user. This can be any value that does not conflict with existing assets in the database. PRIVILEGE_NAME="demotest_priv"
    ORDS Privilege LABEL A label for the ORDS privilege. This can be any value that does not conflict with existing assets in the database. LABEL="demotest_label"
    ORDS Privilege DESCRIPTION A description of the ORDS privilege. This can be any value that does not conflict with existing assets in the database. DESCRIPTION="demotest_description"
    OAuth Configuration CLIENT_NAME The client name to use for OAuth authentication with the ORDS REST endpoint. This can be any value that does not conflict with existing assets in the database. CLIENT_NAME="demotest_client"
    OAuth Configuration OWNER The owner name to use for OAuth authentication with the ORDS REST endpoint. This can be any value that does not conflict with existing assets in the database. OWNER="demotest"
    OAuth Configuration DESCRIPTION A description of the OAuth configuration. This can be any value that does not conflict with existing assets in the database. DESCRIPTION="demotest_description"
    OAuth Configuration SUPPORT_EMAIL The support email address for the OAuth configuration. This can be any value that does not conflict with existing assets in the database. SUPPORT_EMAIL="test@example.com"

    The following Oracle Analytics views are generated by the script: ACCOUNTS_MOD, TRANSACTION_MOD, and ACCOUNTS_TRANSACTION_MOD.

  9. Run the ORDS script by using the following command.
    npm run start
    When the command runs, the following prompts are displayed.
    Enter your DB User Name
    Enter the user name for the rich history database. The account must have the necessary permissions to create views and ORDS endpoints.
    Enter your DB Password
    Enter the password for the rich history database.
    Please select a chaincode type
    Select STABLECOIN. Use the arrow keys to navigate and then press the Enter key to confirm your selection.
    Do you want to create the View and ORDS Endpoint? (y/n)
    Enter y to create the view and endpoint. Enter n if you have already created the view and endpoint.
    Please select the language of your chaincode? (TS/GO)
    If you entered y previously, enter TS for TypeScript.
    Do you want to generate ORDS Endpoint URL and Bearer Token? (y/n)
    Enter y to generate the endpoint credentials. Otherwise, enter n.

Configure Oracle Analytics Cloud for Stablecoin

Complete the following steps to configure Oracle Analytics Cloud and use the analytics workbook for the stablecoin scenario.

  1. Create an instance of Oracle Autonomous Database.
  2. Set up the database view definitions. For information on how to set up the database view definitions for the stablecoin sample, see Oracle Database View Definitions for Stablecoin.
  3. Create an instance of Oracle Analytics Cloud in Oracle Cloud Infrastructure (OCI).
    1. Log on to the OCI console.
    2. Click Analytics & AI > Oracle Analytics Cloud.
    3. Select Create Instance and then add the required information.
    4. Select Create and then wait for the instance creation to complete.
    For more information about Oracle Analytics Cloud, see Oracle Analytics Cloud.
  4. Under Sample Stablecoin Analytics Workbook on the Digital Assets page in Oracle Blockchain Platform Digital Assets Edition, select Download sample Analytics package. The StablecoinAnalyticsPackage.zip file, which contains the sample application, is downloaded to your computer.
  5. Extract the StablecoinAnalyticsPackage.zip file, which contains the StablecoinAnalyticsPackage directory. The workbook (.dva) files are in the StablecoinAnalyticsPackage directory
  6. Back up both workbook files, System Owner Dashboard.dva and Participating Org Dashboard.dva.
  7. Navigate to Oracle Analytics Cloud in the OCI console, and then select Analytics Home Page.
  8. Select Import Workbook/Flow and import both workbook files. Select Include all permissions if exists. Enter OraAnalytic@2025 as the password. For more information, see Import a Workbook File.
  9. Update the data source connection details for the Analytics_Connection dataset.
    1. Go to the Data page in Oracle Analytics Cloud.
    2. Find the Analytics_Connection dataset and then select Inspect/Edit > Update database connection.
    3. Map the database views.
    4. Select Save.
    For more information about connecting Oracle Autonomous Transaction Processing to Oracle Analytics Cloud, see Connect to Oracle Autonomous Transaction Processing.
  10. Set up roles and permissions for the system owner and participant organization dashboards.
    1. In Oracle Analytics Cloud, select Console.
    2. Select Roles and Permissions, then select Application Roles.
    3. Select Create Application Role and create the SystemOwnerRole application role.
    4. Under Members, select Groups and then select Add Groups.
    5. Assign groups to the SystemOwnerRole and the BI Dataload Author roles. The BI Dataload Author role is required for embedding Oracle Analytics Cloud data into Oracle Visual Builder. The Oracle Identity Cloud Service (IDCS) groups that are associated with the sample application must be mapped to the BI Dataload Author role. If the SystemOwnerRole and the BI Dataload Author roles are not mapped, the analytics data will not be shown in the sample application, even if Oracle Analytics Cloud is integrated with Oracle Visual Builder. Map all relevant IDCS groups from the sample application to these roles. For example, map the following groups.
      • SYSTEM_ADMINS
      • SYSTEM_AUDITORS
      • SYSTEM_CREATORS
      • SYSTEM_MANAGERS
      • SYSTEM_ISSUERS
      • SYSTEM_RETIRERS
    6. Create roles for the participant organizations: ParticipantOrg1Role, ParticipantOrg2Role, and so on.
    7. Assign groups to the participant organization roles and to the BI Dataload Author role. You can create groups with any names, such as the following example groups. In the following example groups, change the number of the participant organization in the group name to match the corresponding organization role.
      • ORG1_ADMINS
      • ORG1_AUDITORS
      • ORG1_MANAGERS
      • ORG1_OFFICERS
    For more information, see Assign Application Roles to Groups.
  11. Update the instance name parameters for the system owner and participant organization dashboards.
    1. Log in as an adminstrator and open the system owner dashboard.
    2. Select Edit.
    3. Under Parameters, right-click to edit the parameter for the system owner instance name.
    4. Enter the system owner instance name or the membership service provider (MSP) ID. For example, enter CB.
    5. Repeat the previous steps to update the system owner instance name in the participant organization dashboard.
  12. Update the roles in the participant organization dashboard.
    1. Open the participant organization dashboard, and then select Edit Dashboard.
    2. Select the Data tab, and then select the System_Owner_Account_Trans_Mod-Participating_Org view.
    3. Select Join Diagram.
    4. Add roles and filters for each participant.
      1. Select the add button next to Role filters.
      2. Add a filter expression that includes a query. For example, add the following SQL query to the ParticipantOrg1Role role, which mentions Org1 and Org2 as participant organizations.
        FROM_ORG_ID = 'Org1' AND TO_ORG_ID = 'Org2'
        You must add roles and filter expressions sequentially, before proceeding to the next role.
      3. Repeat this process for the ParticipantOrg2Role, ParticipantOrg3Role roles, and so on.
  13. Move the dashboards to shared folders in Oracle Analytics Cloud.
    1. Navigate to Catalog > My Folders.
    2. Create a folder named Shared in the Shared Folders directory.
    3. Move the dashboards from the My Folders directory to the Shared folder inside the Shared Folders directory.
  14. Test thoroughly to ensure that all visualizations, data connections, user access, and other functions are working as expected.