0

I have looked a lot into RPC and WSS methods at the solana documentation but apart from the still under development blockSubscribe method (which doesn't work for most solana RPCs out there) I have found no way to get the latest transactions being done each block. Any clues on how to do this or services that provide an RPC that has blockSubscribe working?

2 Answers 2

2

The blockSubscribe endpoint was designed for exactly this case, so your best might be to setup your own node with this flag enabled. Your only other option will be to partner with a validator or RPC provider and get them to run a Geyser plugin, which can stream all transaction information directly to your server.

More info about Geyser at https://docs.solanalabs.com/validator/geyser

1

There is a few options for you depending on your exact problem:

  • onRootChange : This gets called whenever a root* is created and is most likely what you'll want.
  • onSlotUpdate : If you want to be super granular, this callback doesn't get just triggered when a new block is rooted, but instead gets called during the individual steps of block production, telling you when the first shred is received, when the block is processed, confirmed, rooted, etc etc. You can view the exact steps it returns here.

*Quick reminder on what root means in this context from the docs:

A block or slot that has reached maximum lockout on a validator. The root is the highest block that is an ancestor of all active forks on a validator. All ancestor blocks of a root are also transitively a root. Blocks that are not an ancestor and not a descendant of the root are excluded from consideration for consensus and can be discarded.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.