Jetstream
Jetstream Protocol Reference
Protocol Buffer specification for OrbitFlare Jetstream
Protocol Buffer Specification
This document outlines the Protocol Buffer (protobuf) specification used by OrbitFlare Jetstream. The complete specification can be found in our GitHub repository.
Service Definition
Request Messages
SubscribeRequest
The main request message for subscribing to data updates:
Transaction Filtering
Account Filtering
Ping Request
Response Messages
SubscribeUpdate
The main response message containing updates:
Transaction Update
Account Update
Ping/Pong Updates
Shared Types
Non-streaming Methods
Using the Protocol
When implementing a client for Jetstream, you’ll need to:
- Generate client code from the protobuf definition
- Implement the Subscribe RPC method for data streaming
- Use Ping/Pong for connection health checks
- Use GetVersion to check server compatibility
- Handle different types of updates (transactions, accounts, pongs)
Code Generation
For TypeScript/JavaScript:
For Rust:
Best Practices
-
Version Compatibility
- Use GetVersion to check for protocol compatibility
- Monitor for breaking changes in beta releases
- Test thoroughly when upgrading
-
Error Handling
- Implement proper error handling for all message types
- Handle connection failures gracefully
- Validate message fields before processing
-
Connection Management
- Use Ping/Pong for connection health checks
- Implement automatic reconnection logic
- Set appropriate timeouts
-
Performance
- Use appropriate filters to minimize unnecessary data
- Consider using account filtering for large datasets
- Monitor resource usage, especially with account subscriptions
Support
For technical questions about the protocol specification or implementation details, please visit our GitHub repository or join our Discord community.