poanetwork / hbbft

An implementation of the paper "Honey Badger of BFT Protocols" in Rust. This is a modular library of consensus.
Other
357 stars 96 forks source link

API for use from other languages? #429

Open KrishnaPG opened 5 years ago

KrishnaPG commented 5 years ago

Wondering how to make this work with other languages. Is there an API to consume this library from other languages, such as JS? Something like REST/HTTP or Websocket messaging / gRPC?

afck commented 5 years ago

There's no API for it, but it should be straightforward to write one. Since hbbft only implements the abstract protocol and is meant to be used as a library, the best way to do it might be via FFI: You could write (in Rust) a wrapper that exposes a C-compatible API, which can then be used with any language's FFI features. But writing a small Rust application around it that communicates via REST or gRPC with other components could work, too.