Overview
Geyser plugins enable you to:- Stream account updates in real-time
- Capture transaction execution details
- Monitor block production
- Track slot progression
- Build custom indexers and data pipelines
GeyserPlugin trait and receive callbacks from the validator runtime.
Plugin Interface
Account Updates
Plugins receive notifications when accounts are modified:Transaction Notifications
Plugins are notified when transactions are processed with full execution metadata including:- Transaction signature
- Execution status (success/failure)
- Log messages
- Account modifications
- Compute units consumed
Slot and Block Events
Track validator progress:- Slot notifications - When slots start and complete
- Block metadata - Block hash, parent slot, rewards
- Block commitment - Finalization status updates
Configuration
Configure Geyser plugins in your validator startup:plugin-config.json):
Building a Plugin
To create a Geyser plugin:- Implement the GeyserPlugin trait
- Export the plugin constructor
- Build as a dynamic library
Use Cases
Real-time Indexing
Stream account and transaction data to databases for fast queries:- PostgreSQL indexers
- Elasticsearch clusters
- Custom data warehouses
Analytics Pipelines
Feed blockchain data to analytics systems:- Stream to Kafka/RabbitMQ
- Export to data lakes
- Real-time dashboards
Custom Business Logic
Build application-specific data pipelines:- Token balance tracking
- NFT marketplace indexing
- DeFi protocol monitoring
- Custom alert systems
Performance Considerations
Best practices:- Use async processing with queues
- Batch updates when possible
- Handle errors gracefully to avoid validator crashes
- Monitor plugin memory usage
- Test thoroughly under load
Plugin Lifecycle
- Load - Validator loads the plugin dynamic library on startup
- Initialize -
on_load()called with configuration - Runtime - Callbacks invoked as events occur
- Shutdown -
on_unload()called when validator stops
Error Handling
Plugins should handle errors gracefully:- Return
PluginResult::Errfor recoverable errors - Log errors for debugging
- Avoid panics that could crash the validator
Source Reference
The Geyser plugin interface is defined in:geyser-plugin-interface/src/geyser_plugin_interface.rsgeyser-plugin-manager/src/- Plugin loading and management
Next Steps
RPC API
Alternative real-time data access via RPC subscriptions
WebSocket Methods
Subscribe to account and transaction updates via WebSocket