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 (Retry, Timeout, Keepalive, PingInterval, MaxMissedPongs, ChannelCapacity, 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, and ping/pong all work identically to the gRPC client.

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.
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.

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 v2 Protocol Reference.