自訂 Stablecoin 的包裝函式 API
stablecoin 包裝程式 API 是由 Blockchain App Builder 產生的包裝程式 API 套裝程式修改版本。
將自訂方法新增至穩定的鏈碼後,如果您重新產生包裝函式 API 套件,請完成下列步驟。為了確保您的變更相容,您必須使用與產品組合的穩定幣包裝程式 API 套件來修改新產生的包裝程式 API 套件。
- 使用區塊鏈 App 產生器產生穩定幣鏈碼的包裝函式 API 套裝程式。
- 從套件擷取檔案。
- 備份
routes.go檔案,然後以組合Stablecoin包裝程式 API 套件中的StablecoinOCIFunction資料夾取代新包裝程式 API 套件中的 OCI 函數資料夾。回復routes.go檔案的備份版本。 - 編輯
terraform.vars檔案結尾的function_pathJSON 變數,以新增任何新方法的項目。function_path變數會將 API 端點定義為下列格式的物件陣列。
在function_paths="[{\"endpoint\":\"/activateStablecoinAccount\",\"methodType\":[\"POST\"]}]"function_path變數的結尾附加新方法createIDCSUser和createStablecoinAccount的項目,如下列範例所示。function_paths="[{\"endpoint\":\"/activateStablecoinAccount\",\"methodType\":[\"POST\"]},{\"endpoint\":\"/createStablecoinAccount\",\"methodType\":[\"POST\"]}, {\"endpoint\":\"/createIDCSUser\",\"methodType\":[\"POST\"]}]" - 將新產生之包裝函式 API 套件中的
main.tf檔案取代為產品隨附之包裝函式 API 套件中的main.tf檔案。