-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy path.env.example
More file actions
125 lines (92 loc) · 6.37 KB
/
Copy path.env.example
File metadata and controls
125 lines (92 loc) · 6.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# ─── Server ───────────────────────────────────────────────────────────────────
# Port the Express server listens on (default: 3001)
PORT=3001
# Application environment mode ('development', 'production', or 'test')
NODE_ENV=development
# Comma-separated list of allowed origins for CORS. In development, if unset,
# defaults to http://localhost:3000
CORS_ALLOWED_ORIGINS="https://app.flowfi.xyz,https://flowfi.xyz"
# Optional base URL for Swagger OpenAPI documentation server (e.g. http://localhost:3001)
API_BASE_URL=http://localhost:3001
# ─── Database ─────────────────────────────────────────────────────────────────
# Main PostgreSQL database connection URL
DATABASE_URL="postgresql://user:password@localhost:5433/flowfi?schema=public"
# PostgreSQL pool settings:
# Maximum database connections per backend process (default: 10)
PG_POOL_MAX=10
# How long an idle connection stays open before being closed (milliseconds, default: 30000)
PG_IDLE_TIMEOUT_MS=30000
# How long to wait when establishing a new database connection (milliseconds, default: 5000)
PG_CONNECTION_TIMEOUT_MS=5000
# Maximum time a PostgreSQL statement may run before cancellation (milliseconds, default: 30000)
PG_STATEMENT_TIMEOUT_MS=30000
# ─── Stellar & Soroban ────────────────────────────────────────────────────────
# Stellar network target ('testnet' or 'mainnet')
STELLAR_NETWORK=testnet
# Stellar Horizon REST API server endpoint
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
# Soroban RPC endpoint URL (testnet default shown)
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Deployed FlowFi stream contract address (C...). Leave empty to disable indexers
STREAM_CONTRACT_ID=
# Server-side Stellar secret key (S...) used to sign and submit on-chain transactions
# (cancel_stream, top_up_stream). Must be funded on the target network.
KEEPER_SECRET_KEY=
# Max stream creation requests per wallet per minute (default: 10)
STREAM_CREATE_RATE_LIMIT=10
# Timeout for Soroban RPC requests in milliseconds (default: 10000)
SOROBAN_RPC_TIMEOUT_MS=10000
# Maximum retry attempts for failed Soroban RPC requests (default: 2)
SOROBAN_RPC_MAX_RETRIES=2
# Base delay in milliseconds for exponential backoff during Soroban RPC retries (default: 250)
SOROBAN_RPC_RETRY_BASE_MS=250
# ─── Soroban Event Indexer ────────────────────────────────────────────────────
# Polling interval in milliseconds for the background Soroban event worker (default: 5000)
INDEXER_POLL_INTERVAL_MS=5000
# Ledger sequence for event worker to start indexing from on first run (0 = latest, default: 0)
INDEXER_START_LEDGER=0
# Polling interval in milliseconds for Soroban indexer service (default: 15000)
SOROBAN_INDEXER_POLL_MS=15000
# Ledger sequence to start indexing from for Soroban indexer service (default: 0)
SOROBAN_INDEXER_START_LEDGER=0
# ─── Auth ─────────────────────────────────────────────────────────────────────
# Secret used to sign JWTs (generate with: openssl rand -hex 32). Required in production.
JWT_SECRET=
# Stellar public key (G...) of the admin user (for /v1/admin/* endpoints)
ADMIN_PUBLIC_KEY=
# Interval in milliseconds to sweep and prune expired auth challenges (default: 300000)
AUTH_CHALLENGE_SWEEP_INTERVAL_MS=300000
# ─── Redis (optional) ────────────────────────────────────────────────────────
# When set, enables horizontal SSE scaling via Redis pub/sub so events
# emitted by any backend instance are broadcast to clients on all instances.
# Leave empty to run in single-instance mode (no Redis required).
REDIS_URL=
# ─── Caching (optional) ───────────────────────────────────────────────────────
# Time in milliseconds between periodic sweeps to prune expired memory cache entries (default: 60000)
MEMORY_CACHE_SWEEP_MS=60000
# Maximum number of entries kept in the in-memory cache. When exceeded, the
# least-recently-used entries are evicted immediately so memory stays bounded
# even between sweeps (default: 10000)
MEMORY_CACHE_MAX_ITEMS=10000
# Cache time-to-live (TTL) for claimable amount calculations in milliseconds (default: 5000)
CLAIMABLE_CACHE_TTL_MS=5000
# ─── Logging ──────────────────────────────────────────────────────────────────
# Log output verbosity level ('error', 'warn', 'info', 'debug', default: info)
LOG_LEVEL=info
# ─── Streaming & Server-Sent Events (SSE) ─────────────────────────────────────
# Maximum concurrent SSE client connections allowed (default: 10000)
MAX_SSE_CONNECTIONS=10000
# ─── Sandbox Mode ─────────────────────────────────────────────────────────────
# Enable or disable sandbox mode ('true' or 'false', default: true)
SANDBOX_MODE_ENABLED=true
# Optional: Separate PostgreSQL connection URL for sandbox mode.
# If not set, defaults to {DATABASE_URL}_sandbox
SANDBOX_DATABASE_URL="postgresql://user:password@localhost:5433/flowfi_sandbox?schema=public"
# Whether sandbox mode can be triggered via request headers ('true' or 'false', default: true)
SANDBOX_ALLOW_HEADER=true
# Whether sandbox mode can be triggered via query parameters ('true' or 'false', default: true)
SANDBOX_ALLOW_QUERY_PARAM=true
# Header name used to trigger sandbox mode (default: X-Sandbox-Mode)
SANDBOX_HEADER_NAME=X-Sandbox-Mode
# Query parameter name used to trigger sandbox mode (default: sandbox)
SANDBOX_QUERY_PARAM_NAME=sandbox