Postgres-backed REST indexer for Sentrix Chain. Sources every block, transaction, and log from the public RPC + WebSocket endpoints, decodes ERC-20/721/1155 transfers, tracks reorgs, and exposes the result as an Etherscan-API-compatible REST surface plus Sentrix-native endpoints (validators, epochs, native token ops).
Status: scaffold — Phase 1 in progress. Tier 1 of the Sentrix Builder Readiness Sprint.
Sentrix node (rpc.sentrixchain.com)
│ JSON-RPC + WebSocket
▼
┌────────────────────────────────────┐
│ apps/indexer (sync worker) │
│ - block fetcher (backfill + tail) │
│ - log decoder (ERC-20/721/1155) │
│ - reorg detector │
│ - reads tip, writes Postgres │
└────────────────────────────────────┘
│
▼ packages/db (Drizzle)
┌────────────┐
│ Postgres │
└────────────┘
│
▼ packages/db
┌────────────────────────────────────┐
│ apps/api (Fastify) │
│ - REST: /blocks, /tx, /address │
│ - Etherscan-compat: ?module=... │
│ - Native: /validators, /epochs │
│ - WS pass-through to RPC │
└────────────────────────────────────┘
│
▼ consumed by sentriscloud/frontend/apps/scan
- Node 22 LTS + TypeScript 5
- Fastify 5 — REST API
- Drizzle ORM + Postgres 16 — schema source-of-truth
- viem ^2 — EVM RPC client
- Pino — structured logs
- Turborepo + pnpm workspaces
.
├── apps/
│ ├── indexer/ # Sync worker
│ └── api/ # REST + WS server
├── packages/
│ ├── db/ # Drizzle schema + migrations + typed queries
│ └── chain/ # Sentrix RPC client (HTTP + WS) wrappers
├── docker-compose.yml
└── package.json
pnpm install
docker compose up -d postgres
pnpm db:generate && pnpm db:migrate
pnpm devAPI will come up on :8081, indexer worker on :8082 (health check), Postgres on :5432.
REST native:
GET /blocks?limit=&before=GET /blocks/:heightGET /tx/:hashGET /address/:addrGET /address/:addr/txsGET /address/:addr/transfersGET /tokensGET /tokens/:address/holdersGET /validatorsGET /epochsGET /health
Etherscan-compatible (/api):
?module=account&action=txlist&address=...?module=account&action=balance&address=...?module=account&action=tokentx&address=...?module=stats&action=ethsupply(aliassrxsupply)?module=stats&action=ethsupplyExt?module=stats&action=ethprice
Native sentrix:
?module=native&action=validators?module=native&action=tokenomics?module=native&action=fork-status
MIT — see LICENSE.