Install
Building the client
Here’s a client with every option set:Builder methods
.url(url) - The primary gRPC endpoint. Falls back to ORBITFLARE_GRPC_URL env var.
.urls(&[...]) - Primary + fallbacks in one call. First element is primary.
.fallback_url(url) / .fallback_urls(&[...]) - Add fallback endpoints. On connection failure, the SDK rotates through them.
.retry(policy) - Controls reconnection backoff. When a connection drops, the SDK waits initial_delay, then doubles it each attempt (capped at max_delay). Set max_attempts to 0 for infinite retries. Default: 100ms initial, 30s max, 2x multiplier, infinite.
.timeout_secs(n) - Per-request gRPC timeout. Default: 30.
.keepalive_secs(n) - TCP keepalive interval. The OS sends probes at this interval to detect dead connections at the TCP level. Default: 60.
.ping_interval_secs(n) - How often the SDK sends proto-level Ping messages to the server. The server should respond with a Pong. Default: 10.
.max_missed_pongs(n) - How many consecutive pings can go unanswered before the SDK considers the connection dead and reconnects. Default: 3. With the defaults, a dead connection is detected within 30 seconds.
.channel_capacity(n) - The bounded channel between the background task and your code. If your code is slow to consume events, the background task blocks when this fills up instead of eating unlimited memory. Default: 4096.
Writing a YAML config
Create a YAML file with the filters you want:YAML filter reference
transactions - each entry is a named filter. A transaction matches if it involves any of the account_include addresses. account_exclude removes matches. account_required means all listed addresses must be present. vote and failed filter by transaction type.
accounts - watch specific accounts by address, or watch all accounts owned by a program via owner.
slots - subscribe to slot updates. filter_by_commitment only sends updates at your commitment level.
commitment - "processed", "confirmed", or "finalized". Defaults to "confirmed".
The YAML supports ${ENV_VAR} expansion:
Subscribing and reading events
From YAML
Programmatically
For dynamic filters built at runtime:Reading the stream
Bothsubscribe_yaml and subscribe return a GeyserStream. Call .next() to get the next event:
stream.next() blocks until an event arrives. Returns None when the stream is closed. Each event is a Result - an Err means all retries were exhausted and the connection is permanently gone.
Pong messages are consumed internally and never appear in your stream.
Closing
Multiple streams
One client can run many streams at once. Each gets its own background connection:Full example
A stream that watches pump.fun transactions, decodes the signature, and prints a summary for each one.grpc.yml: