Installation
Add the client to yourCargo.toml:
Quick Start
Basic Connection
Connect to a Yellowstone gRPC server:Connecting via Unix Domain Socket
For local connections, use Unix domain sockets for better performance:Client Builder
TheGeyserGrpcBuilder provides extensive configuration options:
Creating a Builder
Authentication
TLS Configuration
Compression
Message Size Limits
Connection Options
Streaming Subscriptions
Subscribe Once
For one-way streaming where you don’t need to update the subscription:Bidirectional Streaming
For dynamic subscriptions where you need to update filters:Account Subscriptions
Transaction Subscriptions
Block Subscriptions
Unary RPC Methods
Health Check
Get Version
Get Slot
Get Block Height
Get Latest Blockhash
Is Blockhash Valid
Ping
Subscribe Replay Info
Advanced: Ping/Pong for Keep-Alive
Some load balancers require periodic client pings:Error Handling
The client usesGeyserGrpcClientError for errors:
Complete Example
Here’s a complete example subscribing to slots with reconnection logic:API Reference
GeyserGrpcClient Methods
| Method | Description |
|---|---|
health_check() | Check if the server is healthy |
health_watch() | Stream health status updates |
subscribe() | Create bidirectional subscription stream |
subscribe_with_request(req) | Subscribe with initial request |
subscribe_once(req) | One-way subscription stream |
ping(count) | Send ping to server |
get_version() | Get server version |
get_slot(commitment) | Get current slot |
get_block_height(commitment) | Get current block height |
get_latest_blockhash(commitment) | Get latest blockhash |
is_blockhash_valid(hash, commitment) | Check blockhash validity |
GeyserGrpcBuilder Methods
| Method | Description |
|---|---|
x_token(token) | Set authentication token |
tls_config(config) | Configure TLS |
connect_timeout(duration) | Set connection timeout |
timeout(duration) | Set request timeout |
tcp_nodelay(enabled) | Enable/disable TCP_NODELAY |
tcp_keepalive(duration) | Set TCP keepalive |
send_compressed(encoding) | Enable compression for sends |
accept_compressed(encoding) | Enable compression for receives |
max_decoding_message_size(limit) | Set max message size for decoding |
max_encoding_message_size(limit) | Set max message size for encoding |
connect() | Connect to server |
connect_lazy() | Create client without connecting |
connect_uds(path) | Connect via Unix domain socket |
Next Steps
Plugin Configuration
Learn how to configure and run the plugin
Subscribe Filters
Deep dive into subscription filters