capabilities.work

Discover the Available Ledger Range and Backfill Blocks

A 5-step recipe with Solana. We can help you get access.

Recipe · 5 steps

Discover the Available Ledger Range and Backfill Blocks

with Solana

Establish the retained ledger window and page confirmed slots from its floor.

  1. Find the lowest slot for which the node can still serve a confirmed block. This is the true floor for any backfill against this endpoint.
  2. Read the lowest slot the node still retains in its ledger. This can differ from the first available block, and the higher of the two is the safe starting point.
  3. List a bounded page of confirmed slots starting at the floor. Using a limit rather than an open-ended range is what keeps a backfill from requesting more than the node will return.
  4. List the confirmed slots between an explicit start and end slot. Skipped slots simply do not appear, which is how an indexer learns which slots produced no block.
  5. Fetch the block at the first paged slot with signatures only, the cheapest form that still proves the block is retrievable before a full backfill is launched against it.
What you'll need to have ready
  • pageLimit: How many confirmed slots to return when paging from the floor.
  • rangeSpan: How many slots past the floor to bound the explicit start/end slot listing with.
For your developer

Arazzo workflow solana:ledger-backfill-range, 5 operations: getFirstAvailableBlock → minimumLedgerSlot → getBlocksWithLimit → getBlocks → getBlock. Specs on APIs.io.