Skip to main content

Configuration

Default configuration is defined in config/default.toml. SwissKnife supports toml, yaml and json config files. The order of applied configuration is the following:

  1. ENV vars. Defined given the names of the config values in default.toml, adding the prefix SWISSKNIFE. Overriding all sensitive values with ENV vars is recommended. For example, SWISSKNIFE_DATABASE__URL will override the database.url value in the config (nested keys are separated with double underscores).
  2. any file under config corresponding to the RUN_MODE (development by default). Such as development.toml|yaml|json or production.toml|yaml|json.
  3. The default.toml|yaml|json file.

Inspect the .env.example file for and generate your own .env for sensitive config values.

On Kubernetes, you can use a ConfigMap to inject the configuration into the container and secrets for sensitive values.

Configuration values​

App​

Config values for the application's business logic. To be placed at the root.

Config ValueDescription
invoice_expiryExpiry time for generated invoices
domainApplication's domain
hostAPI host URL
bitcoin_address_typeOn-chain Bitcoin address script type (p2pkh, p2sh, p2wpkh, p2tr; default p2wpkh)
ln_providerLiquidity provider for Lightning and on-chain Bitcoin
auth_providerAuthentication provider
dashboard_dirFilesystem path to the bundled dashboard static assets

Web server​

Config values for the web server. To be placed under web.

Config ValueDescription
web.addrWeb server bind address and port
web.request_timeoutRequest timeout duration

Core Lightning provider (gRPC)​

Config values for Core Lightning provider using gRPC. To be placed under cln_grpc_config.

Config ValueDescription
cln_grpc_config.endpointgRPC endpoint for Core Lightning
cln_grpc_config.certs_dirDirectory for Core Lightning certificates
cln_grpc_config.maxfeeOptional absolute routing fee cap in msat; unset uses max(1%, 5000 msat)
cln_grpc_config.payment_timeoutPayment timeout duration

Core Lightning provider (REST)​

Config values for Core Lightning provider using REST. To be placed under cln_rest_config. Numeraire SwissKnife uses runes and the websocket server to sync events from the node.

Config ValueDescription
cln_rest_config.endpointREST endpoint for Core Lightning
cln_rest_config.ca_cert_pathFile path to the TLS CA certificate (optional; needed when connecting over HTTPS)
cln_rest_config.runeRune value for Core Lightning
cln_rest_config.connect_timeoutConnection timeout duration
cln_rest_config.timeoutRequest timeout duration
cln_rest_config.connection_verboseEnable verbose connection logging
cln_rest_config.accept_invalid_certsAccept invalid certificates
cln_rest_config.accept_invalid_hostnamesAccept invalid hostnames
cln_rest_config.maxfeeOptional absolute routing fee cap in msat; unset uses max(1%, 5000 msat)
cln_rest_config.payment_timeoutPayment timeout duration
tip

Use an ENV var for SWISSKNIFE_CLN_REST_CONFIG__RUNE, as that value is highly sensitive.

LND provider (gRPC)​

Config values for LND provider using gRPC. To be placed under lnd_grpc_config.

Config ValueDescription
lnd_grpc_config.endpointgRPC endpoint for LND
lnd_grpc_config.cert_pathFile path to the TLS certificate
lnd_grpc_config.macaroon_pathFile path to the admin macaroon
lnd_grpc_config.fee_limit_msatMaximum fee limit in millisatoshis for payments
lnd_grpc_config.payment_timeoutPayment timeout duration
lnd_grpc_config.reorg_buffer_blocksNumber of blocks to rewind the synchronization cursor when replaying node transactions (reorg safety)

LND provider (REST)​

Config values for LND provider using REST. To be placed under lnd_rest_config.

Config ValueDescription
lnd_rest_config.hostHost and port for LND REST API
lnd_rest_config.macaroon_pathFile path to the admin macaroon
lnd_rest_config.ca_cert_pathFile path to the TLS certificate (optional; needed when connecting over HTTPS)
lnd_rest_config.connect_timeoutConnection timeout duration
lnd_rest_config.timeoutRequest timeout duration
lnd_rest_config.connection_verboseEnable verbose connection logging
lnd_rest_config.accept_invalid_certsAccept invalid certificates
lnd_rest_config.accept_invalid_hostnamesAccept invalid hostnames
lnd_rest_config.payment_timeoutPayment timeout duration
lnd_rest_config.fee_limit_msatMaximum fee limit in millisatoshis for payments
lnd_rest_config.reorg_buffer_blocksNumber of blocks to rewind the synchronization cursor when replaying node transactions (reorg safety)

Client settlement events​

Config valueDescription
client_events.retentionMinimum replay retention; default 30d, 0s disables pruning
client_events.cleanup_intervalPruning interval; default 1h, 0s disables the worker

Default settings already enable the authenticated stream at /v1/me/events; no additional setup is required. These retention settings are optional. Configure reverse proxies for streaming responses without buffering. See Events for subscription and replay behavior.

Logging​

Config values for logging. To be placed under logging.

Config ValueDescription
logging.formatFormat of log output
logging.ansiEnable ANSI colors in logs
logging.line_numberInclude line numbers in logs
logging.thread_idsInclude thread IDs in logs
logging.thread_namesInclude thread names in logs
logging.levelLogging level
logging.filterLogging filter rules
logging.fileOutput logs to file

Authentication​

Config values for authentication. To be placed under oauth2 or jwt depending on the choice of authentication. Numeraire SwissKnife supports OAuth2 and JWT authentication.

Config ValueDescription
oauth2.domainOpenID provider issuer base URL (e.g. auth.numeraire.tech)
oauth2.audienceOAuth2 audience
oauth2.jwks_refresh_intervalJWKS refresh interval
oauth2.leewayLeeway time for token validation
jwt.token_expiryJWT token expiry time
jwt.secretSecret key for JWT authentication
note

With the jwt provider, the admin credential is not set in the configuration file. The single initial Admin account's password is established on first launch via the sign-up flow and stored hashed in the database. Only jwt.secret (and optionally jwt.token_expiry) are configured here.

tip

Use an ENV var for SWISSKNIFE_JWT__SECRET, as this value is highly sensitive.

Database​

Config values for the database connection. To be placed under database.

Config ValueDescription
database.urlDatabase connection string (required; PostgreSQL or SQLite)
database.max_lifetimeMaximum connection lifetime
database.idle_timeoutIdle timeout duration
database.max_connectionsMaximum number of connections
database.min_connectionsMinimum number of connections
database.acquire_timeoutTimeout for acquiring a connection
database.connect_timeoutTimeout for establishing a connection
database.sqlx_loggingEnable SQLx logging
database.busy_timeoutSQLite-only: how long a writer waits for the lock before failing (ignored for Postgres)
tip

Use an ENV var for the SWISSKNIFE_DATABASE__URL.