-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.example
More file actions
243 lines (187 loc) · 6.7 KB
/
.env.example
File metadata and controls
243 lines (187 loc) · 6.7 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# ============================================
# X402 Protocol Configuration
# ============================================
# Copy this file to .env and fill in your values
# Required variables are marked with [REQUIRED]
#
# Documentation: /docs/DEPLOYMENT.md
# ============================================
# ============================================
# ENVIRONMENT
# ============================================
# Environment: development, staging, production
# Default: development
NODE_ENV=development
# ============================================
# BLOCKCHAIN CONFIGURATION
# ============================================
# [REQUIRED for production] Your wallet private key
# Include the 0x prefix for consistency
# WARNING: Never commit this file with real keys!
PRIVATE_KEY=
# [REQUIRED for production] Deployer private key (for contract deployment)
# Can be the same as PRIVATE_KEY or a separate deployment wallet
DEPLOYER_PRIVATE_KEY=
# Arbitrum RPC URLs
# For production, use a private RPC from Alchemy, Infura, or QuickNode
# Public RPCs may rate limit or be unreliable
ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc
ARBITRUM_SEPOLIA_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc
# Network to use: arbitrum (mainnet) or arbitrum-sepolia (testnet)
# Default: arbitrum-sepolia
NETWORK=arbitrum-sepolia
# Chain IDs (for reference, usually auto-detected)
# Arbitrum One: 42161
# Arbitrum Sepolia: 421614
CHAIN_ID=421614
# ============================================
# CONTRACT ADDRESSES
# ============================================
# Sperax USDs Token Addresses
# Arbitrum Mainnet: 0xD74f5255D557944cf7Dd0E45FF521520002D5748
# Arbitrum Sepolia: Deploy your own mock token for testing
USDS_TOKEN_ADDRESS=0xD74f5255D557944cf7Dd0E45FF521520002D5748
# Sperax Vault Address (for yield tracking)
# Arbitrum Mainnet: 0x8EC1877698ACF262Fe8Ad8a295ad94D6ea258988
USDS_VAULT_ADDRESS=0x8EC1877698ACF262Fe8Ad8a295ad94D6ea258988
# X402 Contract Suite Addresses (set after deployment)
# See /docs/DEPLOYMENT.md for deployment instructions
TOOL_REGISTRY_ADDRESS=
PAYMENT_CHANNEL_ADDRESS=
SUBSCRIPTION_ADDRESS=
CREDIT_SYSTEM_ADDRESS=
REVENUE_SPLITTER_ADDRESS=
# ============================================
# PLATFORM CONFIGURATION
# ============================================
# [REQUIRED] Platform wallet address (receives platform fees)
PLATFORM_WALLET_ADDRESS=
# Platform fee in basis points (100 = 1%, 2000 = 20%)
# Default: 2000 (20%)
DEFAULT_PLATFORM_FEE_BPS=2000
# Credit system fee in basis points
# Default: 500 (5%)
CREDIT_SYSTEM_FEE_BPS=500
# ============================================
# FACILITATOR SERVER
# ============================================
# Facilitator server port
# Default: 3002
FACILITATOR_PORT=3002
# Facilitator bind address
# Default: 0.0.0.0 (all interfaces)
FACILITATOR_HOST=0.0.0.0
# Facilitator URL (for clients to connect)
# In production, use your public domain with HTTPS
FACILITATOR_URL=http://localhost:3002
# [REQUIRED for production] Default payment recipient
# Address that receives payments when no recipient specified
RECIPIENT_ADDRESS=
# ============================================
# RATE LIMITING
# ============================================
# Rate limit window in milliseconds
# Default: 60000 (1 minute)
RATE_LIMIT_WINDOW_MS=60000
# Maximum requests per window
# Default: 100
RATE_LIMIT_MAX_REQUESTS=100
# ============================================
# CACHING
# ============================================
# Payment cache TTL in milliseconds
# Default: 86400000 (24 hours)
PAYMENT_CACHE_TTL_MS=86400000
# Redis URL (optional, for distributed caching)
# If not set, uses in-memory cache
# Format: redis://[username:password@]host:port[/db]
REDIS_URL=
# ============================================
# YIELD TRACKER
# ============================================
# Yield tracker server port
# Default: 3003
YIELD_TRACKER_PORT=3003
# Database URL for yield data persistence
# Supports: PostgreSQL, SQLite, MySQL
# Default: Uses SQLite in ./data/yield.db
# Examples:
# PostgreSQL: postgresql://user:pass@localhost:5432/x402
# SQLite: file:./data/yield.db
# MySQL: mysql://user:pass@localhost:3306/x402
DATABASE_URL=
# ============================================
# SECURITY
# ============================================
# Allowed CORS origins (comma-separated)
# Use '*' for development, specific origins for production
# Example: https://app.x402.io,https://admin.x402.io
CORS_ORIGINS=*
# API key for admin endpoints (optional)
# Generate with: openssl rand -hex 32
ADMIN_API_KEY=
# JWT secret for authentication (optional, for future features)
# Generate with: openssl rand -base64 64
JWT_SECRET=
# ============================================
# LOGGING
# ============================================
# Log level: debug, info, warn, error
# Default: info (use debug for development)
LOG_LEVEL=info
# Log format: json, pretty
# Use json for production (easier to parse)
# Use pretty for development (human readable)
LOG_FORMAT=pretty
# Enable request logging
# Default: true
ENABLE_REQUEST_LOGGING=true
# ============================================
# EXTERNAL SERVICES
# ============================================
# Alchemy API key (recommended for production RPC)
# Sign up at: https://www.alchemy.com/
ALCHEMY_API_KEY=
# Infura API key (alternative RPC provider)
# Sign up at: https://www.infura.io/
INFURA_API_KEY=
# Arbiscan API key (for contract verification)
# Sign up at: https://arbiscan.io/register
ARBISCAN_API_KEY=
# ============================================
# MONITORING (Optional)
# ============================================
# Prometheus metrics endpoint
# Set to true to expose /metrics endpoint
ENABLE_METRICS=true
# Metrics port (if different from main server)
METRICS_PORT=9090
# Sentry DSN for error tracking
# Sign up at: https://sentry.io/
SENTRY_DSN=
# DataDog API key for APM
# Sign up at: https://www.datadoghq.com/
DATADOG_API_KEY=
# ============================================
# NOTIFICATIONS (Optional)
# ============================================
# Slack webhook URL for alerts
# Create at: https://api.slack.com/messaging/webhooks
SLACK_WEBHOOK_URL=
# PagerDuty integration key
# Create at: https://support.pagerduty.com/docs/services-and-integrations
PAGERDUTY_INTEGRATION_KEY=
# Discord webhook URL for notifications
DISCORD_WEBHOOK_URL=
# ============================================
# DEVELOPMENT ONLY
# ============================================
# Enable development mode features
# WARNING: Never enable in production!
DEV_MODE=false
# Mock blockchain interactions (for testing without real network)
MOCK_BLOCKCHAIN=false
# Disable signature verification (for testing only)
DISABLE_SIG_VERIFICATION=false
# Local Anvil RPC (for local development with Foundry)
ANVIL_RPC_URL=http://localhost:8545