Listening to incoming Full Blocks


To make it short : Is there a way to listen to new FULL blocks (like the one returned when making a Moralis.getBlock) with all the transactions and their receipts, as they are added to moralis ?

I noticed there was a few seconds gap between incoming new blocks when listening on a speedynode with websockets, and the same block being available using the Moralis client web3 API Native getBlock function. To solve that problem I created a queue and a polling mechanism that checks every X secconds if a block is available with Moralis.getBlock … but I find it quite dirty and forces me to make several useless queries …
I would like to subscribe to getBlock and receive a full node with full transaction objects and their receipts and logs. Is there a way to do what I want ?


I don’t know of a way to subscribe to books info now. You will also have to take in consideration that some blocks may change because of reorgs

Thanks for answering.
So do you suggest I keep polling every few secs to check if last block is available ?

you can also wait few seconds, I don’t know of a better way now to get that info

1 Like