Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

config.toml

mevlog reads optional settings from a TOML config file at ~/.mevlog/config.toml. The file is created with a commented-out template on first run; running without it is fine, every option has a default.

Two top-level sections are supported: [chains.<id>] and [tables.<name>].

[chains.<id>] - custom RPC endpoints

By default mevlog auto-selects the fastest public RPC endpoint for a chain from ChainList. To pin your own endpoint (e.g. a private Alchemy/Infura URL, or a chain ChainList does not cover), add a [chains.<chain_id>] section keyed by chain ID:

[chains.1]
rpc_url = "https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY"

[chains.42161]
rpc_url = "https://arb-mainnet.g.alchemy.com/v2/YOUR_API_KEY"
KeyTypeRequiredDescription
rpc_urlstringyesHTTP(S) RPC endpoint used for that chain ID. Overrides ChainList auto-selection.

The section key is the chain ID. Both [chains.1] and [chains."1"] are accepted.

[tables.<name>] - custom tables

Define extra tables in the local txs database, populated from indexed logs rows matching a topic0, with topics and data byte ranges mapped to typed columns.

KeyTypeRequiredDescription
topic0hex string (32 bytes)yesEvent signature hash the table matches.
chainsarray of chain IDsnoRestrict the table to these chains. Default: all chains.
addressesarray of hex addresses (20 bytes)noEmitter filter; only logs from these addresses are captured. Default: no filter.
[[tables.<name>.columns]]array of tablesyes (≥1)Column definitions (see below).

Each [[tables.<name>.columns]] entry:

KeyTypeDescription
namestringColumn name; must match ^[a-z_][a-z0-9_]*$ and not collide with implicit columns (block_number, tx_index, log_index, address).
sourcestringtopic1..topic3, or a 0-based end-exclusive data byte range like data[0:32] (ABI word n is data[n*32:(n+1)*32]).
typestringaddress (20-byte BLOB), uint256 (32-byte big-endian BLOB, works with u256_*/format_ether), or bytes (verbatim slice; requires a data range source).

After editing a table’s definition, rebuild it with mevlog update-custom-tables --chain-id <id>.

See Custom Tables for a full walkthrough, query examples, and how the tables stay in step with logs.