CLI

All commands and flags.

Commands

terminal
sieve [OPTIONS]                Run the indexer
sieve init                     Scaffold a new project (sieve.toml, .env, abis/)
sieve init --docker            Same + docker-compose.yml with PostgreSQL
sieve schema                   Print generated SQL DDL
sieve reset                    Drop and recreate all tables
sieve inspect                  Dry-run: show tables, columns, and filters
sieve add-contract <ADDRESS>   Fetch ABI from Etherscan and add to config
sieve peers                    Test P2P connectivity (no DB or config needed)

Flags

--config <PATH>

Path to TOML config. Default: sieve.toml

--start-block <NUM>

Override start block for all contracts.

--end-block <NUM>

Stop at this block. Omit for follow mode.

--database-url <URL>

PostgreSQL URL. Overrides DATABASE_URL from .env.

--api-port <PORT>

Override GraphQL API port. Also configurable via [api] port in TOML.

--p2p-port <PORT>

Override P2P listen port. Default: 30303.

--fresh

Drop and recreate all tables before indexing.

-v, --verbose

Use tracing logs instead of the pretty UI.

-V, --version

Print version.

Environment variables

All sensitive values live in .env (auto-loaded at startup via dotenvy). Never in TOML.

VariablePurpose
DATABASE_URLPostgreSQL connection URL
WEBHOOK_URLWebhook endpoint URL
RABBITMQ_URLRabbitMQ connection URL
ETHERSCAN_API_KEYEtherscan API key

sieve add-contract

Fetches a verified ABI from Etherscan, saves it to abis/, and appends a [[contracts]] block to your config. Auto-detects proxy contracts. Automatically sets start_block to the contract's deploy block.

terminal
sieve add-contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
sieve add-contract 0xA0b8... --name USDC
sieve add-contract 0xA0b8... --start-block 21000000

sieve inspect

Validates your config without a database connection. Shows what tables, columns, context fields, and filters would be created.

terminal
sieve inspect --config sieve.toml

sieve peers

Tests P2P connectivity without a database or config. Reports peer count and chain head every 5 seconds. Useful for diagnosing Docker/NAT issues.

terminal
sieve peers
# peers=5 best_head=22525078
# peers=8 best_head=22525090