Open arobsn opened 1 year ago
Would be a very good addition for sure.
IMO would be worth considering websockets when selecting a solution so browser based dapps/wallet extensions/etc are supported (ZeroMQ
seems to support WS as a transport).
Maybe even graphql pub/sub which could lead to a gql alternative to the rest api
Writing this comment here for those who weren't in the chat a few weeks ago. I opined that adding things like this to the node could lead to it becoming bloated over time and that it would be one more thing for node operators and developers to think about. As part of a past ErgoHack, I made a library for connecting to nodes (through TCP), which is available for every node that has the port forwarded/accessible/reachable and does not need any modifications to the code whatsoever.
The library is here: https://github.com/Satergo/Ergonnection, and it can be used directly without needing ZeroMQ or anything (and it will be as fast as it gets in terms of latency), but if you for some reason need ZeroMQ, you can use the tool that Luivatra built using the library: https://github.com/cruxfinance/ergo-node-zmqpub
Having realtime notifications can improve the overall developer/mining experience and avoid unnecessary endpoing pooling.
Bitcoin uses ZeroMQ to broadcast node events to listeners.
I propose we start discussing Ergo's implementation from the following structure:
block
:added
- On new block.removed
- On block rollback.candidate
- On new candidate.transaction
:added
- When a transaction is accepted by the mempool and/or included in a block.removed
- When a transaction is removed from the mempool.References