I'm going to run a contract in Ethereum, Binance, Polygon, and Clayton.
Is there a best practice for polling events that occur in a contract?
I want to get the event by requesting, not by subscribing to it.
If we use EtherScan api, are all sequences decisively guaranteed?
The goal is to send requests periodically and store all the specific events that occurred in the contract in db.
I'd appreciate your help.
When you query the raw blockchain data, each event log contains
logIndex
, which is the position of the event within the block.Example with web3js:
returns
Authors of 3rd party APIs (e.g. Etherscan) can chose to order their results according to the
logIndex
but they can also chose different ordering.