Skip to main content

Install

Building the client

The URL falls back to the ORBITFLARE_JETSTREAM_URL environment variable. All builder methods are identical to the gRPC client - same defaults, same behavior (APIKey, Retry, Timeout, Keepalive, PingInterval, MaxMissedPongs, ChannelCapacity, MaxDecodingMessageSize, Logger).

Building a subscription

Jetstream supports transaction filters (no slots, blocks, or commitment - those are Yellowstone-specific). Each TransactionFilter exposes AccountInclude, AccountExclude, and AccountRequired.

Reading the stream

Subscribe returns a *jetstream.Stream. Call Next(ctx):
Closing, multiple streams, reconnection, ping/pong, connection events (stream.Events()), and rejected requests ending the stream instead of retrying all work identically to the gRPC client. Each stream is its own connection, and Jetstream allows 25 connections per IP per region. See connection limits.

Full example

A stream that watches Raydium AMM swaps and prints each transaction’s slot.

Jetstream v2

Jetstream v2 (github.com/orbitflare/orbitflare-sdk-go/jetstream/v2) runs on the same endpoints and authentication as v1 and is fully additive: v1 keeps working unchanged. What v2 adds:
  • Runtime-managed filters - add and remove filters on a live stream without reconnecting.
  • Per-message sequence numbers - every response carries a monotonic Sequence, so you can detect dropped messages.
  • Opt-in enrichment - request fee payer, program ids, compute-unit price, compute limit, resolved address-table addresses, and more, per transaction.
  • Slot lifecycle events - a separate server stream of slot alive/complete/dead events, with optional Alpenglow block footers.
The v2 client lives under jetstream/v2. The builder is identical to v1 (same methods, defaults, ORBITFLARE_JETSTREAM_URL env var, and failover):

Building typed filters

Each filter is a TransactionFilter with a client-chosen id (via .WithID()). The id is echoed back on every matching transaction and in the filter-validation acknowledgement, so you can correlate matches and remove the filter later.
A filter must set at least one of AccountInclude, AccountExclude, or AccountRequired; empty (match-everything) filters are rejected. IncludeEnrichment is optional (default off) and applies to the whole subscription: if any active filter enables it, every transaction you receive is enriched.

Subscribing to transactions

Managing filters on a live stream

Take a handle from the stream and add or remove filters without reconnecting. Removals reference the filter id you assigned with .WithID().
stream.AddFilters(...) and stream.RemoveFilters(...) are shortcuts for the same thing. Each returns an error if the stream has been closed.

Slot lifecycle events

SubscribeSlots() is a separate server stream and takes no filters.
Opt into Alpenglow block footers on the same stream with SubscribeSlotsWithBlockFooters(). They arrive as SLOT_STATUS_BLOCK_FOOTER events, at most once per slot, and are not ordered relative to SLOT_STATUS_COMPLETE. The certificates’ BLS signatures are not verified, so treat a footer as the leader’s claim, not proof of finality:
SubscribeSlots() never sends footers. Both TransactionStream and SlotStream report connection events through Events().

Health probes

GetVersion(ctx) and Ping(ctx, count) are unary calls with the same failover as the streams.
For the full protobuf specification, message shapes, enrichment fields, and slot statuses, see the Jetstream Protocol Reference.