Add a simple websocket thread to existing program

Job ID: 35971817

Budget: $250 – $750 USD

Ref:
https://github.com/tendermint/tendermint/blob/cceea4de2221b0f2b490247fa5619edf6b1048ee/mempool/v1/mempool.go

Row 233:
txmp.addNewTransaction(wtx, rsp)

There is an object of interest here, tx types.Tx, that I would like to serialize to a json and broadcast out to connected clients on a WebSocket server whenever it reaches the addNewTransaction point.

The task is as follows:
1. Write in GO a Websocket server that operates in its own thread. (GoRoutine ?)
2. The server will use some sort of job queue and read when there is a new transaction object added to the queue. It is critical that this hook into Tendermint does not introduce blocking behaviour. The existing processes must run un-interrupted. If you know Python, I imagine it as a queue.Queue() type object, where you put() in the mempool.go module, and get() in the websocket module/seperate goroutine. With your Go expertise it may be something different.
3. The transaction object will be serialized to a json and broadcasted to all connected clients on the websocket server. There may be more than 1 connected peer, and expect unstable connections. So connect/disconnect errors have to be well handled. Expected json packages broadcasted per second could vary from 0 to 30
Related categories: Golang Blockchain