A small Rust backend service that indexes on-chain activity for a configurable set of Solana program IDs and exposes it through a JSON HTTP API and a minimal dashboard.
- Polls the Solana JSON-RPC for new signatures involving each tracked program, using each program's last-seen signature as a cursor so only new activity is fetched.
- Fetches the full transaction payload for every new signature and stores normalized metadata plus the raw JSON in PostgreSQL.
- Ingestion is idempotent — re-running against the same signatures is safe (
ON CONFLICTupserts and a(program_id, signature)join table). - Records ingestion errors in a separate table instead of crashing the worker, so a bad signature never blocks the rest of the batch.
- Exposes
/health,/programs,/programs/:id/transactions, and/transactions/:signatureover HTTP.
┌──────────────────────┐
│ Solana RPC │
└──────────┬───────────┘
│ signatures + raw tx
▼
┌───────────────────────────────┐
│ IndexerWorker (tokio task) │
│ - cursor per program │
│ - per-signature retries │
└──────────┬────────────────────┘
│
▼
┌───────────────────────────────┐
│ PostgreSQL │
│ tracked_programs │
│ transactions (raw_jsonb) │
│ program_transactions │
│ ingestion_errors │
└──────────┬────────────────────┘
│
▼
┌───────────────────────────────┐
│ Axum HTTP API + static UI │
└───────────────────────────────┘
The RPC layer is a SolanaRpc trait, so the worker and parser are exercised in tests without touching the network.
cp .env.example .env
docker compose up -d postgres
cargo runMigrations are embedded and run on startup. The dashboard is served from static/ at http://localhost:8080/.
curl http://localhost:8080/health
curl -X POST http://localhost:8080/programs \
-H 'content-type: application/json' \
-d '{"program_id":"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr","label":"Memo Program"}'
curl http://localhost:8080/programs/MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr/transactionsUnit tests run with cargo test. The database integration tests use sqlx::test and need a running Postgres:
docker compose up -d postgres
DATABASE_URL=postgres://postgres:postgres@localhost:5432/solana_indexer cargo testRust 2021 · Tokio · Axum · sqlx · PostgreSQL · solana-client / solana-sdk · tracing.