Off-Chain Services
TRTH’s off-chain stack observes and automates around on-chain state but does not replace consensus rules: minting, caps, epochs, and randomness outcomes remain enforced by Solidity on Base.
Orchestrator (keeper)
Section titled “Orchestrator (keeper)”The orchestrator handles time-sensitive operations that keep the protocol running smoothly:
- Epoch operations: Advance epoch-related state in coordination with EpochRewardsV1_1.
- VRF lifecycle: Request random words and track fulfillment so bonus and king flows progress correctly.
- Bonus / king flows: Sweep bonus-related steps and finalize king outcomes per protocol operations.
The orchestrator submits signed transactions via RPC using operator keys allowed by contract roles. It never has access to admin keys in production.
Indexer
Section titled “Indexer”The indexer maintains a queryable database of protocol state:
- Indexes
Transferevents and maintains holder balances and related aggregates. - Records epoch snapshots and eligibility derived from chain events.
- Persists everything for low-latency reads and analytics.
This is a read-only service — it does not send state-changing transactions. Full historical scans on every user request would be too slow for production UIs, so the indexer turns chain logs into responsive queries.
Proof-API
Section titled “Proof-API”A read-only HTTP API exposing epoch metadata, eligibility, and chain-derived state. It serves the frontend, bots, and integrations that need structured data instead of raw RPC. Responses should be treated as caches: for dispute resolution, always verify on-chain.
How the services fit together
Section titled “How the services fit together”┌─────────────┐ RPC ┌──────────────────┐│ Base L2 │◄────────────►│ orchestrator ││ contracts │ tx + read │ (keeper) │└──────┬──────┘ └────────┬─────────┘ │ events │ ▼ │┌─────────────┐ ┌─────────▼────────┐│ indexer │─────────────►│ database │└──────┬──────┘ writes └────────┬─────────┘ │ │ └──────────────────────────────►│ optional reads │ ┌─────────▼────────┐ │ proof-api │ └────────┬─────────┘ │ JSON ▼ ┌─────────────────┐ │ Web / clients │ └─────────────────┘