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