Deploy and Test Confidential Wholesale CBDC Chaincode
You can deploy the chaincode directly from the Oracle Blockchain Platform console or by using Blockchain App Builder.
Deploying the Chaincode
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.
- Extract the WholesaleCBDC-Confidential.ziparchive file.
- Import the WholesaleCBDC-Confidentialchaincode to the Blockchain App Builder extension in Visual Studio Code.
- Edit the .ochain.jsonfile to update the value of theconfigFileLocationkey to the path of theWholesaleCBDC-Confidential.ymlspecification file.
- Open a terminal window and navigate to the chaincode folder, and then run the following command.npm install
Sample Process Flow for the Wholesale CBDC Chaincode
A typical process flow using the confidential wholesale CBDC methods follows these basic steps.- Admins use the initializeCBDCTokenmethod to initialize the wholesale CBDC system.
- Admins use the createAccountandassociateTokenToAccountmethods 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.
- Admins use the addRolemethod to assign the minter role to the creator and the notary role to the central bank approver.
- The token creator uses the requestMintmethod to submit a request to mint currency.
- The central bank approver uses the approveMintmethod to review and approve the request to mint currency. The currency is credited to the creator's account.
- The issuer uses the getAccountBalancemethod to verify that the credited amount is accurate.
- The creator uses the transferTokensmethod to send currency to the issuer. The currency is credited to the issuer's account.
- The holdTokensmethod is used to request transfer of tokens to the financial institution officer.
- The central bank approver uses the executeHoldTokensSenderandexecuteHoldTokensReceivermethods to validate and approve the transfer request. These two methods must be called at the same time by using the two-phase commit API. The currency is transferred to the financial institution officer's account.
- The financial institution officer uses the getAccountBalancemethod to verify their account balance.
- The financial institution officer uses the holdTokensmethod to request transfer of tokens to the financial institution user.
- The financial institution approver uses the executeHoldTokensmethod to validate and approve the transfer request. The currency is transferred to the financial institution user's account.
- The financial institution user uses the getAccountBalancemethod to verify their account balance.