Skip to main content

Configuration file

Define the project in chef.config.ts. Source and database connections come from PREP_URL, optional PREP_API_TOKEN, and DATABASE_URL.

The public starter includes a block-summary configuration; blank and shielded starters use different models. This example stores only transactions with Orchard activity; use its matching entity schema.

import { defineConfig } from "@zeer-dev/chef";

export default defineConfig<{
OrchardTransaction: { id: string; height: number; version: number; transactionIndex: number };
}>({
project: "orchard_public",
network: "testnet",
startHeight: 0,
schema: "./schema.graphql",
handlerVersion: "1",
reorgWindow: 100,
sync: { pageSize: 1000, batchSize: 32, transactionFilter: { has_orchard: true } },
indexer: {
async transactionMetadata({ transaction, context }) {
await context.entities.set("OrchardTransaction", {
id: transaction.txid,
height: transaction.blockHeight,
version: transaction.version,
transactionIndex: transaction.index,
});
},
},
});
OptionPurpose
projectPostgreSQL project namespace
network, startHeightSource network and inclusive historical start
schemaEntity schema path
handlerVersionHandler generation, including imported helper changes
reorgWindowRetained recovery window
sync.pageSizeSource page size
sync.batchSizeBlocks per atomic commit group
sync.transactionFilterPublic Prep predicates
sync.adaptiveScanOpt into adaptive pages when the Prep server advertises support
shieldedLocal receipt-scanner account and fingerprint; see local setup

schema is resolved relative to the config file. Without explicit sync settings, Chef uses 16 blocks per source page and one block per commit; the generated starter sets 1,000 and 32 respectively for the public template. Blank and shielded templates use 16 and 1. Fixed source pages allow 1–1,000 blocks, adaptive pages allow up to 1,000,000, and commit groups allow 1–100 blocks. reorgWindow defaults to 100 and allows 1–1,000 retained blocks.

Use block handlers for per-block entities, or choose one of the transaction handlers for transaction input. Connection settings are covered in Environment Variables.

Notes: A failed commit group advances no checkpoint. Changing project identity requires a new namespace. See the complete filtered example for its matching schema.