Skip to main content

Configuration

This document outlines the environment variables used for configuring the Lucid L2 offchain API. These variables are parsed from a sample .env file and are crucial for setting up the environment correctly.

OBSERVABILITY

VariableDefaultDescription
SENTRY_DSNSentry — error tracking & performance monitoring. Leave blank to disable Sentry (safe for local development).
OTEL_ENABLEDfalseOpenTelemetry — distributed tracing. Set to “true” to enable OTel trace collection.
OTEL_EXPORTER_OTLP_ENDPOINThttp://localhost:4318Endpoint for the OpenTelemetry exporter.
LUCID_ENVdevelopmentEnvironment identifier used by both Sentry and OpenTelemetry. Typical values: development, staging, production.

TRUSTGATE

VariableDefaultDescription
TRUSTGATE_URLhttps://trustgate-api-production.up.railway.appTrustGate inference gateway (OpenAI-compatible).
TRUSTGATE_API_KEYyour_tenant_api_keyAPI key for accessing TrustGate services.
TRUSTGATE_ADMIN_KEYyour_admin_keyControl-plane admin key (X-Admin-Key header, for tenant/key management).

HUGGINGFACE

VariableDefaultDescription
HF_TOKENyour_huggingface_tokenHuggingFace API token for model/dataset/space discovery synchronization.

DEPIN STORAGE (Decentralized Permanent/Evolving File Storage)

VariableDefaultDescription
DEPIN_PERMANENT_PROVIDERmockPermanent storage provider (epoch proofs, NFT metadata, attestations). Options: ‘arweave’ (production), ‘mock’ (dev/test).
DEPIN_EVOLVING_PROVIDERmockEvolving storage provider (agent memory, mutable metadata). Options: ‘lighthouse’ (production), ‘mock’ (dev/test).
DEPIN_UPLOAD_ENABLEDtrueKill switch — set to ‘false’ to disable all DePIN uploads globally. Default: enabled (any value other than ‘false’ means enabled).
IRYS_NETWORKdevnetRequired when DEPIN_PERMANENT_PROVIDER=arweave. Sign up at Irys and fund with SOL on devnet or mainnet. Network: ‘devnet’ (free, testnet) or ‘mainnet’ (real SOL cost).
IRYS_TOKENsolanaToken for Irys operations.
IRYS_PRIVATE_KEYEd25519 private key (base58 or JSON array) for signing Irys uploads. Generate with: solana-keygen new --no-bip39-passphrase -o irys-key.json.
LIGHTHOUSE_API_KEYRequired when DEPIN_EVOLVING_PROVIDER=lighthouse. Sign up at Lighthouse for a free tier (5 GB). Get API key from dashboard after email verification.

SOLANA

VariableDefaultDescription
LUCID_ORCHESTRATOR_SECRET_KEYyour_base64_or_json_keypairOrchestrator signing key for receipts + epoch anchoring (Ed25519). Generate with: solana-keygen new --no-bip39-passphrase -o orchestrator.json, then base64-encode: `cat orchestrator.jsonbase64`.
SOLANA_RPC_URLhttps://api.mainnet-beta.solana.comSolana RPC endpoints for mainnet.
SOLANA_DEVNET_RPC_URLhttps://api.devnet.solana.comSolana RPC endpoints for devnet.
SOLANA_PRIVATE_KEY(commented out)Solana private key for transaction signing (base58 or JSON byte array). Generate with: solana-keygen new --no-bip39-passphrase -o wallet.json.
ANCHOR_WALLET~/.config/solana/id.jsonPath to the Anchor wallet file.

SOLANA PROGRAM IDS (Defaults Point to Devnet Deployments)

VariableDefaultDescription
THOUGHT_EPOCH_PROGRAM_ID9YhfaLoUZYLzu3xRQevRom4qj8oTf5TGpuoWptvStKDuCore epoch commitment program.
PASSPORTS_PROGRAM_IDFhoemNdqwPMt8nmX4HT3WpSqUuqeAUXRb7WchAehmSaLPassport NFT registry (Token-2022 + x402 payment gating).
GAS_UTILS_PROGRAM_IDEzuUhxtNAz1eRfAPypm6eAepe8fRQBrBPSo4Qcp1w3hmGas burn/split utility program.
AGENT_WALLET_PROGRAM_IDAJGpTWXbhvdYMxSah6GAKzykvfkYo2ViQpWGMbimQsphAgent wallet (PDA wallets, policy, escrow, splits, sessions).
ZKML_VERIFIER_PROGRAM_ID69cJRFGWijD1FdapQ2vz7VP6x2jcXRQyBws9VzzPpqANzkML Groth16 proof verifier (bloom filter deduplication, model registry).

ANCHORING PIPELINE

VariableDefaultDescription
ANCHORING_MOCK_MODEtrueSet to ‘true’ to disable real Solana anchoring (for local development).
EPOCH_FINALIZATION_INTERVAL_MS60000How often to check for finalizable epochs (in milliseconds). Default is 60000 ms.
ANCHORING_JOB_INTERVAL_MS600000How often to run the anchoring job (in milliseconds). Default is 600000 ms (10 minutes).
ANCHORING_CHAINSsolana-devnetMulti-chain epoch anchoring (comma-separated chain IDs). Default is solana-devnet. Example: solana-devnet,base-sepolia,apechain-testnet.

EVM CHAINS

VariableDefaultDescription
EVM_ENABLED_CHAINSbase-sepolia,ethereum-sepoliaWhich EVM chains to register adapters for (comma-separated). Default is all testnet chains. Override for production.
BASE_SEPOLIA_RPC_URLhttps://sepolia.base.orgRPC URLs (defaults use public RPCs, override for production).
ETHEREUM_SEPOLIA_RPC_URLhttps://ethereum-sepolia-rpc.publicnode.comRPC URL for Ethereum Sepolia.
APECHAIN_TESTNET_RPC_URLhttps://rpc.curtis.apechain.com/httpRPC URL for Apechain testnet.
EVM_PRIVATE_KEY0x...EVM private key for transaction signing (hex, with 0x prefix).
BASE_SEPOLIA_CONTRACTS{"epochRegistry":"0x...","passportRegistry":"0x...","escrow":"0x..."}Per-chain contract addresses (override defaults from chains/configs.ts). Format: JSON object with contract addresses.
ETHEREUM_SEPOLIA_CONTRACTS{"epochRegistry":"0x...","passportRegistry":"0x..."}Contract addresses for Ethereum Sepolia.
BASE_SEPOLIA_SESSION_MANAGER0x...EVM session manager contract (for session key support).
BASE_SEPOLIA_PAYMASTER0x...EVM paymaster contract (ERC-4337 gas sponsorship).

DATABASE (PostgreSQL — Optional, Falls Back to In-Memory)

VariableDefaultDescription
DATABASE_URLpostgresql://user:password@localhost:5432/lucidPostgreSQL connection string for receipt/epoch persistence.
PLATFORM_CORE_DB_URLpostgresql://user:password@localhost:5432/lucid_platformAgent Mirror (cross-DB sync from platform-core). Required for agentMirrorConsumer to poll agent_created_events.

PAYOUT & TREASURY

VariableDefaultDescription
PROTOCOL_TREASURY_ADDRESS(commented out)Protocol treasury wallet address (receives protocol fee split). Must be set for production payout execution.

GAS & EPOCH TUNING

VariableDefaultDescription
IGAS_PER_CALL1Gas rates in LUCID tokens (operators can adjust fees).
MGAS_PER_ROOT5Gas rate per root.
IGAS_PER_BATCH2Gas rate per batch.
MAX_RECEIPTS_PER_EPOCH100Epoch auto-finalization thresholds.
MAX_EPOCH_DURATION_MS3600000Maximum duration of an epoch in milliseconds.

MMR PERSISTENCE & CHECKPOINTING

VariableDefaultDescription
MMR_CHECKPOINT_INTERVAL_MS1800000How often to checkpoint MMR state to DePIN evolving storage (ms, default 1800000 = 30 min). Checkpoints enable recovery from DePIN if fast DB is lost.