Config reference

The Generator client loads configuration from a YAML file (default config/config.yaml) and then applies environment variable overrides on top. Fields left unset in both the YAML and env vars receive code defaults from applyDefaults in config/config.go and SetDefaults in pkg/pruner/config.go and pkg/snapshot/snapshot.go.

Env vars override YAML values. Where the shipped config.yaml sets a different value than the code default, both are noted below.

chain

Identifies which EVM chain to index. Collection names are derived as {name}__{network}__Block, etc.

KeyTypeDefaultRequiredEnv varDescription
namestringEthereumnoCHAIN_NAMEChain name. Also supports Arbitrum, Optimism, Avalanche, or any EVM chain.
networkstringMainnetnoCHAIN_NETWORKNetwork name, for example Mainnet or Testnet.

Ethereum is the only officially supported chain today. The shipped config.yaml lists Arbitrum, Optimism, and Avalanche as supported, and any EVM-compatible chain can likely be indexed by setting chain.name and chain.network to the correct values and pointing geth.node_url at a compatible RPC endpoint. The codebase is being refactored from EVM-only to a Chain interface with chain-specific Fetcher and Converter components, which will formalize multi-chain support. See Chain abstraction for the current state.

defradb

Embedded database configuration. DefraDB handles storage, P2P replication, content addressing, and query serving.

KeyTypeDefaultRequiredEnv varDescription
urlstringemptyyes if embedded is falseDEFRADB_URLDefraDB API URL. When embedded is true and url is empty, DefraDB runs on a random port. DEFRADB_HOST with optional DEFRADB_PORT also constructs this URL.
keyring_secretstringemptynoDEFRADB_KEYRING_SECRETEncryption secret for the DefraDB keyring. Must stay the same across restarts or the existing identity becomes unreadable.
embeddedboolfalseno(none)When true, runs an embedded DefraDB instance. When false, requires a non-empty url pointing to an external DefraDB. Shipped config.yaml sets true.

defradb p2p

P2P networking configuration. The Generator pushes data out over libp2p and rejects all incoming replication.

KeyTypeDefaultRequiredEnv varDescription
enabledboolfalsenoDEFRADB_P2P_ENABLEDEnable P2P networking. Shipped config.yaml sets true.
accept_incomingboolfalsenoDEFRADB_P2P_ACCEPT_INCOMINGAccept incoming P2P documents. false means reject all. The Generator is a source of truth and should keep this false.
bootstrap_peersstring arrayemptyno(none)P2P bootstrap peer multiaddrs. Peers are also discovered through EntityRegistered events from ShinzoHub.
listen_addrstringemptynoDEFRADB_P2P_LISTEN_ADDRMultiaddr to listen on for P2P connections. Shipped config.yaml sets /ip4/0.0.0.0/tcp/9171.
max_retriesint0no(none)Connection attempts before marking a peer as failed. Shipped config.yaml sets 5.
retry_base_delay_msint0no(none)Base delay in milliseconds for exponential backoff (1s, 2s, 4s, 8s, 16s). Shipped config.yaml sets 1000.
reconnect_interval_msint0no(none)Interval in milliseconds to check for disconnected peers. Shipped config.yaml sets 60000.
enable_auto_reconnectboolfalseno(none)Automatically reconnect to failed or disconnected peers. Shipped config.yaml sets true.

defradb store

Badger storage engine configuration. All cache and compaction fields map directly to Badger options.

KeyTypeDefaultRequiredEnv varDescription
pathstringemptynoDEFRADB_STORE_PATHPath to the DefraDB data directory. Shipped config.yaml sets ./.defra.
block_cache_mbint640noDEFRADB_BLOCK_CACHE_MBBadger block cache size in MB. Shipped config.yaml sets 512.
memtable_mbint640noDEFRADB_MEMTABLE_MBBadger memtable size in MB. Shipped config.yaml sets 64.
index_cache_mbint640noDEFRADB_INDEX_CACHE_MBBadger index cache size in MB. Shipped config.yaml sets 256.
num_compactorsint0noDEFRADB_NUM_COMPACTORSNumber of Badger compaction workers. Shipped config.yaml sets 4.
num_level_zero_tablesint0noDEFRADB_NUM_LEVEL_ZERO_TABLESL0 tables before compaction starts. Shipped config.yaml comments this out.
num_level_zero_tables_stallint0noDEFRADB_NUM_LEVEL_ZERO_TABLES_STALLL0 tables that trigger write stalls. Shipped config.yaml comments this out.
value_log_file_size_mbint640no(none)Size of each value log file in MB. Smaller files mean more effective GC. Shipped config.yaml sets 128.

geth

Connection details for the Ethereum execution node. The Generator does not run a node. It reads from one you provide.

KeyTypeDefaultRequiredEnv varDescription
node_urlstringemptyyesGETH_RPC_URLGeth JSON-RPC endpoint URL. Used for full block fetches, gap fills, and historical ranges.
ws_urlstringemptyyesGETH_WS_URLGeth WebSocket endpoint URL. Used for real-time new block header subscriptions.
api_keystringemptynoGETH_API_KEYAPI key for node authentication. Leave empty for same-VPC nodes without auth.
api_key_typestringemptynoGETH_API_KEY_TYPEHeader name for the API key. x-goog-api-key for GCP Blockchain Node Engine, x-api-key for most others.

indexer

Controls how the Generator fetches and processes blocks.

KeyTypeDefaultRequiredEnv varDescription
start_heightint0noINDEXER_START_HEIGHTBlock number to start indexing from on first run with no existing data. 0 means auto-detect from chain tip. Must be 0 or higher.
concurrent_blocksint8noINDEXER_CONCURRENT_BLOCKSNumber of blocks to process concurrently. Shipped config.yaml sets 1.
receipt_workersint16noINDEXER_RECEIPT_WORKERSConcurrent receipt fetchers per block. Shipped config.yaml sets 8.
max_docs_per_txnint1000noINDEXER_MAX_DOCS_PER_TXNDocument threshold for single-transaction block creation. Shipped config.yaml sets 100.
max_tx_docs_per_batchint0noINDEXER_MAX_TX_DOCSPer-batch document size for transactions. 0 means use max_docs_per_txn. Shipped config.yaml sets 100.
max_log_docs_per_batchint0noINDEXER_MAX_LOG_DOCSPer-batch document size for logs. 0 means use max_docs_per_txn. Shipped config.yaml sets 125.
max_ale_docs_per_batchint0noINDEXER_MAX_ALE_DOCSPer-batch document size for access list entries. 0 means use max_docs_per_txn. Shipped config.yaml sets 500.
blocks_per_minuteint0noINDEXER_BLOCKS_PER_MINUTEBlock indexing rate limit. 0 means no limit. Shipped config.yaml sets 60.
health_server_portint8080noINDEXER_HEALTH_SERVER_PORTHealth server port. Set to -1 to disable.
open_browser_on_startboolfalseno(none)Auto-open the health page in a browser on startup.
start_bufferint100noINDEXER_START_BUFFERStart this many blocks before chain tip when skipping ahead.
schema_auth_modestringtokennoSCHEMA_AUTH_MODEAuth mode for the /api/v1/schema endpoints. One of none, token, or mtls. Empty defaults to token. mtls is not yet implemented. Shipped config.yaml sets ${SCHEMA_AUTH_MODE} (env-substituted).
schema_api_keysstring arrayemptyyes if schema_auth_mode is tokenSCHEMA_API_KEYSBearer tokens accepted for /api/v1/schema endpoints when mode is token. Comma-separated. Not settable in config.yaml (the field uses yaml:"-"); provide via SCHEMA_API_KEYS or every schema request returns 503.

pruner

Removes old data to keep storage bounded. Defaults are applied by SetDefaults in pkg/pruner/config.go when fields are unset.

KeyTypeDefaultRequiredEnv varDescription
enabledboolfalsenoPRUNER_ENABLEDEnable automatic pruning. Shipped config.yaml sets true.
max_blocksint6410000noPRUNER_MAX_BLOCKSNumber of blocks to retain. Shipped config.yaml sets 1000.
docs_per_blockint1000no(none)Average docs per block, used with max_blocks to compute the max document count. Approximately 1057 on Ethereum mainnet.
prune_thresholdint640noPRUNER_PRUNE_THRESHOLDDeprecated. Kept for backward compatibility but unused by the pruner. Shipped config.yaml sets 1.
interval_secondsint60noPRUNER_INTERVAL_SECONDSHow often in seconds to check and prune. Shipped config.yaml sets 30.
prune_historyboolfalseno(none)Walk DAG chains to delete historical block versions. Two to three times slower.

snapshot

Bundles multiple blocks into a single signed file for faster initial sync. Defaults are applied by SetDefaults in pkg/snapshot/snapshot.go when fields are unset.

KeyTypeDefaultRequiredEnv varDescription
enabledboolfalsenoSNAPSHOT_ENABLEDEnable automatic snapshots before pruning. Shipped config.yaml sets true.
dirstring./snapshotsnoSNAPSHOT_DIRDirectory to store snapshot files. Shipped config.yaml sets ./.defra/snapshots.
blocks_per_fileint641000noSNAPSHOT_BLOCKS_PER_FILEBlocks per snapshot file. Shipped config.yaml sets 100.
interval_secondsint60noSNAPSHOT_INTERVAL_SECONDSHow often in seconds to check and create snapshots. Shipped config.yaml sets 30.

logger

Logging configuration. The logger is zap-based. The log level is controlled by development, not by a level field.

KeyTypeDefaultRequiredEnv varDescription
developmentboolfalsenoLOGGER_DEBUGEnable development mode logging. When true, shows debug and test-level output. When false, shows info level and above. Shipped config.yaml sets true.

The shipped config.yaml also sets logger.level: "info". This field is not in the LoggerConfig struct and has no effect. The log level is determined entirely by development.

Environment variables

The table below lists every environment variable the Generator client reads, the YAML key it overrides, and the source file that reads it.

Env varOverridesRead in
CHAIN_NAMEchain.nameconfig/config.go
CHAIN_NETWORKchain.networkconfig/config.go
GETH_RPC_URLgeth.node_urlconfig/config.go
GETH_WS_URLgeth.ws_urlconfig/config.go
GETH_API_KEYgeth.api_keyconfig/config.go
GETH_API_KEY_TYPEgeth.api_key_typeconfig/config.go
INDEXER_START_HEIGHTindexer.start_heightconfig/config.go
INDEXER_CONCURRENT_BLOCKSindexer.concurrent_blocksconfig/config.go
INDEXER_RECEIPT_WORKERSindexer.receipt_workersconfig/config.go
INDEXER_MAX_DOCS_PER_TXNindexer.max_docs_per_txnconfig/config.go
INDEXER_MAX_TX_DOCSindexer.max_tx_docs_per_batchconfig/config.go
INDEXER_MAX_LOG_DOCSindexer.max_log_docs_per_batchconfig/config.go
INDEXER_MAX_ALE_DOCSindexer.max_ale_docs_per_batchconfig/config.go
INDEXER_BLOCKS_PER_MINUTEindexer.blocks_per_minuteconfig/config.go
INDEXER_HEALTH_SERVER_PORTindexer.health_server_portconfig/config.go
INDEXER_START_BUFFERindexer.start_bufferconfig/config.go
SCHEMA_AUTH_MODEindexer.schema_auth_modeconfig/config.go
SCHEMA_API_KEYSindexer.schema_api_keysconfig/config.go
DEFRADB_URLdefradb.urlconfig/config.go
DEFRADB_HOSTdefradb.urlconfig/config.go (combined with DEFRADB_PORT)
DEFRADB_PORTdefradb.urlconfig/config.go (combined with DEFRADB_HOST)
DEFRADB_KEYRING_SECRETdefradb.keyring_secretpkg/defradb/defra.go
DEFRADB_P2P_ENABLEDdefradb.p2p.enabledconfig/config.go
DEFRADB_P2P_LISTEN_ADDRdefradb.p2p.listen_addrconfig/config.go
DEFRADB_P2P_ACCEPT_INCOMINGdefradb.p2p.accept_incomingconfig/config.go
DEFRADB_STORE_PATHdefradb.store.pathconfig/config.go
DEFRADB_BLOCK_CACHE_MBdefradb.store.block_cache_mbconfig/config.go
DEFRADB_MEMTABLE_MBdefradb.store.memtable_mbconfig/config.go
DEFRADB_INDEX_CACHE_MBdefradb.store.index_cache_mbconfig/config.go
DEFRADB_NUM_COMPACTORSdefradb.store.num_compactorsconfig/config.go
DEFRADB_NUM_LEVEL_ZERO_TABLESdefradb.store.num_level_zero_tablesconfig/config.go
DEFRADB_NUM_LEVEL_ZERO_TABLES_STALLdefradb.store.num_level_zero_tables_stallconfig/config.go
PRUNER_ENABLEDpruner.enabledconfig/config.go
PRUNER_MAX_BLOCKSpruner.max_blocksconfig/config.go
PRUNER_PRUNE_THRESHOLDpruner.prune_thresholdconfig/config.go
PRUNER_INTERVAL_SECONDSpruner.interval_secondsconfig/config.go
SNAPSHOT_ENABLEDsnapshot.enabledconfig/config.go
SNAPSHOT_DIRsnapshot.dirconfig/config.go
SNAPSHOT_BLOCKS_PER_FILEsnapshot.blocks_per_fileconfig/config.go
SNAPSHOT_INTERVAL_SECONDSsnapshot.interval_secondsconfig/config.go
LOGGER_DEBUGlogger.developmentconfig/config.go

Env vars that are not read

The following env vars appear in some deployment artifacts but are not read by the Generator client code. They have no effect on runtime behavior.

Env varWhere it appearsNotes
LOG_LEVELdocker-compose-prod.yml, indexer-prod-setup.shNot read. Log level is controlled by logger.development and LOGGER_DEBUG.
LOG_SOURCEdocker-compose-prod.yml, indexer-prod-setup.shNot read.
LOG_STACKTRACEdocker-compose-prod.yml, indexer-prod-setup.shNot read.
DEFRADB_PLAYGROUNDInstall page docker run exampleNot read. The playground is controlled by build tags, not env vars.
GOMEMLIMITdocker-compose-prod.ymlNot read by the client. This is a Go runtime soft memory limit, honored by the Go runtime itself. Set it to control garbage collection behavior under memory pressure.

Need help