使用 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