Reputation: 49
Is it possible to connect to Hyperledger Fabric network directly from Frontend React application? Ethereum uses web3.js library for that, it uses JSON-RPC communication protocol. Hyperledger Fabric uses gRPC for communication between peers, nodes, orderes etc. It uses HTTP/2 as transfer protocol. Understanding that, is it somehow possible to create Wallet of user in React client application using fabric-network, then connect to HLF network through API which have Gateway and accepts user wallet?
Using fabric-network Wallets inside client app gives error of gRPC. If the wallet is created on server side (API and Node.js with HLF SDK) the server have to much information about user.
Upvotes: 0
Views: 556
Reputation: 1649
I would recommend using the Fabric Gateway client API with Fabric v2.4 or later. It has a much smaller footprint than the legacy Node SDK and does not require the use of wallets to store client identity information, so is more likely to be usable for you.
The biggest issue for using the client API at the front end is likely to be that it is developed for Node.js as the runtime environment, so may rely on some Node.js-specific APIs or behaviour. If this does turn out to be an obstacle and you do need to interact with Fabric at the server side, the API specifically supports a usage pattern that it calls "off-line signing", where your server side application does not hold the signing credentials but instead sends messages back to your front end application for signing before submitting them to Fabric. The API documentation has more information and examples.
Upvotes: 0