-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
198 lines (157 loc) · 7.94 KB
/
Copy path.env.example
File metadata and controls
198 lines (157 loc) · 7.94 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# ============================================
# P2P EXCHANGE - ENVIRONMENT CONFIGURATION
# ============================================
# ─────────────────────────────────────────
# EMBEDDED GRAPE DHT (TRUE P2P) ⭐
# ─────────────────────────────────────────
# Enable/disable embedded Grape server (default: true)
# Set to false to use external Grape servers (legacy mode)
EMBEDDED_GRAPE=true
# Grape DHT port (each node needs different port on same machine)
# Default: 20001
# Node 1: 20001, Node 2: 20002, Node 3: 20003, etc.
GRAPE_DHT_PORT=20001
# Grape HTTP API port (each node needs different port on same machine)
# Default: 30001
# Node 1: 30001, Node 2: 30002, Node 3: 30003, etc.
GRAPE_API_PORT=30001
# Bootstrap DHT nodes (comma-separated host:port)
# Leave empty for first node, specify others for subsequent nodes
# Example: 127.0.0.1:20001,127.0.0.1:20002
GRAPE_BOOTSTRAP_NODES=
# Grape bind host (default: 127.0.0.1)
# Use 0.0.0.0 to bind all interfaces
GRAPE_HOST=127.0.0.1
# ─────────────────────────────────────────
# LEGACY GRENACHE (External Servers)
# ─────────────────────────────────────────
# Only used when EMBEDDED_GRAPE=false
# URL of external Grape server
GRAPE_URL=http://127.0.0.1:30001
# ─────────────────────────────────────────
# P2P NETWORK CONFIGURATION
# ─────────────────────────────────────────
# P2P TCP port for direct connections (each node needs different port)
# Default: 3000
P2P_PORT=3000
# P2P bind host
# Default: 0.0.0.0 (all interfaces)
P2P_HOST=0.0.0.0
# Enable mDNS local network discovery (default: true)
DISCOVERY_MDNS=true
# Enable Grenache discovery (default: true)
# Only affects external Grenache when EMBEDDED_GRAPE=false
DISCOVERY_GRENACHE=true
# Bootstrap peers for direct P2P connections (comma-separated host:port)
# Example: 127.0.0.1:3001,127.0.0.1:3002
BOOTSTRAP_PEERS=
# Peer storage file path (default: .peers.json)
PEER_STORAGE_PATH=.peers.json
# Maximum number of peers (default: 50)
MAX_PEERS=50
# Peer reconnection interval in milliseconds (default: 30000 = 30s)
PEER_RECONNECT_INTERVAL=30000
# ─────────────────────────────────────────
# EXCHANGE CONFIGURATION
# ─────────────────────────────────────────
# Trading pair (default: BTC/USD)
EXCHANGE_PAIR=BTC/USD
# Exchange port (default: 3000)
EXCHANGE_PORT=3000
# ─────────────────────────────────────────
# LOGGING CONFIGURATION
# ─────────────────────────────────────────
# Log level: trace, debug, info, warn, error, fatal
# Default: debug (development), info (production)
LOG_LEVEL=debug
# Log directory (default: src/logs)
LOG_DIR=./logs
# Maximum log files to keep (default: 10)
LOG_MAX_FILES=10
# Maximum log file size in MB (default: 10)
LOG_MAX_SIZE_MB=10
# ─────────────────────────────────────────
# PERFORMANCE CONFIGURATION
# ─────────────────────────────────────────
# Performance threshold in milliseconds (default: 10)
PERFORMANCE_THRESHOLD_MS=10
# Maximum order amount (default: 1000000)
MAX_ORDER_AMOUNT=1000000
# Maximum order price (default: 1000000)
MAX_ORDER_PRICE=1000000
# ─────────────────────────────────────────
# CIRCUIT BREAKER CONFIGURATION
# ─────────────────────────────────────────
# Failure threshold before opening circuit (default: 3)
CIRCUIT_BREAKER_FAILURE_THRESHOLD=3
# Reset timeout in milliseconds (default: 30000 = 30s)
CIRCUIT_BREAKER_RESET_TIMEOUT_MS=30000
# ─────────────────────────────────────────
# SECURITY CONFIGURATION
# ─────────────────────────────────────────
# Enable rate limiting (default: false)
ENABLE_RATE_LIMIT=false
# Maximum requests per minute (default: 1000)
MAX_REQUESTS_PER_MINUTE=1000
# Maximum orders per minute (default: 100)
MAX_ORDERS_PER_MINUTE=100
# Maximum orders per second (default: 10)
MAX_ORDERS_PER_SECOND=10
# Maximum message size in KB (default: 1024)
MAX_MESSAGE_SIZE_KB=1024
# Enable CORS (default: true)
ENABLE_CORS=true
# ─────────────────────────────────────────
# MONITORING CONFIGURATION
# ─────────────────────────────────────────
# Enable metrics (default: true)
ENABLE_METRICS=true
# Metrics port (default: 9090)
METRICS_PORT=9090
# Health check interval in milliseconds (default: 30000 = 30s)
HEALTH_CHECK_INTERVAL_MS=30000
# ─────────────────────────────────────────
# ENVIRONMENT
# ─────────────────────────────────────────
# Environment: development, staging, production, test
NODE_ENV=development
# ============================================
# EXAMPLE CONFIGURATIONS
# ============================================
# ─────────────────────────────────────────
# Example 1: Node 1 (Bootstrap) - Embedded Grape
# ─────────────────────────────────────────
# EMBEDDED_GRAPE=true
# GRAPE_DHT_PORT=20001
# GRAPE_API_PORT=30001
# GRAPE_BOOTSTRAP_NODES=
# P2P_PORT=3001
# ─────────────────────────────────────────
# Example 2: Node 2 - Embedded Grape
# ─────────────────────────────────────────
# EMBEDDED_GRAPE=true
# GRAPE_DHT_PORT=20002
# GRAPE_API_PORT=30002
# GRAPE_BOOTSTRAP_NODES=127.0.0.1:20001
# P2P_PORT=3002
# ─────────────────────────────────────────
# Example 3: Node 3 - Embedded Grape
# ─────────────────────────────────────────
# EMBEDDED_GRAPE=true
# GRAPE_DHT_PORT=20003
# GRAPE_API_PORT=30003
# GRAPE_BOOTSTRAP_NODES=127.0.0.1:20001,127.0.0.1:20002
# P2P_PORT=3003
# ─────────────────────────────────────────
# Example 4: Pure P2P (No Grape)
# ─────────────────────────────────────────
# EMBEDDED_GRAPE=false
# DISCOVERY_GRENACHE=false
# P2P_PORT=3001
# BOOTSTRAP_PEERS=127.0.0.1:3002,127.0.0.1:3003
# ─────────────────────────────────────────
# Example 5: Legacy (External Grape)
# ─────────────────────────────────────────
# EMBEDDED_GRAPE=false
# GRAPE_URL=http://127.0.0.1:30001
# P2P_PORT=3001