自定义 Stablecoin 的包装 API

稳定币包装 API 是由 Blockchain App Builder 生成的包装 API 软件包的修改版本。

如果您在将自定义方法添加到稳定币链代码后重新生成包装 API 包,请完成以下步骤。为了确保您的更改是兼容的,您必须使用与产品捆绑的稳定币包装 API 包来修改新生成的包装 API 包。

  1. 使用 Blockchain App Builder 为 stablecoin 链码生成包装 API 包。
  2. 从程序包中提取文件。
  3. 备份 routes.go 文件,然后将新包装 API 程序包中的 OCI 函数文件夹替换为捆绑 Stablecoin 包装 API 程序包中的 StablecoinOCIFunction 文件夹。恢复 routes.go 文件的备份版本。
  4. 编辑 terraform.vars 文件末尾的 function_path JSON 变量以添加任何新方法的条目。function_path 变量以以下格式将 API 端点定义为对象数组。
    function_paths="[{\"endpoint\":\"/activateStablecoinAccount\",\"methodType\":[\"POST\"]}]"
    function_path 变量的末尾附加新方法 createIDCSUsercreateStablecoinAccount 的条目,如以下示例所示。
    function_paths="[{\"endpoint\":\"/activateStablecoinAccount\",\"methodType\":[\"POST\"]},{\"endpoint\":\"/createStablecoinAccount\",\"methodType\":[\"POST\"]}, {\"endpoint\":\"/createIDCSUser\",\"methodType\":[\"POST\"]}]"
  5. 将新生成的包装 API 软件包中的 main.tf 文件替换为包装 API 软件包中与产品捆绑的 main.tf 文件。