For example, I have an event
where using clusterAddress
as key, I want to find the other arguments (storageID
, desc
, etc.), only having the clusterAddress
indexed.
I added the indexed
keyword for the clusterAddress
argument.
event LogJob(address indexed clusterAddress,
string jobKey,
uint index,
uint8 storageID,
string desc
);
Later, should the following approach work under Web3.py
(following this answer) or should I do something else to capture the indexed
argument variable using Web3.py
?
def print_message(received_message): #{
print(received_message)
received_messages.append(received_message)
#}
blockReadFrom = 1899690;
myFilter = eBlocBroker.events.LogJob.createFilter(
fromBlock=blockReadFrom,
argument_filters={'clusterAddress': '0x4e4a0750350796164D8DefC442a712B7557BF282'}
)
print(myFilter.get_all_entries())
received_messages = []
myFilter.watch(print_message) # Error occurs: AttributeError: 'LogFilter' object has no attribute 'watch'
Overall, I want to filter all the events using web3.py
by passing the indexed argument. When I try to watch
the LogFilter
(like Watch callback return value Web3.js
); I have receive following error: AttributeError: 'LogFilter' object has no attribute 'watch'
=> How to get all the events with the passed argument? After that if possible how could I watch
the upcoming new emitted events?
watch
the filter I have created. @HarshVakharia