Skip to content
GitHub

Environment variables

Environment variables are key value pairs used to configure how your Rafiki instance will run within your infrastructure and integrate with your systems. Some environment variables are configured globally for the entire instance, while others can be configured to allow customized settings for each tenant.

Each environment variable name is uppercase, followed by an equal sign and the value of the variable.

Environment variable example
WEBHOOKS_URL=http://my-business/webhooks

The environment variable in the preceding example specifies the HTTP endpoint at which you want your Rafiki instance to send you notifications of webhook events.

To run Rafiki you must set the environment variables for the backend, auth and frontend services where listed as required below.

Required

VariableHelm value nameDefaultDescription
ADMIN_API_SECRETundefinedundefinedOperator API secret used to sign Backend Admin API requests (HMAC SHA‑256). Set to a strong, random value. Synced to the operator tenant on startup.
AUTH_SERVICE_API_URLundefinedundefinedThe service-to-service API endpoint for propagating tenant information changes to the auth server.
AUTH_SERVER_GRANT_URLconfig.backend.auth.grantUrlundefinedThe endpoint on your Open Payments authorization server to grant a request.
AUTH_SERVER_GRANT_URLconfig.backend.auth.grantUrlundefinedThe endpoint on your Open Payments authorization server to grant a request.
AUTH_SERVER_INTROSPECTION_URLconfig.backend.auth.introspectionUrlundefinedThe endpoint on your Open Payments authorization server to introspect an access token.
DATABASE_URLconfig.backend.databaseUrl.value or config.backend.databaseUrl.secretKeyRefpostgresql://postgres:password@localhost:5432/developmentThe Postgres database URL of the database storing your resource data. Can be provided as a value or secret reference.
EXCHANGE_RATES_URLconfig.backend.rates.urlundefinedThe default exchange rates endpoint. Used if a tenant-specific rates endpoint isn’t configured.
ILP_ADDRESSconfig.backend.ilp.addressundefinedThe ILP address of your Rafiki instance.
ILP_CONNECTOR_URLconfig.backend.ilp.connectorundefinedThe ILP connector address where ILP packets are received.
KEY_IDconfig.backend.key.idundefinedYour Rafiki instance’s client key ID.
OPEN_PAYMENTS_URLconfig.backend.ilp.hostundefinedThe public endpoint of your Open Payments resource server.
OPERATOR_TENANT_IDundefinedundefinedThe unique identifier of the operator. Must be a UUID v4 generated by the operator.
REDIS_URLconfig.backend.redisUrl.value or config.backend.redisUrl.secretKeyRefredis://127.0.0.1:6379The Redis URL of the database handling ILP packet data. Can be provided as a value or secret reference.
USE_TIGERBEETLEconfig.backend.useTigerbeetlefalseWhen true, a TigerBeetle database is used for accounting. When false, a Postgres database is used.
WEBHOOK_URLconfig.backend.webhook.urlundefinedThe default webhook endpoint. Used if a tenant-specific webhook URL isn’t configured.

Conditionally required

VariableHelm value nameDefaultDescription
INSTANCE_NAMEconfig.backend.instanceNameundefinedYour Rafiki instance’s name used to communicate for auto-peering and/or telemetry. Required when auto-peering and/or telemetry is enabled
TRUST_PROXYconfig.backend.trustProxyfalseMust be set to true when running Rafiki behind a proxy. When true, the X-Forwarded-Proto header is used to determine if connections are secure.

Optional

VariableHelm value nameDefaultDescription
ADMIN_PORTconfig.backend.port.admin3001The port of your Backend Admin API server.
ADMIN_API_SIGNATURE_TTL_SECONDSundefined30The TTL, in seconds, for which a Backend Admin API request signature is valid.
ADMIN_API_SIGNATURE_VERSIONundefined1The version of the HMAC SHA-256 request-signing algorithm used by the Backend Admin API.
AUTO_PEERING_SERVER_PORTconfig.backend.port.autoPeering3005If auto-peering is enabled, the server will use this port.
CONNECTOR_PORTconfig.backend.port.connector3002The port of the ILP connector for sending packets via ILP over HTTP.
ENABLE_AUTO_PEERINGconfig.backend.autoPeering.enabledfalseWhen true, auto-peering is enabled.
ENABLE_MANUAL_MIGRATIONSundefinedfalseWhen true, you must run the database manually with the command npm run knex – migrate:latest –env production
ENABLE_SPSP_PAYMENT_POINTERSundefinedtrueWhen true, the SPSP route is enabled.
ENABLE_TELEMETRYconfig.backend.telemetry.enabledfalseEnables the telemetry service on Rafiki.
ENABLE_TELEMETRY_TRACESundefinedfalseN/A
EXCHANGE_RATES_LIFETIMEundefined15000The time, in milliseconds, the exchange rates you provide via the EXCHANGE_RATES_URL are valid.
GRAPHQL_IDEMPOTENCY_KEY_LOCK_MSundefined2000The time to live (TTL), in milliseconds, for idempotencyKey concurrency lock on GraphQL mutations on the Backend Admin API.
GRAPHQL_IDEMPOTENCY_KEY_TTL_MSundefined86400000 (24 hours)The time to live (TTL), in milliseconds, for idempotencyKey on GraphQL mutations on the Backend Admin API.
INCOMING_PAYMENT_CREATED_POLL_FREQUENCY_MSundefined1000N/A
INCOMING_PAYMENT_CREATED_POLL_TIMEOUT_MSundefined10000N/A
INCOMING_PAYMENT_EXPIRY_MAX_MSundefined2592000000 (30 days)The maximum into the future, in milliseconds, incoming payments expiry can be set to on creation.
INCOMING_PAYMENT_WORKER_IDLEundefined200The time, in milliseconds, that INCOMING_PAYMENT_WORKERS will wait until checking an empty incoming payment request queue again.
INCOMING_PAYMENT_WORKERSundefined1The number of workers processing incoming payment requests.
LOG_LEVELconfig.backend.logLevelinfoPino log level
LIVENETconfig.backend.telemetry.livenetfalseWhen true, enables livenet mode for production deployments.
MAX_OUTGOING_PAYMENT_RETRY_ATTEMPTSundefined5Specifies how many times an outgoing payment is retried before failing completely.
NODE_ENVconfig.backend.nodeEnvdevelopmentThe type of node environment: development, test, or production.
OPEN_PAYMENTS_PORTconfig.backend.port.openPayments3000The port of your Open Payments resource server.
OPEN_TELEMETRY_COLLECTOR_URLSundefined*undefinedN/A
OPEN_TELEMETRY_EXPORT_INTERVALundefined15000N/A
OPEN_TELEMETRY_TRACE_COLLECTOR_URLSundefinedundefinedN/A
OUTGOING_PAYMENT_WORKER_IDLEundefined10The time, in milliseconds, that OUTGOING_PAYMENT_WORKERS wait until they check an empty outgoing payment request queue again.
OUTGOING_PAYMENT_WORKERSundefined1The number of workers processing outgoing payment requests.
POLL_INCOMING_PAYMENT_CREATED_WEBHOOKundefinedfalseN/A
QUOTE_LIFESPANundefined300000 (5 minutes)The time, in milliseconds, an Open Payments quote is valid for.
REDIS_TLS_CA_FILE_PATHundefined''Redis TLS config
REDIS_TLS_CERT_FILE_PATHundefined''Redis TLS config
REDIS_TLS_KEY_FILE_PATHundefined''Redis TLS config
SEND_TENANT_WEBHOOKS_TO_OPERATORundefinedfalseWhen true, webhook events for non-operator tenants are also sent to the operator. This allows the operator to monitor and manage events across all tenants.
SIGNATURE_SECRETconfig.backend.webhookSignatureSecret.value or config.backend.webhookSignatureSecret.secretKeyRefundefinedThe secret to generate request header signatures for webhook event requests.
SIGNATURE_VERSIONundefined1The version number to generate request header signatures for webhook events.
SLIPPAGEconfig.backend.slippage0.01 (1%)The accepted ILP rate fluctuation.
TELEMETRY_EXCHANGE_RATES_LIFETIMEundefined86400000 (24 hours)Lifetime for telemetry exchange rates in milliseconds.
TELEMETRY_EXCHANGE_RATES_URLundefinedhttps://telemetry-exchange-rates.s3.amazonaws.com/exchange-rates-usd.jsonThe endpoint Rafiki will query for exchange rates. Used as a fallback if/when exchange rates aren’t provided.
TIGERBEETLE_CLUSTER_IDundefined0The TigerBeetle cluster ID picked by the system that starts the TigerBeetle cluster to create a TigerBeetle client.
TIGERBEETLE_REPLICA_ADDRESSESundefined3004TigerBeetle replica addresses for all replicas in the cluster. The addresses are comma-separated IP addresses/ports, to create a TigerBeetle client.
TIGERBEETLE_TWO_PHASE_TIMEOUT_SECONDSundefined5Two-phase timeout for TigerBeetle in seconds.
WALLET_ADDRESS_DEACTIVATION_PAYMENT_GRACE_PERIOD_MSundefined86400000 (24 hours)The time into the future, in milliseconds, to set expiration of Open Payments incoming payments when deactivating a wallet address.
WALLET_ADDRESS_LOOKUP_TIMEOUT_MSundefined1500The time, in milliseconds, you have to create a missing wallet address before timeout.
WALLET_ADDRESS_POLLING_FREQUENCY_MSundefined100The frequency of polling while waiting for you to create a missing wallet address.
WALLET_ADDRESS_REDIRECT_HTML_PAGEconfig.backend.walletAddressRedirectHtmlPageundefinedCustom HTML page for wallet address redirects.
WALLET_ADDRESS_URLconfig.backend.ilp.hosthttp://127.0.0.1:3001/.well-known/payInternal base wallet address URL used by the backend service. Each tenant’s wallet address base is configured via settings and cannot be updated once set; this variable does not override tenant settings.
WALLET_ADDRESS_WORKER_IDLEundefined200The time, in milliseconds, that WALLET_ADDRESS_WORKERS wait until checking the empty wallet address request queue again.
WALLET_ADDRESS_WORKERSundefined1The number of workers processing wallet address requests.
WEBHOOK_MAX_RETRYundefined10The maximum number of times your Rafiki instance’s backend retries sending a certain webhook event to your configured WEBHOOK_URL.
WEBHOOK_TIMEOUTconfig.backend.webhook.timeout2000 (2 seconds)The time, in milliseconds, that your Rafiki instance will wait for a 200 response from your webhook endpoint. If a 200 response isn’t received, Rafiki will time out and try to send the webhook event again.
WEBHOOK_WORKER_IDLEundefined200The time, in milliseconds, that WEBHOOK_WORKERS will wait until they check the empty webhook event queue again.
WEBHOOK_WORKERSundefined1The number of workers processing webhook events.
WITHDRAWAL_THROTTLE_DELAYconfig.backend.withdrawalThrottleDelayundefinedThe delay in liquidity withdrawal processing, in milliseconds.

Required

VariableHelm value nameDefaultDescription
ADMIN_API_SECRETundefinedundefinedOperator API secret used to sign Auth Admin API requests (HMAC SHA‑256). Set to a strong, random value. Synced to the operator tenant on startup.
AUTH_DATABASE_URLconfig.auth.databaseUrl.value or config.auth.databaseUrl.secretKeyRefpostgresql://postgres:password@localhost:5432/auth_developmentThe URL of the Postgres database storing your Open Payments grant data. Can be provided as a value or secret reference.
AUTH_SERVER_URLconfig.auth.authServerUrlundefinedThe public endpoint for your Rafiki instance’s public Open Payments routes.
COOKIE_KEYconfig.auth.cookieKey.value or config.auth.cookieKey.secretKeyRefundefinedThe koa KeyGrip key that is used to sign cookies for an interaction session.
IDENTITY_SERVER_URLconfig.auth.identityServer.domainundefinedThe URL of your IdP’s server, used by the authorization server to inform an Open Payments client of where to redirect the end-user to start interactions.
IDENTITY_SERVER_SECRETconfig.auth.identityServer.serverSecret.value or config.auth.identityServer.serverSecret.secretKeyRefundefinedA shared secret between the authorization server and the IdP server; the authorization server will use the secret to secure its IdP-related endpoints.
When the IdP server sends requests to the authorization server, the IdP server must provide the secret via an x-idp-secret header.
OPERATOR_TENANT_IDundefinedundefinedThe unique identifier of the operator. Must be a UUID v4 generated by the operator.
REDIS_URLconfig.auth.redisUrl.value or config.auth.redisUrl.secretKeyRefredis://127.0.0.1:6379The connection URL for Redis. Can be provided as a value or secret reference.

Conditionally required

VariableHelm value nameDefaultDescription
TRUST_PROXYconfig.auth.trustProxyfalseMust be set to true when running Rafiki behind a proxy. When true, the X-Forwarded-Proto header is used to determine if connections are secure.

Optional

VariableHelm value nameDefaultDescription
ACCESS_TOKEN_DELETION_DAYSconfig.auth.accessToken.deletionDays30The days until expired and/or revoked access tokens are deleted.
ACCESS_TOKEN_EXPIRY_SECONDSconfig.auth.accessToken.expirySeconds600 (10 minutes)The expiry time, in seconds, for access tokens.
ADMIN_API_SIGNATURE_VERSIONundefined1The version of the HMAC SHA-256 request-signing algorithm used by the Auth Admin API.
ADMIN_API_SIGNATURE_TTL_SECONDSundefined30The TTL, in seconds, for which an Auth Admin API request signature is valid.
ADMIN_PORTconfig.auth.port.admin3003The port of your Rafiki Auth Admin API server.
AUTH_PORTconfig.auth.port.auth3006The port of your Open Payments authorization server.
DATABASE_CLEANUP_WORKERSconfig.auth.workers.cleanup1The number of workers processing expired or revoked access tokens.
ENABLE_MANUAL_MIGRATIONSundefinedfalseWhen true, you must run the auth Postgres database manually with the command npm run knex – migrate:latest –envproduction
INCOMING_PAYMENT_INTERACTIONconfig.auth.interaction.incomingPaymentfalseWhen true, incoming Open Payments grant requests are interactive
INTERACTION_EXPIRY_SECONDSundefined600 (10 minutes)The time, in seconds, for which a user can interact with a grant request before the request expires.
INTERACTION_PORTundefined3009The port number of your Open Payments interaction-related APIs.
INTROSPECTION_PORTconfig.auth.port.introspection3007The port of your Open Payments access token introspection server.
INTERACTION_COOKIE_SAME_SITEconfig.auth.interaction.cookieSameSiteundefinedThe SameSite attribute for interaction cookies. Valid values: lax, none.
LIST_ALL_ACCESS_INTERACTIONundefinedtrueWhen true, grant requests that include a list-all action will require interaction. In these requests, the client asks to list resources that it did not create.
LOG_LEVELconfig.auth.logLevelinfoPino log level
NODE_ENVconfig.auth.nodeEnvdevelopmentThe type of node environment: development, test, or production.
QUOTE_INTERACTIONconfig.auth.interaction.quotefalseWhen true, quote grants are interactive.
REDIS_TLS_CA_FILE_PATHundefined''Redis TLS config
REDIS_TLS_CERT_FILE_PATHundefined''Redis TLS config
REDIS_TLS_KEY_FILE_PATHundefined''Redis TLS config
SERVICE_API_PORTundefined3011The port to expose the internal service API for receiving tenant information changes.
WAIT_SECONDSconfig.auth.grant.waitSeconds5The wait time, in seconds, included in a grant request response (grant.continue).

Required

VariableHelm value nameDefaultDescription
GRAPHQL_URLconfig.frontend.serviceUrls.GRAPHQL_URLundefinedURL for Rafiki’s GraphQL Backend Admin API.
OPEN_PAYMENTS_URLconfig.frontend.serviceUrls.OPEN_PAYMENTS_URLundefinedYour Open Payments API endpoint.

Conditionally required

The following variables are required only when AUTH_ENABLED is set to true.

VariableHelm value nameDefaultDescription
KRATOS_ADMIN_URLundefinedundefinedThe admin endpoint/container address for Kratos.
KRATOS_BROWSER_PUBLIC_URLundefinedundefinedThe URL to access the Kratos Docker container from a browser outside the Docker network. This is used for calls from a browser (what you see in the Rafiki Admin UI) to the Kratos server on the backend.
KRATOS_CONTAINER_PUBLIC_URLundefinedundefinedThe URL to access the Kratos Docker container from in the Docker network. This is used for backend calls to Kratos.

Optional

VariableHelm value nameDefaultDescription
AUTH_ENABLEDconfig.frontend.kratos.enabledtrueWhen true, only authenticated users can be granted access to Rafiki Admin by an administrator.
ENABLE_INSECURE_MESSAGE_COOKIEundefinedundefinedWhen set to true, t, or 1, cookie will be transmitted over insecure HTTP connection. Insecure message cookies are required for flash messages to work over HTTP.
LOG_LEVELconfig.frontend.logLevelinfoPino log level.
NODE_ENVconfig.frontend.nodeEnvundefinedThe type of node environment: development, test, or production.
PORTconfig.frontend.port3010Port from which to host the Rafiki Remix app.
SIGNATURE_VERSIONundefinedundefinedThe signature version number used when HMAC-signing requests to the Backend Admin API (HMAC SHA-256).