Skip to main content

Class: OvercastIndexer

Defined in: packages/overcast-core/src/indexer/indexer.ts:40

Drives the store off the chain through three modes. Each is a step that supervise runs in a loop:

backfill: scans history once, from the head down to the deployment's ProtocolInitialized (or startCheckpoint), as finalized. live: tails the live head as live (still reorgable). finalized: tails the finalized head as finalized (canonical).

All scanning runs backwards (the chain pages newest first), so a tail is a sweep bounded below by its stored cursor. Inserts are idempotent and each mode persists its own cursor, so a crash resumes without gaps or dupes.

Constructors​

Constructor​

new OvercastIndexer(
client,
storage,
domain,
chainName,
chunkSize?,
startCheckpoint?,
intervals?): OvercastIndexer;

Defined in: packages/overcast-core/src/indexer/indexer.ts:65

Parameters​

ParameterTypeDefault value
clientOvercastIndexerClientundefined
storageOvercastStoreundefined
domainnumberundefined
chainNamestringundefined
chunkSizenumber10
startCheckpointCheckpoint | nullnull
intervalsPartial<IndexerIntervals>{}

Returns​

OvercastIndexer

Properties​

chainName​

readonly chainName: string;

Defined in: packages/overcast-core/src/indexer/indexer.ts:69


chunkSize​

chunkSize: number;

Defined in: packages/overcast-core/src/indexer/indexer.ts:49


domain​

readonly domain: number;

Defined in: packages/overcast-core/src/indexer/indexer.ts:68


indexer​

indexer: OvercastIndexerClient;

Defined in: packages/overcast-core/src/indexer/indexer.ts:41


intervals​

intervals: IndexerIntervals;

Defined in: packages/overcast-core/src/indexer/indexer.ts:50


startCheckpoint​

startCheckpoint: Checkpoint | null;

Defined in: packages/overcast-core/src/indexer/indexer.ts:48

Optional hard floor of the backwards search. Normally null: the backfill stops on its own once it sees ProtocolInitialized, since nothing can precede the protocol's initialization.


storage​

storage: OvercastStore;

Defined in: packages/overcast-core/src/indexer/indexer.ts:42

Methods​

start()​

start(): Promise<void>;

Defined in: packages/overcast-core/src/indexer/indexer.ts:112

Starts every mode and keeps indexing regardless of failures.

Returns​

Promise<void>