You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haha this is really old topic, but the message "There is no current event loop" means that the code is trying to use an event loop, but there is no event loop currently running or available.
You have to set the loop, as example like this:
def main():
event_filter = contract.events.PairCreated.createFilter(fromBlock='latest')
#block_filter = web3.eth.filter('latest')
# tx_filter = web3.eth.filter('pending')
loop = asyncio.new_event_loop()
#This will set the loop
asyncio.set_event_loop(loop)
try:
loop.run_until_complete(
asyncio.gather(
log_loop(event_filter,2 )))
# log_loop(block_filter, 2),
# log_loop(tx_filter, 2)))
finally:
# close loop to free up system resources
loop.close()
sniper.py:106: DeprecationWarning: There is no current event loop
sniper.py:109: DeprecationWarning: There is no current event loop
asyncio.gather(
Why is that?.
The text was updated successfully, but these errors were encountered: