简体   繁体   中英

Hyperledger — how to set up REST API for invoking Chaincode

I'm playing around with Hyperledger and am trying to figure to figure how to set up the server with REST api for chaincode defined here https://openblockchain.readthedocs.io/en/latest/API/CoreAPI/#rest-api

Unfortunately many of the links are dead, so I'm not sure how to set it up. I understand the query language, I just don't knopw how to begin the web server.

Does anyone have any ideas?

Hyperledger Fabric v1.0 and later does not provide a native REST API for interacting with peer and/or orderer nodes. If you have not done so, I'd advise taking a look at http://hyperledger-fabric.readthedocs.io/en/release-1.1/ to better understand the current Fabric architecture.

There is a project to provide a REST API server in front of Fabric nodes. It was not updated to support Fabric v1.1 (at least not yet) but does support Fabric v1.0 and should provide at least an example of how to add a REST API in front.

I'd also advice taking a look at the samples which are documented here as well. The fabcar sample provides a nice, simple example of how to connect a Node.js application to Fabric.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM