sof
sof is a low-latency Solana observer runtime focused on:
- shred ingestion (direct UDP, relay, optional gossip bootstrap)
- optional shred verification
- dataset reconstruction and transaction extraction
- plugin-driven event hooks for custom logic
Install
Optional gossip bootstrap support at compile time:
= { = "0.2", = ["gossip-bootstrap"] }
Quick Start
Run the bundled runtime example:
With gossip bootstrap:
Runtime API
Embed directly in Tokio:
async
Or use programmatic setup:
use SocketAddr;
async
Plugin Quickstart
use async_trait;
use ;
;
async
Plugin Hooks
Current hook set:
on_raw_packeton_shredon_dataseton_transactionon_recent_blockhashon_cluster_topology(gossip-bootstrap mode)on_leader_schedule(gossip-bootstrap mode)
Operational Notes
- Hooks are dispatched off the ingest hot path through a bounded queue.
- Queue pressure drops hook events instead of stalling ingest.
SOF_LIVE_SHREDS_ENABLED=falseenables control-plane-only mode.
Examples
observer_runtimeobserver_with_non_vote_pluginobserver_with_multiple_pluginsnon_vote_tx_loggerraydium_contracttpu_leader_logger
Run any example:
Docs
- Workspace docs index:
../../docs/README.md - Architecture docs:
../../docs/architecture/README.md - Operations docs:
../../docs/operations/README.md - Contribution guide:
../../CONTRIBUTING.md