Skip to main content
arkd is configured via environment variables. This page documents settings that affect runtime behavior, gRPC transport, and API performance.
All variables can be passed as environment variables or written to an .env file in the arkd data directory.

gRPC Transport

MAX_CONCURRENT_STREAMS

Controls the maximum number of concurrent HTTP/2 streams allowed per gRPC connection.
KeyDefaultType
MAX_CONCURRENT_STREAMS1000uint32
When to tune this:
  • High-traffic operators serving many simultaneous clients should increase this value.
  • Setting it to 0 is invalid and will prevent arkd from starting (validation error at boot).
MAX_CONCURRENT_STREAMS=2000
As of arkd PR #978, both the secure and insecure gRPC listeners respect this setting. Prior to this change, the HTTP/2 server used the Go default.

Split Unary vs. Streaming Connections

arkd internally routes unary RPCs and server-side streaming RPCs through separate gRPC transports. This is an implementation detail — no configuration is required — but it has observable effects:
  • Health checks use the unary transport. They remain responsive even when streaming connections experience backpressure or reconnects.
  • GetEventStream / GetTransactionsStream use the streaming transport with jittered reconnect backoff.
  • The admin service (wallet operations, config updates) runs on a dedicated gateway separate from the public client endpoints.
This separation improves reliability under load and makes liveness reporting more accurate. See arkd PR #979.

GetInfo Caching

GetInfo responses are now cached in memory at startup to reduce database load on high-frequency calls.

Cache behavior

TriggerEffect
arkd startupCache is warmed from the database
Admin RPC updates session configCache is automatically invalidated and reloaded
Admin RPC updates intent fee formulasCache is automatically invalidated and reloaded
Manual RefreshInfoCache admin actionForce-refreshes the cache
What is cached:
  • Dust amounts and min/max UTXO/VTXO amounts
  • Scheduled session configuration (round intervals, expiry delays)
  • Fee formula parameters
  • Server signer public key and network type
  • Market hours configuration
What is NOT cached:
  • Real-time VTXO states and balances (always queried live)
  • Transaction history
If you update server configuration outside of the standard admin RPCs (e.g., by directly modifying the database), call RefreshInfoCache via the admin API to ensure GetInfo returns up-to-date values.
See arkd PR #976.

Other Notable Environment Variables

For reference, the full list of environment variables is defined in internal/config/config.go. Key variables include:
VariablePurpose
ARK_NETWORKBitcoin network (mainnet, testnet3, signet, mutinynet, regtest)
ROUND_INTERVALSeconds between batch rounds
UNILATERAL_EXIT_DELAYCSV delay for unilateral exits (in seconds)
VTXO_NO_CSV_VALIDATION_CUTOFF_DATEUnix timestamp cutoff for skipping CSV validation on old VTXOs
ENABLE_PPROFEnable Go pprof profiling endpoint (default: false)
MAX_CONCURRENT_STREAMSgRPC max concurrent HTTP/2 streams (default: 1000)