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.
- Extract the
WholesaleCBDC.zip
archive file. - Import the
WholesaleCBDC
chaincode to the Blockchain App Builder extension in Visual Studio Code. - Edit the
.ochain.json
file to update the value of theconfigFileLocation
key to the path of theWholesaleCBDC.yml
specification 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 wholesale CBDC methods follows these basic steps.- Admins use the
initializeCBDCToken
method to initialize the wholesale CBDC system. - Admins use the
createAccount
andassociateTokenToAccount
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. - Admins use the
addRole
method to assign the minter role to the creator and the notary role to the central bank approver. - The token creator uses the
requestMint
method to submit a request to mint currency. - 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. - The issuer uses the
getAccountBalance
method to verify that the credited amount is accurate. - The creator uses the
transferTokens
method to send currency to the issuer. The currency is credited to the issuer's account. - The
holdTokens
method is used to request transfer of tokens to the financial institution officer. - 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. - The financial institution officer uses the
getAccountBalance
method to verify their account balance. - The financial institution officer uses the
holdTokens
method to request transfer of tokens to the financial institution user. - 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. - The financial institution user uses the
getAccountBalance
method to verify their account balance.