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
Returns

A reorg mon instance.

Either GraphQLReorganisationMonitor or JSONRPCReorganisationMonitor

Return type

eth_defi.event_reader.reorganisation_monitor.ReorganisationMonitor