使用 REST API 開發應用程式

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

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

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

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

建構應用程式

您的 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