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