Customize Wrapper APIs for Confidential Wholesale CBDC
The confidential wholesale CBDC wrapper API is a modified version of the wrapper API package that is generated by Blockchain App Builder.
Complete the following steps if you regenerate the wrapper API package after adding custom methods to the confidential wholesale CBDC chaincode. To ensure that your changes are compatible, you must modify the newly generated wrapper API package by using the confidential wholesale CBDC wrapper API package that is bundled with the product.
- Use Blockchain App Builder to generate a wrapper API package for the confidential wholesale CBDC chaincode.
- Extract the files from the package.
- Back up the
routes.go
file, and then replace the OCI function folder in the new wrapper API package with theWholesaleCBDCWithConfidentialPaymentOCIFunction
folder from the bundledWholesaleCBDCWithConfidentialPayment
wrapper API package. Restore the backup version of theroutes.go
file. - Edit the
function_path
JSON variable at the end of theterraform.vars
file to add entries for any new methods. Thefunction_path
variable defines API endpoints as an array of objects in the following format.
Add entries for the new methodsfunction_paths="[{\"endpoint\":\"/addAdmin\",\"methodType\":[\"POST\"]}]"
createIDCSUser
andcreateAccountWithEnrollment
as shown in the following example.function_paths="[{\"endpoint\":\"/addAdmin\",\"methodType\":[\"POST\"]},{\"endpoint\":\"/createIDCSUser\",\"methodType\":[\"POST\"]},{\"endpoint\":\"/createAccountWithEnrollment\",\"methodType\":[\"POST\"]}]"
- Replace the
main.tf
file in the newly generated wrapper API package with themain.tf
file from the wrapper API package that is bundled with the product.