Hi Gang,
TLDR: what’s the best and fastest way to watch new Blocks in Moralis?
A subscribe functions similar to afterSave
would be fire!
My use case: I am watching/syncing a contract that has quite a view events (opensea) - due to the volume there’s a huge delay (~6 hours) between the actual event and when it get inserted into the DB.
Also tested it briefly with the new beta servers (there was also a delay, smaller but still too much for my intended use). So I figured it would be best to watch each block - pick the transactions I need and bulk insert them. In theory this sound way more efficient. Downside of this approach is that I need another server to:
- Natively watch the block headers with web3.eth.subscribe
- call await Moralis.Web3API.native.getBlock(options); which gives me an empty object for the latest 1-2ish blocks.
Is there a better approach to get the latest block data asap?
Best,
Mario