How would you go about pulling live mempool data like https://tzflow.com/? I have a private node and I've looked at the /chains/main/mempool/pending_operations
endpoint, but I'm not sure how to stream pending transactions.
2 Answers
tzflow.com uses the /chains/main/mempool/monitor_operations
RPC to get a stream of operations submitted to the mempool of one representative node.
As mentioned elsewhere here, the node closes this stream on each new block.
/chains/main/mempool/monitor_operations
streams pending transactions, but the connection is closed when the node gets a new head block. You can do this in a loop to keep streaming.
(Edited to replace pending
with monitor
in the RPC :-))
-
In the body of the response, I don't see anything marked as pending. It shows applied, refused, outdated, etc.– bhaasNov 14, 2022 at 22:56