bwt
bwt copied to clipboard
Protobuf + gRPC
Just asking here to see if there is some sort of conceptual ACK for starting working on this https://github.com/romanz/electrs/issues/227
It Would be nice if both implementations could expose a gRPC endpoint and the API could be defined by a typed schema.
Why?
- gRPC gives HTTP/2 for free
- http2 means binary encoding, more efficient than utf8 JSON strings
- Protobuf is a perfect match, could give backward and forward compatibility when making changes to the APIs
- Server-side streaming
- Automatically generate stubs and clients from the single .proto model spec
A gRPC/protobuf interface is something that I'd be willing to accept. It should be put behind a compile-time flag, like the current http
/electrum
/webhooks
flags.
Note that bwt already supports HTTP/2 (via warp/hyper) and already does server-side streaming using Server-Sent Events. The main advantages for me would be protobut instead of json and a more well-defined explicit interface.
I probably won't be prioritizing this myself in the near future, but will gladly review a PR.