Configuration
CLC Core reads config.toml by default. Set -config to use a different file. Environment variables with the CORE_ prefix override file values. Use two underscores between the section and key. For example, CORE_CHAIN__RPC_ENDPOINT overrides chain.rpc_endpoint.
Use TOML arrays for lists. In a CORE_ variable, separate list items with commas and no spaces. The loader converts literal \n sequences to line breaks in PEM keys. Keep private keys, API keys, and database credentials out of source control.
This reference follows the CLC Core schema at 3b75a56. Example config · Startup code
HTTP API
| Setting | What it controls |
|---|---|
api.address | Address and port for the HTTP server. The example listens on port 5003. |
api.prod | Sets secure session cookies with SameSite=None when true. Use HTTPS in production. |
api.cors | Browser origins that can call the API. Include the scheme and any non-default port. |
api.trust_proxy | Uses the forwarded client IP for public market rate limits. Enable it only when all traffic passes through a trusted proxy. |
api.private_key | Ed25519 private key in PEM format for JWT signing. The service derives the verification key from it. Use your own key in production. |
api.public_key | Public PEM field in the example file. The current server derives this key from api.private_key. |
Databases, workers, and events
| Setting | What it controls |
|---|---|
postgres.dsn | Connection string for the main PostgreSQL database. It holds service data, jobs, and the master signer key. |
federation.dsn | Connection string for indexed data, such as account balances and transfers. Leave it empty to disable federation. |
workers.max | Maximum concurrent workers. Zero or an unset value uses twice the CPU count. |
jetstream.endpoints | NATS server URLs for event publishing and consumption. |
jetstream.id | Durable consumer ID. Keep it stable across restarts to retain the consumer's position. |
jetstream.persist_duration_hrs | How many hours the service keeps events in the streams it publishes to. |
jetstream.skip_backlog | Drops the durable consumer at startup to skip past events. Leave it false in production. |
Chain
Use settings for the same chain throughout. For Gnosis mainnet, set chain.id to 100. Use a Gnosis RPC endpoint and Gnosis contract addresses. The example TOML uses Celo settings.
| Setting | What it controls |
|---|---|
chain.id | Chain ID used to sign transactions and select chain events. |
chain.rpc_endpoint | RPC URL for chain reads and transaction submission. |
chain.divvi_consumer | Divvi consumer address passed to the chain client for attribution. |
chain.ge_registry | Registry address used to find the account index. If the service cannot resolve the index, it disables on-chain account registration. |
chain.min_fee_cap_wei | Minimum gas fee cap in wei per gas. |
Relayer and passkeys
| Setting | What it controls |
|---|---|
relayer.calibur_address | Calibur implementation address on the configured chain. |
relayer.per_call_gas | Gas budget for each call in a relayed batch. |
relayer.base_exec_gas | Fixed gas budget added to each relay batch. |
relayer.delegation_overhead_gas | Extra gas budget when the relay first delegates an account. |
relayer.max_relay_gas | Upper limit on the gas budget for a relay batch. |
relayer.webauthn_verify_gas | Extra gas budget for on-chain passkey verification. |
relayer.delegate_gas_limit | Gas limit for a delegation transaction that runs no calls. |
relayer.relying_party_id | WebAuthn relying party ID. Use the domain that the passkey belongs to. |
relayer.allowed_origins | Browser origins that can send WebAuthn assertions. Include the scheme and any non-default port. |
Safe and Pretium
| Setting | What it controls |
|---|---|
safe.multisend_call_only | Approved Safe MultiSendCallOnly addresses. An empty list disables Safe execution through the relayer. |
safe.sts_base_url | Safe Transaction Service URL for this chain. An empty value disables the /safe proxy routes. |
safe.sts_api_key | Optional bearer token for the Safe Transaction Service. |
safe.auto_execute | Lets the master signer submit Safe proposals once enough owners sign. Requires a service URL and approved MultiSend addresses. |
pretium.base_url Deprecated | URL of the Pretium service. Leave it empty to disable the integration. |
Credit router
The router uses cached pool data to find routes. A quote reads the pools at a fixed block.
| Setting | What it controls |
|---|---|
router.enabled | Turns on credit routing. |
router.max_hops | Maximum number of pool swaps in a route. The default is three. The limit is five. |
router.max_routes_per_page | Maximum number of routes in one discovery result page. |
router.reload_interval_secs | Seconds between graph reloads from PostgreSQL. |
router.structure_reconcile_interval_secs | Seconds between checks for changes to pool structure on chain. |
router.params_refresh_interval_secs | Seconds between chain reads for pool settings. |
router.balance_sweep_interval_secs | Seconds between chain reads for pool balances. |
router.pair_fee_sweep_interval_secs | Seconds between chain reads for pair-specific fees. |
router.dirty_debounce_ms | Milliseconds to wait before refreshing pools marked as changed. |
router.stale_after_blocks | How far chain data can fall behind before the router marks it stale. |
router.quote_deadline_secs | Seconds from quote creation to its swap deadline. |
router.max_search_evaluations | Maximum number of evaluations for one input or output search. |
router.tie_margin_ppm | Output difference within which two routes count as tied. 5000 means 0.5%. Zero compares outputs exactly. |
router.max_route_candidates | Maximum number of routes the router fully checks per input voucher. |
router.holdings_cache_secs | Seconds to cache the list of vouchers a wallet holds. |
router.chain_batch_size | Maximum number of chain reads in one RPC batch. |
router.relay_deadline_horizon_secs | How far in the future the relayer accepts a swap deadline, in seconds. |
router.plain_erc20 | External tokens that transfer the stated amount and do not rebase. Add only tokens you verified. |
Startup flags
| Flag | Default | What it controls |
|---|---|---|
-config | config.toml | Path to the TOML config file. |
-migrations | migrations/ | Directory of PostgreSQL migrations. |
-queries | core_queries.sql | SQL file for the main database. |
-federation-queries | federated_queries.sql | SQL file for federation reads. |
Logs and metrics
Keep DEBUG and DEV unset in production. Both print the full configuration, which can contain secrets.
| Environment variable | What it controls |
|---|---|
DEBUG | Enables debug logs when set to a non-empty value. |
DEV | Enables debug logs and human-readable output when set to a non-empty value. |
LOG_FORMAT | Set to json to write logs as JSON. |
OTEL_EXPORTER_OTLP_ENDPOINT | Collector URL for logs and metrics over OTLP/HTTP. |
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | Optional collector URL for logs. This also enables telemetry. |
OTEL_METRIC_EXPORT_INTERVAL | Milliseconds between metric exports. The default is five minutes. |
OTEL_SERVICE_NAME | Service name in telemetry records. |
OTEL_RESOURCE_ATTRIBUTES | Labels such as the deployment environment. |