Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - helius-labs/laserstream-sdk
Nothing Special   »   [go: up one dir, main page]

Skip to content

helius-labs/laserstream-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LaserStream

High-performance gRPC client for streaming real-time Solana data. Built for developers who need reliable, low-latency Solana data with automatic reconnection and historical replay capabilities.

πŸš€ Key Features

  • Auto Reconnection: Robust reconnection with configurable retry limits
  • Slot Tracking: Automatic replay from last processed slot on reconnect (no data loss)
  • Historical Replay: Backfill missed data up to 3000 slots (~20 minutes)
  • Channel Options: Fine-tune gRPC performance, compression, timeouts, buffer sizes
  • Stream Write: Dynamic subscription updates without reconnecting
  • Replay Control: Enable/disable slot replay behavior for different use cases
  • Compression: Gzip and Zstd support (70-80% bandwidth reduction with Zstd)

πŸ“¦ Official SDKs

TypeScript/JavaScript SDK

  • Location: /javascript
  • Install: npm install helius-laserstream
  • Architecture: Rust core with NAPI bindings for zero-copy performance
  • Performance: 40x faster than Yellowstone JavaScript client (1.3GB/s vs 30MB/s)
  • Runtime Support: Node.js 16+ and Bun

Rust SDK

  • Location: /rust
  • Install: cargo add helius-laserstream
  • Architecture: Native Rust implementation with zero overhead

Go SDK

  • Location: /go
  • Install: go get github.com/helius-labs/laserstream-sdk/go
  • Architecture: Native Go implementation with goroutine safety

πŸ”§ Core Concepts

Subscription Types

All SDKs support streaming these Solana data types:

  • Accounts: Account state changes and updates
  • Transactions: Transaction data with filtering options
  • Blocks: Complete block data with transactions and accounts
  • Slots: Slot progression and metadata
  • Block Metadata: Block headers without full transaction data
  • Transaction Status: Transaction confirmation status
  • Entries: Raw ledger entries
  • Account Data Slices: Partial account data for efficiency

Channel Options

Fine-tune gRPC performance with:

  • Connection Settings: Timeouts, message size limits
  • Keepalive Settings: Connection stability configuration
  • Flow Control: Window sizes, buffer settings
  • Compression: Gzip or Zstd compression algorithms
  • Performance Options: TCP settings, HTTP/2 optimization

Replay Behavior

Control data consistency vs. performance:

Replay Enabled (Default):

  • Tracks processed slots internally
  • On reconnect, resumes from last processed slot
  • Guarantees no data loss during disconnections
  • Slightly higher memory usage for slot tracking

Replay Disabled:

  • No internal slot tracking
  • On reconnect, starts from current slot
  • Faster reconnection, potential data gaps
  • Lower memory footprint

Stream Write

Dynamically update subscriptions without reconnecting:

  • Add new filters to existing streams
  • Remove or modify subscription parameters
  • Immediate filter changes without connection overhead
  • Supported across all three SDKs

πŸ› οΈ Quick Start Examples

TypeScript/JavaScript

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

const stream = await subscribe(
  { apiKey: 'your-key', endpoint: 'your-endpoint' },
  { slots: { client: {} }, commitment: CommitmentLevel.CONFIRMED },
  (update) => console.log('Update:', update),
  (error) => console.error('Error:', error)
);

Rust

use helius_laserstream::{subscribe, LaserstreamConfig, grpc::SubscribeRequest};

let config = LaserstreamConfig::new(endpoint, api_key);
let request = SubscribeRequest { slots: [("client".to_string(), Default::default())].into(), ..Default::default() };
let (stream, _handle) = subscribe(config, request);

Go

import laserstream "github.com/helius-labs/laserstream-sdk/go"

client := laserstream.NewClient(laserstream.LaserstreamConfig{
    Endpoint: endpoint, APIKey: apiKey,
})
req := &laserstream.SubscribeRequest{
    Slots: map[string]*laserstream.SubscribeRequestFilterSlots{"client": {}},
}
client.Subscribe(req, dataHandler, errorHandler)

πŸ“š Documentation & Guides

Official Documentation

LaserStream Guides

Getting Started

Each SDK directory contains:

  • Installation instructions and dependencies
  • Comprehensive examples for all subscription types
  • Channel options configuration examples
  • Stream write usage patterns
  • Language-specific best practices

πŸ“„ License

MIT License - see individual SDK directories for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0