Skip to content
Rafiki
GitHub

Deployment

The production environment consists of

  • backend
  • auth
  • (optional but recommended) frontend

and the databases

  • TigerBeetle or Postgres (accounting)
  • Postgres (Open Payments resources, auth resources)
  • Redis (STREAM details)

To integrate Rafiki with your own services, view the integration documentation.

Running the production environment

Dependencies:

Rafiki cannot be run by itself but needs at least a Postgres and a Redis instance running with it. If you prefer to use Tigerbeetle instead of Postgres for accounting, a Tigerbeetle instance is required as well.

An example Chart including Rafiki, Postgres, and Redis can be found here.

To install this chart, run

helm install rafiki PATH_TO_RAFIKI_REPO/infrastructure/helm/rafiki

In this alpha version, by default, no ports are exposed. You can port-forward the frontend (Admin UI) port by running

// get list of pod names
kubectl get pods

// port forward
kubectl port-forward rafiki-rafiki-frontend-YOUR-SEQUENCE 3010:3010

Now, the Admin UI can be found on localhost:3010.

❗ Update at least the values.yaml file before running the example Chart in production.

values.yaml Parameters

NameCorresponding Environment Variable or Description
auth.postgresql.hostPostgres host
auth.postgresql.portPostgres port
auth.postgresql.usernamePostgres user name
auth.postgresql.databasePostgres database name
auth.postgresql.passwordPostgres user password
auth.port.adminADMIN_PORT
auth.port.authAUTH_PORT
auth.port.introspectionINTROSPECTION_PORT
auth.identityServer.domainIDENTITY_SERVER_DOMAIN
auth.identityServer.secretIDENTITY_SERVER_SECRET
auth.interaction.incomingPaymentINCOMING_PAYMENT_INTERACTION
auth.interaction.quoteQUOTE_INTERACTION
auth.grant.waitSecondsWAIT_SECONDS
auth.accessToken.deletionDaysACCESS_TOKEN_DELETION_DAYS
auth.accessToken.expirySecondsACCESS_TOKEN_EXPIRY_SECONDS
auth.cookieKeyCOOKIE_KEY
auth.interactionExpirySecondsINTERACTION_EXPIRY_SECONDS
auth.workers.cleanupDATABASE_CLEANUP_WORKERS
backend.nodeEnvNODE_ENV
backend.logLevelLOG_LEVEL
backend.serviceUrls.PUBLIC_HOSTPUBLIC_HOST
backend.serviceUrls.OPEN_PAYMENTS_URLOPEN_PAYMENTS_URL
backend.serviceUrls.PAYMENT_POINTER_URLPAYMENT_POINTER_URL
backend.serviceUrls.WEBHOOK_URLWEBHOOK_URL
backend.serviceUrls.EXCHANGE_RATES_URLEXCHANGE_RATES_URL
backend.redis.hostRedis host
backend.redis.portRedis port
backend.redis.tlsCaFileREDIS_TLS_CA_FILE_PATH
backend.redis.tlsCertFileREDIS_TLS_CERT_FILE_PATH
backend.redis.tlsKeyFileREDIS_TLS_KEY_FILE_PATH
backend.postgresql.hostPostgres host
backend.postgresql.portPostgres port
backend.postgresql.usernamePostgres user name
backend.postgresql.databasePostgres database name
backend.postgresql.passwordPostgres user password
backend.port.adminADMIN_PORT
backend.port.connectorCONNECTOR_PORT
backend.port.openPaymentsOPEN_PAYMENTS_PORT
backend.ilp.addressILP_ADDRESS
backend.ilp.streamSecretSTREAM_SECRET
backend.ilp.slippageSLIPPAGE
backend.key.idKEY_ID
backend.key.filePRIVATE_KEY_FILE
backend.quoteSignatureSecretSIGNATURE_SECRET
backend.withdrawalThrottleDelayWITHDRAWAL_THROTTLE_DELAY
backend.lifetime.exchangeRateEXCHANGE_RATES_LIFETIME
backend.lifetime.quoteQUOTE_LIFESPAN
backend.lifetime.webhookWEBHOOK_TIMEOUT
backend.workers.incomingPaymentINCOMING_PAYMENT_WORKERS
backend.workers.outgoingPaymentOUTGOING_PAYMENT_WORKERS
backend.workers.paymentPointerPAYMENT_POINTER_WORKERS
backend.workers.webhookWEBHOOK_WORKERS
backend.workerIdleworker idle time in milliseconds
backend.idempotencyTTLGRAPHQL_IDEMPOTENCY_KEY_TTL_MS
frontend.portPORT
frontend.serviceUrls.GRAPHQL_URLGRAPHQL_URL
frontend.serviceUrls.OPEN_PAYMENTS_URLOPEN_PAYMENTS_URL

Environment Variables

Backend

VariableDefaultDescription
ADMIN_PORT3001GraphQL Server port
AUTH_SERVER_GRANT_URLhttp://127.0.0.1:3006endpoint to on the Open Payments Auth Server to request a grant
AUTH_SERVER_INTROSPECTION_URLhttp://127.0.0.1:3007endpoint to on the Open Payments Auth Server to introspect an auth token
AUTO_PEERING_SERVER_PORT3005Port for the auto-peering server
CONNECTOR_PORT3002STREAM/ILP connector port
DATABASE_URLpostgresql://postgres:password@localhost:5432/developmentPostgres database URL
ENABLE_AUTO_PEERINGfalseFlag to enable auto peering. View documentation.
EXCHANGE_RATES_LIFETIME15_000milliseconds
EXCHANGE_RATES_URLundefinedendpoint on the Account Servicing Entity to request receiver fees
GRAPHQL_IDEMPOTENCY_KEY_TTL_MS86400000TTL for idempotencyKey on GraphQL mutations (Admin API). Default: 24hrs
GRAPHQL_IDEMPOTENCY_KEY_LOCK_MS2000TTL for idempotencyKey concurrency lock on GraphQL mutations (Admin API)
ILP_ADDRESStest.rafikiILP address of this Rafiki instance
ILP_CONNECTOR_ADDRESShttp://127.0.0.1:3002The ILP connector address where ILP packets are received. Communicated during auto-peering
INCOMING_PAYMENT_EXPIRY_MAX_MS2592000000Maximum milliseconds into the future incoming payments expiry can be set to on creation. Default: 30 days
INCOMING_PAYMENT_WORKERS1number of workers processing incoming payment requests
INCOMING_PAYMENT_WORKER_IDLE200milliseconds
INSTANCE_NAMERafikiUsed to communicate the wallet/Rafiki name for auto-peering
KEY_IDrafikiRafiki instance client key id
LOG_LEVELinfoPino Log Level
NODE_ENVdevelopmentnode environment, development, test, or production
OPEN_PAYMENTS_PORT3003Open Payments APIs port
OPEN_PAYMENTS_URLhttp://127.0.0.1:3003Open Payments APIs base URL
OUTGOING_PAYMENT_WORKERS4number of workers processing outgoing payment requests
OUTGOING_PAYMENT_WORKER_IDLE200milliseconds
PAYMENT_POINTER_URLhttp://127.0.0.1:3001/.well-known/payRafiki instance internal payment pointer
PAYMENT_POINTER_WORKERS1number of workers processing payment pointer requests
PAYMENT_POINTER_WORKER_IDLE200milliseconds
PAYMENT_POINTER_DEACTIVATION_PAYMENT_GRACE_PERIOD_MS86400000Milliseconds into the future to set expiration of open incoming payments when deactivating payment pointer. Default: 1 days
PAYMENT_POINTER_LOOKUP_TIMEOUT_MS1500milliseconds the ASE has to create a missing payment pointer until timeout
PAYMENT_POINTER_POLLING_FREQUENCY_MS100frequency of polling while waiting for ASE to create a missing payment pointer
PRIVATE_KEY_FILEundefinedRafiki instance client private key
PUBLIC_HOSThttp://127.0.0.1:3001(testing) public Host for Open Payments APIs
QUOTE_LIFESPAN5 * 60_000milliseconds
REDIS_TLS_CA_FILE_PATH''Redis TLS info
REDIS_TLS_CERT_FILE_PATH''Redis TLS info
REDIS_TLS_KEY_FILE_PATH''Redis TLS info
REDIS_URLredis://127.0.0.1:6379Redis database URL
SIGNATURE_SECRETundefinedto generate quote signatures
SIGNATURE_VERSION1to generate quote signatures
SLIPPAGE0.01accepted quote fluctuation, default 1%
STREAM_SECRET32 random bytesseed secret to generate connection secrets
TIGERBEETLE_CLUSTER_ID0TigerBeetle cluster id
TIGERBEETLE_REPLICA_ADDRESSES3004comma separated IP addresses/ports
USE_TIGERBEETLEfalseflag - use TigerBeetle or Postgres for accounting
WEBHOOK_TIMEOUT2000milliseconds
WEBHOOK_URLhttp://127.0.0.1:4001/webhookendpoint on the Account Servicing Entity that consumes webhook events
WEBHOOK_WORKERS1number of workers processing webhook requests
WEBHOOK_WORKER_IDLE200milliseconds
WITHDRAWAL_THROTTLE_DELAYundefineddelay in withdrawal processing

Auth

VariableDefaultDescription
ACCESS_TOKEN_DELETION_DAYS30days until expired or revoked access tokens are deleted
ACCESS_TOKEN_EXPIRY_SECONDS10 * 60expiry time for access tokens (default: 10 minutes)
ADMIN_PORT3003GraphQL Server port
AUTH_DATABASE_URLpostgresql://postgres:password@localhost:5432/auth_developmentPostgres database URL
AUTH_PORT3006port of this Open Payments Auth Server
AUTH_SERVER_DOMAINhttp://localhost:3006endpoint of this Open Payments Auth Server
COOKIE_KEY32 random bytessigned cookie key
DATABASE_CLEANUP_WORKERS1number of workers processing expired or revoked access tokens
IDENTITY_SERVER_DOMAINhttp://localhost:3030/mock-idp/endpoint of the identity server controlled by the Account Servicing Entity
IDENTITY_SERVER_SECRETreplace-meAPI key
INCOMING_PAYMENT_INTERACTIONfalseflag - incoming payments grants are interactive or not
QUOTE_INTERACTIONfalseflag - quote grants are interactive or not
INTROSPECTION_PORT3007port of this Open Payments Auth - Token Introspection Server
LOG_LEVELinfoPino Log Level
NODE_ENVdevelopmentnode environment, development, test, or production
PORT3006port of this Open Payments Auth Server, same as in AUTH_SERVER_DOMAIN
WAIT_SECONDS5wait time included in grant.continue
INTERACTION_EXPIRY_SECONDS600amount of time an interaction is active

Frontend

VariableDefaultDescription
GRAPHQL_URLhttp://localhost:3001/graphqlURL for the GraphQL Admin API
OPEN_PAYMENTS_URLhttp://localhost:3003/Open Payments API Endpoint
PORT3005Port from which to host the Remix app