Protocol Buffers
All languages use the same.proto definitions:
- geyser.proto - Main gRPC service definition
- solana-storage.proto - Solana data structures
Go Client
Installation
First, install the required dependencies:Generate Go Code
Generate Go code from the proto files:Basic Connection
Subscribe to Slots
Subscribe to Accounts
Subscribe to Transactions
Python Client
Installation
Install the required dependencies:Generate Python Code
Generate Python code from the proto files:geyser_pb2.py- Message definitionsgeyser_pb2_grpc.py- Service definitions
Basic Connection
Subscribe to Slots
Subscribe to Accounts
Subscribe to Transactions
Other Languages
Java
Use the grpc-java library:C# / .NET
Use the Grpc.Net.Client package:Ruby
Use the grpc gem:PHP
Use the grpc extension:Common Patterns
Authentication
All languages add thex-token header using gRPC metadata:
- Go: Use
metadata.NewOutgoingContext() - Python: Use
grpc.metadata_call_credentials() - Java: Use
MetadataUtils.newAttachHeadersInterceptor() - C#: Use
Metadatain call options
TLS Configuration
For secure connections:- Go:
credentials.NewClientTLSFromCert() - Python:
grpc.ssl_channel_credentials() - Java:
NettyChannelBuilder.useTransportSecurity() - C#:
GrpcChannel.ForAddress()withhttps://
Keepalive
Configure keepalive to maintain long-lived connections:- Go: Use
grpc.WithKeepaliveParams() - Python: Use
optionsparameter withgrpc.keepalive_*settings - Java: Use
NettyChannelBuilder.keepAliveTime() - C#: Use
SocketsHttpHandler.KeepAlivePingDelay
Proto Files Location
Get the latest proto files from the repository:geyser.proto- Service definitionsolana-storage.proto- Solana data structures
Error Handling
All gRPC clients use standard status codes:OK(0) - SuccessCANCELLED(1) - Request cancelledUNKNOWN(2) - Unknown errorINVALID_ARGUMENT(3) - Invalid requestDEADLINE_EXCEEDED(4) - Request timeoutNOT_FOUND(5) - Resource not foundUNAUTHENTICATED(16) - Missing or invalid auth tokenUNAVAILABLE(14) - Server unavailable
Examples Repository
Find complete working examples in the GitHub repository:Next Steps
Subscribe Filters
Learn about subscription filters and patterns
Plugin Setup
Deploy your own Yellowstone gRPC plugin