I'm using the following loop to try and add the metadata for tokens generated in my own smart contract, it all works exactly as intended when I am generating up to 9 "bots" at a time, but as soon as it's 10 or more, it doesn't seem to fire at all? Any idea as to why this could be? I know for a fact that the events are being emitted as I can see that in the smart contract.
Also, is this the best way to do this? Will this work with a real Ethereum infura node? Thanks a bunch!
def log_loop(newBot_filter, poll_interval): while True: for event in newBot_filter.get_new_entries(): bot = event['args'] print(bot) dbh.add_bot(bot['_id'], ...) time.sleep(poll_interval) newBot_filter = contract.events.NewBot.createFilter(fromBlock='latest') Thread(target=log_loop, args=(newBot_filter, 2)).start()