Overview

LaserStream’s gRPC offering builds on a Yellowstone-based interface and enhances it with features like historical replay, multi-node failover, and a fully managed environment. LaserStream uses the open source gRPC protocol, ensuring no vendor lock-in and maximum compatibility with existing gRPC implementations.

You can connect either directly with @yellowstone-grpc or use the higher-level Helius LaserStream SDK for added benefits (auto-reconnect, subscription management, error handling, etc.).

Performance Notice: If you experience any lag or performance issues with your LaserStream connection, please refer to the Troubleshooting section for common causes and solutions related to client performance and network optimization.

Endpoints & Regions

LaserStream is available in multiple regions worldwide. Choose the endpoint closest to your application for optimal performance:

Mainnet Endpoints

RegionLocationEndpoint
ewrNew York, US (East Coast)https://laserstream-mainnet-ewr.helius-rpc.com
pittPittsburgh, US (Central)https://laserstream-mainnet-pitt.helius-rpc.com
slcSalt Lake City, US (West Coast)https://laserstream-mainnet-slc.helius-rpc.com
amsAmsterdam, Europehttps://laserstream-mainnet-ams.helius-rpc.com
fraFrankfurt, Europehttps://laserstream-mainnet-fra.helius-rpc.com
tyoTokyo, Asiahttps://laserstream-mainnet-tyo.helius-rpc.com
sgpSingapore, Asiahttps://laserstream-mainnet-sgp.helius-rpc.com

Devnet Endpoint

NetworkLocationEndpoint
DevnetNew York, US (East Coast)https://laserstream-devnet-ewr.helius-rpc.com

Network & Region Selection:

  • For production applications, choose the mainnet endpoint closest to your server for best performance. For example, if deploying in Europe, use either the Amsterdam (ams) or Frankfurt (fra) endpoint.
  • For development and testing, use the devnet endpoint: https://laserstream-devnet-ewr.helius-rpc.com.

Quickstart

1

Create a New Project

mkdir laserstream-grpc-demo
cd laserstream-grpc-demo
npm init -y
2

Install Dependencies

npm install helius-laserstream
npm install --save-dev typescript ts-node
npx tsc --init
3

Obtain Your API Key

Generate a key from the Helius Dashboard. This key will serve as your authentication token for LaserStream.

Professional Plan Required: LaserStream requires a Professional plan. Ensure your Helius account is upgraded to access LaserStream features.

4

Create a Subscription Script

Create index.ts with the following:

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

async function main() {
  const subscriptionRequest: SubscribeRequest = {
    transactions: {
      client: {
        accountInclude: ['TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'],
        accountExclude: [],
        accountRequired: [],
        vote: false,
        failed: false
      }
    },
    commitment: CommitmentLevel.CONFIRMED,
    accounts: {},
    slots: {},
    transactionsStatus: {},
    blocks: {},
    blocksMeta: {},
    entry: {},
    accountsDataSlice: [],
    // Optionally, you can replay missed data by specifying a fromSlot:
    // fromSlot: '224339000'
    // Note: Currently, you can only replay data from up to 3000 slots in the past.
  };

// Replace the values below with your actual LaserStream API key and endpoint
const config: LaserstreamConfig = {
  apiKey: 'YOUR_API_KEY', // Replace with your key from https://dashboard.helius.dev/
  endpoint: 'https://laserstream-mainnet-ewr.helius-rpc.com', // Choose your closest region
}

  await subscribe(config, subscriptionRequest, async (data) => {
    
    console.log(data);

  }, async (error) => {
    console.error(error);
  });
}

main().catch(console.error);
5

Replace Your API Key and Choose Your Region

In index.ts, update the config object with:

  1. Your actual API key from the Helius Dashboard
  2. The LaserStream endpoint closest to your server location
const config: LaserstreamConfig = {
  apiKey: 'YOUR_ACTUAL_API_KEY', // Replace with your key from Helius Dashboard
  endpoint: 'https://laserstream-mainnet-fra.helius-rpc.com', // Example: Frankfurt mainnet
  // For devnet: endpoint: 'https://laserstream-devnet-ewr.helius-rpc.com'
}

Network & Region Selection Examples:

  • For Production (Mainnet):
    • Europe: Use fra (Frankfurt) or ams (Amsterdam)
    • US East: Use ewr (New York)
    • US West: Use slc (Salt Lake City)
    • Asia: Use tyo (Tokyo) or sgp (Singapore)
  • For Development (Devnet): Use https://laserstream-devnet-ewr.helius-rpc.com
6

Run and View Results

npx ts-node index.ts

Whenever a confirmed token transaction involves TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, you’ll see the data in your console.

Subscribe Request

In the subscribe request, you need to include the following general parameters:

Historical Replay: You can optionally include a fromSlot: string field in the main SubscribeRequest object to replay data from a specific slot onwards. Currently, replay is supported for up to 3000 slots in the past.

const subscriptionRequest: SubscribeRequest = {
  commitment: CommitmentLevel.CONFIRMED,
  accountsDataSlice: [],
  transactions: {},
  accounts: {},
  slots: {},
  blocks: {},
  blocksMeta: {},
  entry: {},
}

Next, you’ll need to specify the filters for the data you want to subscribe to, such as accounts, blocks, slots, or transactions.

Code Examples (LaserStream SDK)

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

async function main() {
    const subscriptionRequest: SubscribeRequest = {
        transactions: {},
        commitment: CommitmentLevel.CONFIRMED,
        accounts: {},
        slots: {
            slot: { filterByCommitment: true },
        },
        transactionsStatus: {},
        blocks: {},
        blocksMeta: {},
        entry: {},
        accountsDataSlice: [],
    };

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

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

main().catch(console.error);

Troubleshooting / FAQ