Never miss a beat: LaserStream’s Historical Replay ensures you can recover from disconnections and backfill missing data from the last 20 minutes of blockchain activity.

What is Historical Replay?

Historical Replay is LaserStream’s feature that lets you replay recent blockchain data from up to 3000 slots in the past (approximately 20 minutes of blockchain activity). This is particularly useful for handling disconnections and ensuring data continuity in real-time applications.

Limited Time Window: Historical replay is currently limited to the last 3000 slots (approximately 20 minutes of blockchain activity). You cannot replay data from arbitrary points in the past.

Handle Disconnections

Recover data lost during brief disconnections (up to 20 minutes)

Bootstrap Applications

Start applications with recent context from the last 20 minutes

Analyze Recent Events

Review recent transactions and account changes

Test with Recent Data

Use real recent data for testing and development

How It Works

1

Specify Starting Point

Use the fromSlot parameter to set your replay starting point (must be within last 3000 slots)

2

Stream Historical Data

LaserStream delivers all events from your specified slot forward

3

Catch Up to Real-Time

Historical data streams until you reach the current slot

4

Continue Live Streaming

Seamlessly transition to real-time data streaming

Automatic Reconnection: The LaserStream SDK handles reconnections and replay automatically. No additional code required!

Quick Start

import { subscribe, CommitmentLevel, LaserstreamConfig, SubscribeRequest } from 'helius-laserstream';

const subscriptionRequest: SubscribeRequest = {
  transactions: {
    client: {
      accountInclude: ['TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'],
      vote: false,
      failed: false
    }
  },
  commitment: CommitmentLevel.CONFIRMED,
  accounts: {},
  slots: {},
  blocks: {},
  blocksMeta: {},
  entry: {},
  accountsDataSlice: [],
  fromSlot: '224339000' // Start replay from this slot (must be within last 3000 slots)
};

const config: LaserstreamConfig = {
  apiKey: 'YOUR_API_KEY',
  endpoint: 'https://laserstream-mainnet-ewr.helius-rpc.com', // Choose your closest region
};

await subscribe(config, subscriptionRequest, 
  async (data) => {
    console.log('Received data:', data);
  }, 
  async (error) => {
    console.error('Error:', error);
  }
);

Configuration Options

fromSlot
string
required

The slot number to start replaying from. Must be within the replay window (last 3000 slots from current slot).

Example: "224339000"

Important: The slot must be recent enough to fall within the 20-minute replay window.

Use Cases

Next Steps