[Ethereum] Getting txpool with python web3 and infura

pending-transactionspythontransactionstxpoolweb3.py

I am trying to monitor pending transactions with python web3 and an infura node. I am currently using web3.eth.getBlock(block_identifier='pending', full_transactions=True) on a loop to fetch pending transactions, but it seems to be missing some transactions and completely ignores transactions with lower gas prices.

I have tried using w3.eth.filter('pending') but that just gives an error
ValueError: {'code': -32601, 'message': 'The method eth_newPendingTransactionFilter does not exist/is not available'}

Is there any way to access the full txpool on python with an infura node?

Best Answer

Infura doesn't support TxPool https://github.com/INFURA/infura/issues/55. You can accomplish this by running your own node.

Related Topic