how to run flask as daemon next to tendermint

173 Views Asked by At

I want to build a micro service that receives information with HTTP(flask) and puts it on the blockchain (Tendermint).

I have done some research and finally landed an bigchainDB.

It also makes use of flask and Tendermint and flask is run as a deamon/process.(https://github.com/bigchaindb/bigchaindb/blob/master/bigchaindb/start.py)

This is the first time I'm seeing such a setup and it confuses me a bit.

Tendermint(https://tendermint.com/) has a ABCI (application block chain interface) that run a server this makes it not possible to run flask at the same time.

I tried to run both flask and tendermint server at the same time. tendermint with the help of the package(https://pypi.org/project/abci/) but flask blocks the ABCI process or ABCI blocks the flask process.

One of the core functionality is that the HTTP clients has to have shared data with the ABCI service that will communicate with tendermint node.

The action of posting data to a certain end point should trigger an event in the ABCI that will edit the state and deliver it to the blockchain.

Does anybody have suggestions how to implement this or other resources that explain how to tackle this more in depth?

1

There are 1 best solutions below

0
On

Maybe wrapping both endpoints into a new common endpoint that performs actions on both. So a new server that makes it's own queries to each of the other two endpoints.