Blog: New JSON RPC Libra Client-API

We’ve made two changes to the Libra client API. The API will now be based on JSON-RPC, and proof verification has been removed to a separate API. Read this blog to learn why these changes were made and the advantages of this new approach. https://libra.org/en-US/blog/new-json-rpc/

If you have comments on the blog, we invite you to reply to this topic.

2 Likes

I am wondering if rust had support for grpc-gateway (https://github.com/grpc-ecosystem/grpc-gateway) would this have changed your decision?

Using the grpc made sense with the earlier assumption that Libra could use the grpc serialization and sign transactions serialized with it. But when it turned out it actually cannot be used for this and Libra Canonical Serialization was developed, it was nigthmare to use the api: putting some information in structures generated from grpc protos and serializing some things with the LCS + similar work with de-serialization.

I think this new json-rpc api is also more developer friendly as you can create the api requests with tools like curl and postman. The integration is also more transparent when there isn’t the grpc library in between doing it’s magic and you can choose what ever http client available for your platform.

The only downside is the LCS serialization which needs to be implemented by the library doing the integration (at least if creating transactions is a requirement, all the queries can be done without it).

1 Like

Where is the document of the new json-rpc client API?

It’s here https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md but looks like it has not been updated with latest changes (the Account response does not have the support for multiple currencies).

Also the libra command line client uses this api, so you’ll be able to find examples there.
The address of the api is http://client.testnet.libra.org/

1 Like

Thanks for all the great comments. The missing link in the blog has been restored, and you will find the API docs here: https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md

Where is the new separate API doc for proof verification?

The updated API docs are here: https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md