Overview
Geyser plugins are dynamic libraries (.so files on Linux, .dylib on macOS) loaded by the validator at startup. They receive callbacks for various events during block processing.
Installation
For plugin development, add to yourCargo.toml:
Plugin Trait
Implement theGeyserPlugin trait to create a plugin:
Callback Methods
update_account
Called when an account is updated or created. Parameters:account: Account information (pubkey, lamports, data, owner, executable, rent_epoch)slot: Slot number when the update occurredis_startup: Whether this is called during validator startup (snapshot loading)
notify_transaction
Called after a transaction is processed. Parameters:transaction: Transaction information (signature, status, transaction data)slot: Slot where transaction was processed
update_slot_status
Called when slot status changes (processed → confirmed → finalized). Parameters:slot: The slot numberparent: Parent slot (if available)status: New status (Processed,Confirmed,Rooted)
notify_block_metadata
Called when a block is complete. Parameters:blockinfo: Block metadata (slot, blockhash, rewards, block_height, etc.)
Configuration
Plugins are configured via JSON files referenced with--geyser-plugin-config:
config object to your plugin’s on_load method.
Building a Plugin
Create a Cargo library project:target/release/libmy_geyser_plugin.so.
Loading Plugins
Configure the validator to load your plugin:Performance Considerations
- Plugin callbacks run synchronously in the validator’s critical path
- Slow plugins will impact validator performance
- Offload heavy processing to background threads
- Use buffering and batching for I/O operations
- Enable only needed notifications (
account_data_notifications_enabled, etc.)
Example: Account Logger Plugin
See Also
- Validator Configuration - Loading Geyser plugins
- Architecture - Understanding validator internals
- Geyser Plugin Examples - Reference implementation