[英]Is it possible for a java web app to interact with a blockchain built with HyperLedger Composer?
Or do you have to build the web application using a certain language to use composer? 还是必须使用某种语言来构建Web应用程序才能使用作曲家? I've been looking this up but I'm confused how a web app would use the blockchain.
我一直在寻找,但是我很困惑Web应用程序将如何使用区块链。
Yes, this is the purpose of the composer-rest-server which has a Swagger (OpenAPI) documented RESTful interface that allows one to interact with a Composer business network. 是的,这是composer-rest-server的目的,该服务器具有Swagger(OpenAPI)记录的RESTful接口,该接口允许与Composer商业网络进行交互。
This is documented in the "Generate REST API" section of the Developer Guide . 开发人员指南的“生成REST API”部分对此进行了说明。
After you create and composer deploy
your .bna (business network archive) you would use the composer-rest-server
command-line tool to generate and start a rest server that can interact with your business network. 在创建和
composer deploy
.bna(企业网络档案)之后,您将使用composer-rest-server
命令行工具生成并启动可以与您的企业网络进行交互的rest服务器。
Using this REST API, you can access the swagger definition source via http://localhost:3000/explorer/swagger.json . 使用此REST API,您可以通过http:// localhost:3000 / explorer / swagger.json访问swagger定义源。 From that, you can generate a Java client using a tool such as Swagger Codegen .
由此,您可以使用诸如Swagger Codegen之类的工具生成Java客户端。
Yes, you can do that exposing the business network as a REST API & invoking that from any web application. 是的,您可以这样做,将业务网络公开为REST API并从任何Web应用程序中调用。
See this: https://hyperledger.github.io/composer/integrating/getting-started-rest-api.html 看到这个: https : //hyperledger.github.io/composer/integrating/getting-started-rest-api.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.