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 (underscores are replaced 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
fee_bufferBuffer percentage for transaction fees
ln_providerLightning Network provider
auth_providerAuthentication provider

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

Breez Lightning provider​

Config values for Breez Lightning provider. To be placed under breez_config.

Config ValueDescription
breez_config.working_dirDirectory for Breez working files
breez_config.certs_dirDirectory for Breez certificates
breez_config.log_in_fileLog output to file
breez_config.restore_onlyRestore only mode
breez_config.api_keyAPI key for Breez
breez_config.seedSeed value for Breez

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.maxfeepercentMaximum fee percentage for payments
cln_grpc_config.payment_timeoutPayment timeout duration
cln_grpc_config.payment_exemptfeeExempt fee value for payments
cln_grpc_config.retry_delayDelay between retries

Core Lightning provider (REST)​

Config values for Core Lightning provider using REST. To be placed under cln_rest_config. Numeraire SwisskKnife 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.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.maxfeepercentMaximum fee percentage for payments
cln_rest_config.payment_timeoutPayment timeout duration
cln_rest_config.payment_exemptfeeExempt fee value for payments
cln_rest_config.ws_min_reconnect_delay_delayMinimum WebSocket reconnect delay
cln_rest_config.ws_max_reconnect_delay_delayMaximum WebSocket reconnect delay
tip

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

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.domainOAuth2 domain
oauth2.audienceOAuth2 audience
oauth2.jwks_refresh_intervalJWKS refresh interval
oauth2.leewayLeeway time for token validation
jwt.usernameUsername for JWT authentication
jwt.passwordPassword for JWT authentication
jwt.token_expiryJWT token expiry time
jwt.secretSecret key for JWT authentication
tip

Use ENV vars for SWISSKNIFE_JWT__SECRET and SWISSKNIFE_JWT__PASSWORD, as these values are highly sensitive.

Database​

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

Config ValueDescription
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
tip

Use an ENV var for the SWISSKNIFE_DATABASE__URL.