extract_events
Documentation for eth_defi.event_reader.reader.extract_events function.
- extract_events(web3, start_block, end_block, filter, context=None, extract_timestamps=<function extract_timestamps_json_rpc>, reorg_mon=None)[source]
Perform eth_getLogs call over a block range.
You should use
read_events()
unless you know the block range is something your node can handle.- Parameters
start_block (int) – First block to process (inclusive)
end_block (int) – Last block to process (inclusive)
filter (eth_defi.event_reader.filter.Filter) – Internal filter used to match logs
extract_timestamps (Optional[Callable]) –
Method to get the block timestamps.
This might need to use expensive`eth_getBlockByNumber` JSON-RPC API call. It will seriously slow down event reading. Set extract_timestamps to None to not get timestamps, but fast event lookups.
context (Optional[eth_defi.event_reader.logresult.LogContext]) – Passed to the all generated logs
reorg_mon (Optional[eth_defi.event_reader.reorganisation_monitor.ReorganisationMonitor]) – If passed, use this instance to monitor and raise chain reorganisation exceptions.
web3 (web3.main.Web3) –
- Returns
Iterable for the raw event data
- Return type