I am trying to figure out the most efficient way to poll latest blocks.

I found that there is a newBlockHeaders event that I can subscribe to using .

What is not clear to me is how to track the number of confirmations?

The premise of the question is that I want to find an efficient way to get events for a large number of transactions. My thinking is that I need to:

  1. Observe and filter pendingTransactions
  2. Observe newBlockHeaders
  3. Use getBlock to identify all transactions in the block
  4. Once I find pendingTransactions mentioned in getBlock, use getTransactionReceipt to find transaction logs.

The question is thus: Is newBlockHeaders sufficient for my use case or is it possible that transactions included in block might not have receipt / might not go through?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.