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
Parsed Instruction Support
Parsed Request
Parsed Transaction Update
Instruction 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 SubscribeParsed for parsed instruction support
- 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: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
- Use SubscribeParsed for parsed instruction support when needed