使用 REST API 開發應用系統

Oracle Blockchain Platform 提供的 REST API 已建立,但具備最大的彈性;您可以呼叫交易、呼叫查詢或檢視交易狀態。不過,這表示您可能會想要包裝應用程式中的現有 API 端點,以提供物件層級的控制。應用程式可以包含更多微點作業。

任何使用 REST API 的應用程式都需要下列項目:

  • 鏈碼名稱與版本。
  • REST 伺服器 URL 與連接埠,以及 REST 節點的使用者 ID 與密碼。
  • 針對交易呼叫或查詢分類帳的功能。

請參閱 Oracle Blockchain Platform 的 REST API ,瞭解現有作業 (包括範例和使用語法) 的相關資訊。

建構應用程式

您的 REST API 應用程式結構應與下列類似:

/Application
  /artifacts
    /crypto
      /orderer
        Contains the certificates required for the application to act on the orderer node
        In participant instances only contains TLS certificates
      /peer
        Contains the certificates required for the application to act on the peer node
    /src
  /REST
    Application script containing REST API calls