I'm facing some issue/bug on web3.py, I need to listen my event contract, but event logs are always empty. I know the following issue on Ganach-CLI but may be there is other alternative. I already tried the three followings solutions and no one works, have [] as output...
The new method with web3.py v4 :
my_filter = mycontract.events.<event_name>.createFilter({'fromBlock':0,'to':'latest'}) my_filter.get_all_entries() The old method :
my_filter = mycontract.eventFilter('EventName',{'fromBlock':0,'toBlock':'latest'}) my_filter.get_all_entries() And finally tried to build my own filter :
event_hexa = w3.sha3(text='EventTest(address indexed _seller, string indexed)').hex() event_filter = w3.eth.filter({ 'fromBlock':0, 'toBlock':'latest', 'address': mycontract_address, 'topics':[str(event_hexa)] }) event_filter.get_all_entries() So I would like to know if there are other way to listen events ? May be I missed out on something.
Or may be there is other test net provider than Ganach where feature to listen event is working ?
Thanks for the help !