Skip to main content

Environment Variables

Use this page when you run your own relayer. For setup steps and deployment context, see Self-Hosting.

Environment variables documented here are public relayer contract items. Renaming, removing, or changing their meaning follows the deprecation process in Versioning and Compatibility.

Required

VariableNotes
DATABASE_URLPostgreSQL connection string. pgvector must already exist
MEMWAL_PACKAGE_IDSui package ID. See Contract Overview
MEMWAL_REGISTRY_IDOnchain registry object ID. See Contract Overview
SIDECAR_AUTH_TOKENShared secret for Rust-to-sidecar calls. The sidecar refuses to start without it

Usually required

These are not all enforced at boot, but most real deployments need them.

VariableNotes
SERVER_SUI_PRIVATE_KEYPrimary server key for backend decrypt and Walrus actions
OPENAI_API_KEYServer-side key used to call the embedding and fact-extraction provider

Optional

VariableDefaultNotes
PORT8000Relayer port
RUST_LOGmemwal_server=info,tower_http=infoRust tracing filter for relayer logs
LOG_FORMATpretty textSet to json for machine-parseable structured logs
ALERT_TO_SLACKnoneSlack incoming webhook URL. When set, the relayer posts an alert after a Walrus upload job exhausts all 5 wallet attempts without producing a blob
SIDECAR_URLhttp://localhost:9000Sidecar HTTP endpoint
SIDECAR_WATCHDOG_INTERVAL_SECS30Interval between relayer health checks against the local sidecar
SIDECAR_WATCHDOG_TIMEOUT_SECS2Timeout for each sidecar watchdog health check
SIDECAR_WATCHDOG_MAX_FAILURES6Consecutive failed sidecar health checks before the relayer exits so the platform restarts the container
OPENAI_API_BASEhttps://api.openai.com/v1OpenAI-compatible base URL
SUI_NETWORKmainnetPicks the fallback RPC URL and network-driven service defaults
SUI_RPC_URLnetwork defaultOverride the Sui fullnode URL
WALRUS_PUBLISHER_URLWalrus Mainnet publisherOverride upload endpoint
WALRUS_AGGREGATOR_URLWalrus Mainnet aggregatorOverride download endpoint
WALRUS_AGGREGATOR_URLSnoneOptional comma-separated extra aggregator/proxy endpoints for cold-read tail racing. WALRUS_AGGREGATOR_URL remains the primary
WALRUS_AGGREGATOR_RACE_AFTER_MS150Delay before launching the next configured aggregator on a cold read. 0 races all candidates immediately
WALRUS_SKIP_CONSISTENCY_CHECKfalseAppends skip_consistency_check=true to trusted Walrus Memory cold reads. Keep disabled unless you accept the consistency tradeoff
BLOB_CACHE_TTL_SECS1209600Redis TTL for cached Seal ciphertext by blob_id. 0 disables blob cache use
BLOB_CACHE_MAX_BYTES524288Maximum Seal ciphertext bytes cached in Redis. Larger blobs stay Walrus-only; 0 disables blob cache use
SERVER_SUI_PRIVATE_KEYSnoneComma-separated upload key pool. Takes priority over SERVER_SUI_PRIVATE_KEY for uploads
MEMWAL_ACCOUNT_IDnoneOptional account ID in server config
WALRUS_PACKAGE_IDnetwork defaultOverride the Walrus onchain package used by the sidecar
WALRUS_UPLOAD_RELAY_URLnetwork defaultOverride the Walrus upload relay used by the sidecar
SEAL_SERVER_CONFIGSnetwork defaultOptional JSON Seal server config override for independent or committee servers
SEAL_KEY_SERVERSnetwork defaultLegacy comma-separated independent Seal key server override. Used only when SEAL_SERVER_CONFIGS is unset. Deprecated but supported through relayer API 1.x
SEAL_THRESHOLDmin(2, total configured weight)Required configured server weight for Seal encrypt/decrypt
ENOKI_API_KEYnoneOptional Enoki key for sponsored sidecar transactions
ENOKI_NETWORKmainnetNetwork used for Enoki-sponsored flows
ENOKI_FALLBACK_TO_DIRECT_SIGNfalseIf true, sidecar pays gas directly with the server wallet when Enoki sponsorship fails or is not configured
MEMWAL_RELAYER_URLhttp://127.0.0.1:$PORTRelayer URL passed from the Rust server to the sidecar for MCP tool calls
MCP_MAX_TOTAL_SESSIONS1000Maximum active MCP sessions across SSE and Streamable HTTP transports
MCP_MAX_SESSIONS_PER_IP16Maximum active MCP sessions from one source IP
MCP_MAX_NEW_SESSIONS_PER_IP_PER_MIN30Maximum new MCP sessions opened by one source IP per minute

Notes

  • If both SERVER_SUI_PRIVATE_KEYS and SERVER_SUI_PRIVATE_KEY are set, the key pool takes priority for uploads. Upload jobs use the pool in round-robin order.
  • Keep ENOKI_FALLBACK_TO_DIRECT_SIGN=false in production if the server wallet should not pay gas when sponsorship is missing, expired, or rejected.
  • OPENAI_API_KEY and OPENAI_API_BASE control the embedding and fact-extraction provider used by remember, recall, analyze, ask, and restore re-indexing.
  • WALRUS_AGGREGATOR_URLS is only used after the Redis ciphertext cache misses. Put low-latency cache/proxy endpoints first after the primary and keep 404/5xx cache TTLs short in your proxy.
  • WALRUS_SKIP_CONSISTENCY_CHECK=true should only be used for trusted blobs written by the relayer. Restore keeps consistency checks enabled for onchain-discovered blobs.
  • Without OPENAI_API_KEY, the server can fall back to mock embeddings. That is useful for local testing, not for normal production behavior.
  • SUI_NETWORK drives the default RPC URL, Walrus endpoints, Walrus package ID, and upload relay selection.
  • SEAL_SERVER_CONFIGS is a JSON array of { objectId, weight, aggregatorUrl?, apiKeyName?, apiKey? }. Committee key server configs require aggregatorUrl.
  • SEAL_KEY_SERVERS is the legacy comma-separated independent key server list. It is only used when SEAL_SERVER_CONFIGS is unset, is advertised as deprecated in /version, and does not be removed before relayer API 2.0.0.
  • If neither Seal variable is set, the sidecar uses built-in defaults for SUI_NETWORK: the original Mysten independent key server pair on testnet, and the legacy independent key server pair on mainnet until an official Mainnet committee aggregator is available.
  • Use SEAL_SERVER_CONFIGS to opt into a committee key server by providing objectId, weight, and aggregatorUrl. Mysten's Testnet committee aggregator is 0xb012378c9f3799fb5b1a7083da74a4069e3c3f1c93de0b27212a5799ce1e1e98 with https://seal-aggregator-testnet.mystenlabs.com.
  • The Mysten Testnet committee aggregator is a single logical server config from the SDK's point of view. Its 3-of-5 committee threshold is handled by the aggregator, so leave SEAL_THRESHOLD unset or set it to 1 when opting into that committee config.
  • Keep the independent Testnet defaults, or pin SEAL_KEY_SERVERS=0x73d05d62c18d9374e3ea529e8e0ed6161da1a141a94d3f76ae3fe4e99356db75,0xf5d14a81a982144ae441cd7d64b09027f116a468bd36e7eca494f750591623c8, for deployments with existing memories encrypted by those key servers until the data is migrated or re-encrypted.
  • The sidecar POST /walrus/upload route defaults Walrus storage epochs by network: 50 on testnet (about 50 days) and 2 on mainnet (about 4 weeks), unless the request explicitly passes epochs.
  • MEMWAL_PACKAGE_ID and MEMWAL_REGISTRY_ID are server env vars. Do not replace them with VITE_* app env vars.
  • For network-specific MEMWAL_PACKAGE_ID and MEMWAL_REGISTRY_ID values, see Contract Overview.
  • MEMWAL_RELAYER_URL is only needed when the sidecar should call a different relayer URL than the Rust server's local port. The Rust server sets it automatically to http://127.0.0.1:$PORT for the managed sidecar when it starts.