Customize Wrapper APIs for Bond Marketplace

The bond marketplace 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 bond marketplace chaincode. To ensure that your changes are compatible, you must modify the newly generated wrapper API package by using the bond marketplace wrapper API package that is bundled with the product.
  1. Use Blockchain App Builder to generate a wrapper API package for the bond marketplace chaincode.
  2. Extract the files from the package.
  3. Copy the following folders from the wrapper API package that is bundled with the product into the directory structure of the newly generated wrapper API package.
    • createIDCSUser
    • createAccountWithEnrollment
    • purchaseBondToken or purchaseToken
    • `approveBondRedemption or `approveedemption
    • payInterest
  4. Add the following variables to the terraform.vars file.
    idcs_url="<idcs_url>"
     idcs_port="<idcs_port>"
     cbdc_chaincode="<cbdc_chaincode>"
     cbdc_channel="<cbdc_channel>"
     prepare_timeout=<prepare_timeout>
     isolation_level="<isolation_level>"
  5. Add an entry at the end of the terraform.vars file for the createIDCSUser and createAccountWithEnrollment methods, as shown in the following example JSON string.
    \"createIDCSUser\":{\"path\":\"/createIDCSUser\",\"type\":[\"POST\"]},
         \"createAccountWithEnrollment\":{\"path\":\"/createAccountWithEnrollment\",\"type\":[\"POST\"]}
    The following text shows the general format of the JSON string in the function_path variable in the terraform.vars file.
    {"<methodName>":{"path":"/<methodFolderName>","type":["<HTTP Method POST or GET>"]}}
  6. Verify and update the names for the modified methods purchaseBondToken, approveBondRedemption, payInterest to ensure that they are named correctly in the function_path variable in the terraform.vars file.
  7. Replace the main.tf file in the newly generated wrapper API package with the main.tf file from the wrapper API package that is bundled with the product.