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