Client API Documentation


#1

I presume that clients talk to validator and observer nodes via an API. A few questions:

  • What is the nature of the interface? RESTful?
  • Is there documentation for this API somewhere?
  • Do clients connect to a specific validator/observer node?
  • If so, how do clients roll over to a working node if the one they have connected to goes down?

#2

Yes, there is an API.

It is not RESTful, because you have to talk to multiple nodes at the same time (when you are writing) to be sure that you don’t submit a transaction to a malicious node that ignores you or lies about the outcome. Instead, the API on the wire uses ZeroMQ. This is the same way that nodes talk to one another to achieve consensus. (The RAET protocol plays a similar role and is still in the code, but is not the active one right now.) However, most people who want to use the API won’t need to worry about on-the-wire details at all, because they will call libindy. This provides a C-callable interface that worries about all the details, making it even easier than RESTful. The C-callable functions have been wrapped for ease of use in java, .NET, python, and node.js.

The documentation is in the form of javadoc-style comments, very detailed and accurate and helpful, for each function here: https://github.com/hyperledger/indy-sdk/tree/master/libindy/src/api.

Clients connect to a pool as a whole (as defined by its genesis transactions), not a specific node. When observers are supported, connecting to a specific observer will also be supported.


#3

Thanks Daniel. This is very helpful. ZeroMQ is a great solution to this problem.