Indexers and Checkpoints¶
Anyone can run an indexer. It announces itself on the relays with a signed descriptor every ten minutes.
Ingestion¶
An indexer follows every relay live and reconciles with it every 30 seconds. It verifies each event, stores it in an append-only archive, and applies it. The state is rebuilt from the archive at start. Every 20 seconds it exchanges missing events with the other indexers.
Configuration¶
| Variable | Default | Meaning |
|---|---|---|
INDEXER_NAME |
required | Name in the descriptor |
PUBLIC_URL |
required | Address that readers and other indexers use |
RELAYS |
none | Relays to follow |
EPOCH_SECONDS |
0 |
Length of a checkpoint epoch. 0 disables checkpoints |
COMMITTEE |
7 |
Committee size |
COMMITTEE_ALLOW |
all | Keys that may take part in committees and synchronization |
ALLOW_PRIVATE |
false |
Allow private addresses |
DATA_FILE, KEY_FILE |
/data/indexer.db, /data/indexer.key |
Storage |
Indexers that co-sign checkpoints need the same EPOCH_SECONDS, COMMITTEE and COMMITTEE_ALLOW. For critical registries, set COMMITTEE_ALLOW so that nobody can fill the committee with new indexers.
Checkpoints¶
The committee of an epoch is ordered by hash, so it changes every epoch. The first member proposes. A member signs only if
- the epoch is the current one or next to it,
- it computes the same committee and quorum,
- the proposer is the first member,
- its own root and size match, after synchronizing with the proposer if necessary,
- it did not sign another root for this epoch.
The checkpoint event (kind 4604) carries the epoch, size, root, committee and signatures. GET /v1/checkpoints lists recent ones.
Answers¶
Answers are cached for up to 30 seconds. Each carries an increasing sequence number, which is stored before the answer is signed. Two different answers with the same number prove equivocation.