Skip to content

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 ​

SettingWhat it controls
api.addressAddress and port for the HTTP server. The example listens on port 5003.
api.prodSets secure session cookies with SameSite=None when true. Use HTTPS in production.
api.corsBrowser origins that can call the API. Include the scheme and any non-default port.
api.trust_proxyUses the forwarded client IP for public market rate limits. Enable it only when all traffic passes through a trusted proxy.
api.private_keyEd25519 private key in PEM format for JWT signing. The service derives the verification key from it. Use your own key in production.
api.public_keyPublic PEM field in the example file. The current server derives this key from api.private_key.

Databases, workers, and events ​

SettingWhat it controls
postgres.dsnConnection string for the main PostgreSQL database. It holds service data, jobs, and the master signer key.
federation.dsnConnection string for indexed data, such as account balances and transfers. Leave it empty to disable federation.
workers.maxMaximum concurrent workers. Zero or an unset value uses twice the CPU count.
jetstream.endpointsNATS server URLs for event publishing and consumption.
jetstream.idDurable consumer ID. Keep it stable across restarts to retain the consumer's position.
jetstream.persist_duration_hrsHow many hours the service keeps events in the streams it publishes to.
jetstream.skip_backlogDrops 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.

SettingWhat it controls
chain.idChain ID used to sign transactions and select chain events.
chain.rpc_endpointRPC URL for chain reads and transaction submission.
chain.divvi_consumerDivvi consumer address passed to the chain client for attribution.
chain.ge_registryRegistry address used to find the account index. If the service cannot resolve the index, it disables on-chain account registration.
chain.min_fee_cap_weiMinimum gas fee cap in wei per gas.

Relayer and passkeys ​

SettingWhat it controls
relayer.calibur_addressCalibur implementation address on the configured chain.
relayer.per_call_gasGas budget for each call in a relayed batch.
relayer.base_exec_gasFixed gas budget added to each relay batch.
relayer.delegation_overhead_gasExtra gas budget when the relay first delegates an account.
relayer.max_relay_gasUpper limit on the gas budget for a relay batch.
relayer.webauthn_verify_gasExtra gas budget for on-chain passkey verification.
relayer.delegate_gas_limitGas limit for a delegation transaction that runs no calls.
relayer.relying_party_idWebAuthn relying party ID. Use the domain that the passkey belongs to.
relayer.allowed_originsBrowser origins that can send WebAuthn assertions. Include the scheme and any non-default port.

Safe and Pretium ​

SettingWhat it controls
safe.multisend_call_onlyApproved Safe MultiSendCallOnly addresses. An empty list disables Safe execution through the relayer.
safe.sts_base_urlSafe Transaction Service URL for this chain. An empty value disables the /safe proxy routes.
safe.sts_api_keyOptional bearer token for the Safe Transaction Service.
safe.auto_executeLets the master signer submit Safe proposals once enough owners sign. Requires a service URL and approved MultiSend addresses.
pretium.base_url DeprecatedURL 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.

SettingWhat it controls
router.enabledTurns on credit routing.
router.max_hopsMaximum number of pool swaps in a route. The default is three. The limit is five.
router.max_routes_per_pageMaximum number of routes in one discovery result page.
router.reload_interval_secsSeconds between graph reloads from PostgreSQL.
router.structure_reconcile_interval_secsSeconds between checks for changes to pool structure on chain.
router.params_refresh_interval_secsSeconds between chain reads for pool settings.
router.balance_sweep_interval_secsSeconds between chain reads for pool balances.
router.pair_fee_sweep_interval_secsSeconds between chain reads for pair-specific fees.
router.dirty_debounce_msMilliseconds to wait before refreshing pools marked as changed.
router.stale_after_blocksHow far chain data can fall behind before the router marks it stale.
router.quote_deadline_secsSeconds from quote creation to its swap deadline.
router.max_search_evaluationsMaximum number of evaluations for one input or output search.
router.tie_margin_ppmOutput difference within which two routes count as tied. 5000 means 0.5%. Zero compares outputs exactly.
router.max_route_candidatesMaximum number of routes the router fully checks per input voucher.
router.holdings_cache_secsSeconds to cache the list of vouchers a wallet holds.
router.chain_batch_sizeMaximum number of chain reads in one RPC batch.
router.relay_deadline_horizon_secsHow far in the future the relayer accepts a swap deadline, in seconds.
router.plain_erc20External tokens that transfer the stated amount and do not rebase. Add only tokens you verified.

Startup flags ​

FlagDefaultWhat it controls
-configconfig.tomlPath to the TOML config file.
-migrationsmigrations/Directory of PostgreSQL migrations.
-queriescore_queries.sqlSQL file for the main database.
-federation-queriesfederated_queries.sqlSQL file for federation reads.

Logs and metrics ​

Keep DEBUG and DEV unset in production. Both print the full configuration, which can contain secrets.

Environment variableWhat it controls
DEBUGEnables debug logs when set to a non-empty value.
DEVEnables debug logs and human-readable output when set to a non-empty value.
LOG_FORMATSet to json to write logs as JSON.
OTEL_EXPORTER_OTLP_ENDPOINTCollector URL for logs and metrics over OTLP/HTTP.
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOptional collector URL for logs. This also enables telemetry.
OTEL_METRIC_EXPORT_INTERVALMilliseconds between metric exports. The default is five minutes.
OTEL_SERVICE_NAMEService name in telemetry records.
OTEL_RESOURCE_ATTRIBUTESLabels such as the deployment environment.

OpenTelemetry setup