Fantom-foundation / lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
MIT License
34 stars 5 forks source link

Embedded HTTP server for transaction requests handling #33

Closed rishflab closed 5 years ago

rishflab commented 5 years ago

We need a HTTP server than provides endpoints to submit transaction and query transaction information. I think this is somewhat urgent as we need this functionality to test the network.

The HTTP server should run in-process. I think we should use an async runtime library (tokio-rs, actix) for the HTTP server. We can use the same runtime for sending/receiving internode synchronisation messages.

EDIT: I noticed that we have a tcp listener thread in the TcpApp which I am guessing is for handling transaction requests for clients. For the time being it is probably best to implement the HTTP server in that thread or in another thread spawned the same way.

I think this chat example using Actix might be a good template: https://github.com/actix/actix/tree/master/examples/chat