自訂 Stablecoin 的包裝函式 API

stablecoin 包裝程式 API 是由 Blockchain App Builder 產生的包裝程式 API 套裝程式修改版本。

將自訂方法新增至穩定的鏈碼後,如果您重新產生包裝函式 API 套件,請完成下列步驟。為了確保您的變更相容,您必須使用與產品組合的穩定幣包裝程式 API 套件來修改新產生的包裝程式 API 套件。

  1. 使用區塊鏈 App 產生器產生穩定幣鏈碼的包裝函式 API 套裝程式。
  2. 從套件擷取檔案。
  3. 備份 routes.go 檔案,然後以組合 Stablecoin 包裝程式 API 套件中的 StablecoinOCIFunction 資料夾取代新包裝程式 API 套件中的 OCI 函數資料夾。回復 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 檔案。