Zebra Open API

by Alfredo

It was really fun for me to participate in the last Zebra Hackathon Sprint, a 2-week period to be creative, explore new ideas and build some proof of concept projects. This time I worked on an OpenAPI specification for Zebra RPC methods.

Zebra OpenAPI Specification

In order to provide a documentation resource for Zebra RPC methods, an openapi.yaml specification was added to Zebra, located at the root of the project. This file can be pasted into Swagger Editor to automatically render documentation for Zebra’s RPC methods.

 

Zebra API in Swagger
Zebra API in Swagger
 

If you have a zebrad node running at http://localhost:8232 you will be able to send commands to the blockchain and retrieve data. Otherwise, you can still view the documentation for the methods in the Swagger interface. More information can be found at the Zebra OpenAPI book page. The OpenAPI proof of concept pull request is available here.

If there is interest, this documentation could be hosted somewhere similar to https://zcash.github.io/rpc/, and be kept up to date with changes and additions to Zebra’s RPC interface. In the meantime, please try it out and let us know what you think!