Program Chronicle
A Rust indexer for Solana transaction history and live events
On this page
1. At a glance
Program Chronicle is a Rust project for indexing Solana program activity. It combines historical RPC retrieval, live event handling, local SQLite state, and HTTP/SSE delivery. The public repository holds implementation detail without making unverified latency or test-count claims here.
2. Why it existed
Applications monitoring SVM programs have to reconcile past transactions cleanly with newly streaming events. Chronicle explores a self-contained Rust pipeline covering backfill, persistence, and live SSE delivery in a single binary.
3. Contribution
Authored the Rust architecture connecting async Solana RPC retrieval, Tokio coordination loops, SQLite state persistence, and Server-Sent Events streaming.
4. System Shape & Architecture
5. The project story
On-chain services on Solana often juggle heavyweight external databases or brittle polling scripts just to reconstruct past transactions alongside live slot activity. Program Chronicle was created to unify historical synchronization, local SQLite durability, and live Server-Sent Events in one self-contained Rust process.
Reconstructing historical transaction history
Chronicle started as a deterministic signature walker that pages backward through RPC history for target programs, establishing reliable ordering before live event listeners ever attach.
Adding crash-safe local checkpointing
Persisting indexed state and cursor boundaries in SQLite allowed the indexer to restart cleanly after RPC timeouts or deployments without losing slot alignment or duplicating records.
Streaming live updates to clients
Wrapping Tokio ingestion workers with HTTP endpoints and Server-Sent Events turned local on-chain indexing into a zero-broker real-time stream ready for downstream frontends and trading bots.
6. Technical Decisions & Tradeoffs
Using SQLite paired with SSE keeps deployment footprint minimal and eliminates external broker dependencies for focused SVM programs, while trading away horizontal multi-writer clustering.
7. Challenges & how I solved them
Bridging historical backfill and live streaming without gaps
When historical RPC pagination and a live subscription run concurrently, signatures around the handoff slot can arrive out of order, duplicate, or get missed during restarts.
How I Solved It
Tracked monotonic cursor checkpoints inside transactional SQLite writes and keyed ingested records on deterministic transaction signatures so overlap windows deduplicate safely.
Decoupling SQLite writes from live subscriber fanout
Burst blocks on Solana can spike incoming transactions; blocking RPC/WebSocket consumption on slow HTTP/SSE clients risks dropping updates.
How I Solved It
Bounded ingestion and storage writes behind dedicated Tokio channels and broadcast channels so lagging SSE consumers never stall canonical state commits.
8. Verification & Security
The public repository contains tests for the project. Test totals and measured performance are omitted until tied to a reproducible, dated repository snapshot.
9. Outcome & Metrics
The repository demonstrates a Rust indexer that connects historical data retrieval, live updates, local persistence, and client delivery. No latency, memory, or test-count figures are claimed here.
10. Reflection & Lessons Learned
Historical and live data paths need a clear reconciliation boundary. Designing them together makes recovery and state consistency easier to reason about than treating them as unrelated services.
11. Explore Source & Artifacts
- GitHub Repository: github.com/pya-h/program-chronicle
- Architecture: Rust, Tokio, Solana Client, SQLite, and SSE components are documented in the repository.