create_reorganisation_monitor
Documentation for eth_defi.event_reader.reorganisation_monitor.create_reorganisation_monitor function.
- create_reorganisation_monitor(web3, check_depth=250)[source]
Set up a chain reorganisation monitor tactic based on the node supported APIs
Chain reorganisation monitor detects if any of blocks at the chain tip have changed since the last read or during the read
create_reorgation_monitor()
sets up a fast /graphql API endpoint based block scanner when the endpoint is offered by the node. This is 10x - 50x faster than JSON-RPC.If /graphql endpoint is not available, then we fall back to JSON-RPC based slow reorganisation monitoring
- Parameters
check_depth –
How many blocks in the past we check on the reorganisation scan to detect any changes.
If the reorganisation happens further past then the off-chain accounting will be broken.
The maximum Polygon reorganisation depth has been 157 blocks.
web3 (web3.main.Web3) –
- Returns
A reorg mon instance.
Either
GraphQLReorganisationMonitor
orJSONRPCReorganisationMonitor
- Return type
eth_defi.event_reader.reorganisation_monitor.ReorganisationMonitor