I have the following code that polls for transactions every second. I want to make it more responsive, and not use polling, but instead something quicker.
tx_all_pending = w3.eth.filter('pending') while True: pending_txs = tx_all_pending.get_new_entries() ... time.sleep(1)
def new_tx(tx): ... tx_all_pending = w3.eth.filter('pending') tx_all_pending.watch(new_tx) # 'TransactionFilter' object has no attribute 'watch'
I've also tried:
async def main(): block = await w3.eth.coro_getBlock(100) # 'Eth' object has no attribute 'coro_getBlock' asyncio_loop = asyncio.get_event_loop() asyncio_loop.run_until_complete(main())
Thanks for any help.