Files
trade/data/.env.example
T

43 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# Trade Data Module — 环境变量配置模板
# ============================================================
# 复制为 .env 并修改:
# cp .env.example .env
# ============================================================
# --- 行情订阅 ---
# 逗号分隔的交易对列表(大写)
SYMBOLS=BTCUSDT,ETHUSDT
# --- TimescaleDB 连接 ---
DB_HOST=localhost
DB_PORT=5432
DB_NAME=trade
DB_USER=trader
DB_PASSWORD=changeme
# --- Redis 连接 ---
REDIS_URL=redis://localhost:6379
# 是否启用 Redis 发布(开发时可关闭)
REDIS_PUBLISH_ENABLED=true
# --- 批量写入 ---
# 缓冲区条数阈值(达到后自动刷新)
BATCH_SIZE=500
# 最大缓冲时间(毫秒),超时后自动刷新
FLUSH_INTERVAL_MS=1000
# --- WebSocket 连接 ---
# 断线重连延迟基数(毫秒),指数退避:基数 × 2^attempts
WS_RECONNECT_DELAY_MS=3000
# 心跳间隔(毫秒)
WS_PING_INTERVAL_MS=30000
# 最大重连次数
WS_MAX_RECONNECT_ATTEMPTS=10
# --- 日志 ---
# 日志级别:trace / debug / info / warn / error / fatal
LOG_LEVEL=debug
# 生产环境(关闭 pretty print,输出 JSON
NODE_ENV=development