I'm currently writing some program to monitor the mempool of a bsc node. As my BSC node is a charged by request count, I'm trying to explore the best way to save the time and cost.
Here's some plan I found:
Use service of mempool explorer. https://www.blocknative.com/. This is obviously not the best plan since I've already paid 99 dollar on quicknode service already and I found some transactions is still not among the list it provided.
User web3py pending filter:
new_transaction_filter = w3.eth.filter('pending') new_transaction_filter.get_new_entries()
andw3.eth.get_transaction(entry)
for each entry. This is also not effcient because it's quite time wasting and cost lots of web3 requests.Using
pending_block = w3.eth.get_block(block_identifier='pending', full_transactions=True)
The call only returns transactions with mined block number and obviously not the 'pending' ones.Use
w3.geth.txpool.content()
. This can print out all the pending transactions in one shot but when you keep calling it, duplicated record will appears.
Can anyone give me a hint which is the correct way to fetch the mempool?