Deploy and Test Wholesale CBDC Chaincode

Deploying the Chaincode

You can deploy the chaincode directly from the Oracle Blockchain Platform console or by using Blockchain App Builder. Before you deploy the chaincode, create enrollment IDs for each token user and then map the token users to their respective enrollment IDs. Specify only one user for each enrollment. For more information about adding enrollments, see Add Enrollments to a REST Proxy in Using Oracle Blockchain Platform.

When you deploy the token chaincode, you must call the init method and pass the organization ID and user ID of the Token Admin user.

For information about deploying from the Oracle Blockchain Platform console, see Use Advanced Deployment in Using Oracle Blockchain Platform.

To deploy using Blockchain App Builder, complete the following steps.
  1. Extract the WholesaleCBDC.zip archive file.
  2. Import the WholesaleCBDC chaincode to the Blockchain App Builder extension in Visual Studio Code.
  3. Edit the .ochain.json file to update the value of the configFileLocation key to the path of the WholesaleCBDC.yml specification file.
  4. Open a terminal window and navigate to the chaincode folder, and then run the following command.
    npm install
For more information about deploying using Blockchain App Builder, see Deploy Your Chaincode Using Visual Studio Code in Using Oracle Blockchain Platform.

Sample Process Flow for the Wholesale CBDC Chaincode

A typical process flow using the wholesale CBDC methods follows these basic steps.
  1. Admins use the initializeCBDCToken method to initialize the wholesale CBDC system.
  2. Admins use the createAccount and associateTokenToAccount methods to create accounts and associate the token to accounts for all creators, central bank approvers, issuers, financial institution officers, financial institution approvers, and financial institution users in the system.
  3. Admins use the addRole method to assign the minter role to the creator and the notary role to the central bank approver.
  4. The token creator uses the requestMint method to submit a request to mint currency.
  5. The central bank approver uses the approveMint method to review and approve the request to mint currency. The currency is credited to the creator's account.
  6. The issuer uses the getAccountBalance method to verify that the credited amount is accurate.
  7. The creator uses the transferTokens method to send currency to the issuer. The currency is credited to the issuer's account.
  8. The holdTokens method is used to request transfer of tokens to the financial institution officer.
  9. The central bank approver uses the executeHoldTokens method to validate and approve the transfer request. The currency is transferred to the financial institution officer's account.
  10. The financial institution officer uses the getAccountBalance method to verify their account balance.
  11. The financial institution officer uses the holdTokens method to request transfer of tokens to the financial institution user.
  12. The financial institution approver uses the executeHoldTokens method to validate and approve the transfer request. The currency is transferred to the financial institution user's account.
  13. The financial institution user uses the getAccountBalance method to verify their account balance.
For more details about using Postman collections, see the following topics in Using Oracle Blockchain Platform.