forked from Carbon-Ledger-stellar/carbonledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
173 lines (145 loc) · 9.08 KB
/
Copy path.env.example
File metadata and controls
173 lines (145 loc) · 9.08 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
# ── Stellar Network ───────────────────────────────────────────────────────────
STELLAR_NETWORK=testnet
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
# ── Contract Addresses (fill after deployment) ────────────────────────────────
CARBON_REGISTRY_CONTRACT_ID=
CARBON_CREDIT_CONTRACT_ID=
CARBON_MARKETPLACE_CONTRACT_ID=
CARBON_ORACLE_CONTRACT_ID=
USDC_CONTRACT_ID=
# ── Canary Deployment (contract upgrade traffic splitting) ────────────────────
# Contract ID of the new (canary) contract version being tested.
# Leave empty to disable canary routing entirely.
CANARY_CONTRACT_ID=
# Percentage of contract calls to route to the canary contract (0–100).
# Set to 0 to disable canary; set to 100 to fully migrate.
# Adjustable at runtime via POST /api/v1/admin/canary
CANARY_TRAFFIC_PCT=0
# ── Oracle Keypair ────────────────────────────────────────────────────────────
ORACLE_SECRET_KEY=
ORACLE_PUBLIC_KEY=
# ── Admin Keypair ─────────────────────────────────────────────────────────────
ADMIN_SECRET_KEY=
ADMIN_PUBLIC_KEY=
# ── Database ──────────────────────────────────────────────────────────────────
DATABASE_URL=postgresql://carbonledger:<POSTGRES_PASSWORD>@localhost:5432/carbonledger
POSTGRES_PASSWORD=
# ── Prisma Connection Pool ────────────────────────────────────────────────────
# Max connections Prisma may open to PostgreSQL (default: 10).
# Rule of thumb: (num_cores * 2) + 1, capped by pg max_connections / num_replicas.
# Single 4-core replica → 10. Three 4-core replicas → 10 each (30 total ≤ pg default 100).
# High-traffic dedicated DB → 20–25. Never exceed: pg max_connections / replicas - 5.
DB_POOL_MAX=10
# Milliseconds to wait for a free connection before throwing P2024 (default: 10000).
# Increase to 30000 under heavy batch processing; decrease to 5000 for latency-sensitive APIs.
DB_POOL_TIMEOUT_MS=10000
# Seconds to wait when opening a new TCP connection to PostgreSQL (default: 10).
DB_CONNECT_TIMEOUT_S=10
# ── Slow Query Logging ────────────────────────────────────────────────────────
# HTTP request duration (ms) above which a "SLOW_QUERY" warning is emitted to
# the structured log. Set to 0 to log every request; omit or set very high to
# disable. Recommended production value: 500.
SLOW_QUERY_THRESHOLD_MS=500
# ── Auth ──────────────────────────────────────────────────────────────────────
JWT_SECRET=
JWT_EXPIRY=7d
# ── Redis (BullMQ job queue) ──────────────────────────────────────────────────
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# ── IPFS / Pinata ─────────────────────────────────────────────────────────────
IPFS_API_URL=https://api.pinata.cloud
IPFS_API_KEY=your_pinata_api_key_here
IPFS_SECRET_KEY=your_pinata_secret_key_here
# ── Email / SMTP ──────────────────────────────────────────────────────────────
SMTP_HOST=
SMTP_PORT=587
SMTP_USER=
SMTP_PASS=
SMTP_FROM=noreply@carbonledger.io
SMTP_SECURE=false
# Sender address used in the From header (defaults to SMTP_FROM if unset)
EMAIL_FROM=noreply@carbonledger.io
# Email address that receives error alert notifications
ADMIN_ALERT_EMAIL=admin@carbonledger.io
# SendGrid API key (preferred provider; falls back to SMTP when unset)
SENDGRID_API_KEY=
# ── Satellite Data ────────────────────────────────────────────────────────────
GOOGLE_EARTH_ENGINE_KEY=your_gee_service_account_json_here
PLANET_LABS_API_KEY=your_planet_labs_api_key_here
GEE_WEBHOOK_SECRET=your_gee_webhook_secret_here
# ── Price Feeds ───────────────────────────────────────────────────────────────
XPANSIV_API_KEY=your_xpansiv_api_key_here
TOUCAN_API_KEY=your_toucan_api_key_here
# ── Verifier APIs ─────────────────────────────────────────────────────────────
GOLD_STANDARD_API_URL=https://api.goldstandard.org
GOLD_STANDARD_API_KEY=your_gold_standard_api_key_here
VERRA_VCS_API_URL=https://api.verra.org
VERRA_VCS_API_KEY=your_verra_vcs_api_key_here
# ── Alerts ────────────────────────────────────────────────────────────────────
ADMIN_ALERT_WEBHOOK=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
# ── Database Backups ──────────────────────────────────────────────────────────
# S3 bucket name for daily pg_dump backups (created by Terraform).
# Format: carbonledger-db-backups-<workspace> (e.g. carbonledger-db-backups-production)
BACKUP_S3_BUCKET=carbonledger-db-backups-testnet
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# ── Frontend (Next.js public vars) ───────────────────────────────────────────
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_API_URL=http://localhost:3001/api/v1
NEXT_PUBLIC_REGISTRY_CONTRACT=
NEXT_PUBLIC_CREDIT_CONTRACT=
NEXT_PUBLIC_MARKETPLACE_CONTRACT=
NEXT_PUBLIC_ORACLE_CONTRACT=
NEXT_PUBLIC_USDC_CONTRACT=
# ── Backend ───────────────────────────────────────────────────────────────────
PORT=3001
FRONTEND_URL=http://localhost:3000
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001,https://app.carbonledger.com
# Maximum JSON request body size (express body-parser format: 10kb, 1mb, etc.)
BODY_SIZE_LIMIT=10kb
# ── Oracle Service (Python) ───────────────────────────────────────────────────
# Base URL of the backend API — oracle services post monitoring results here.
BACKEND_API_URL=http://localhost:3001/api/v1
# Pre-issued JWT for the oracle service account to authenticate with the backend.
BACKEND_JWT_TOKEN=
# ── Docker Resource Limits ────────────────────────────────────────────────────
# Memory accepts Docker size strings: 256m, 512m, 1g, etc.
# CPU is a fractional core count: 0.5 = 50% of one core.
# Defaults are sized for the shared testnet environment.
# Increase for production or high-throughput workloads.
BACKEND_MEM_LIMIT=512m
BACKEND_CPU_LIMIT=0.75
BACKEND_MEM_RESERVATION=128m
BACKEND_CPU_RESERVATION=0.25
FRONTEND_MEM_LIMIT=256m
FRONTEND_CPU_LIMIT=0.50
FRONTEND_MEM_RESERVATION=64m
FRONTEND_CPU_RESERVATION=0.10
POSTGRES_MEM_LIMIT=1g
POSTGRES_CPU_LIMIT=1.00
POSTGRES_MEM_RESERVATION=256m
POSTGRES_CPU_RESERVATION=0.25
REDIS_MEM_LIMIT=256m
REDIS_CPU_LIMIT=0.25
REDIS_MEM_RESERVATION=32m
REDIS_CPU_RESERVATION=0.05
ORACLE_MEM_LIMIT=256m
ORACLE_CPU_LIMIT=0.50
ORACLE_MEM_RESERVATION=64m
ORACLE_CPU_RESERVATION=0.10
OBSERVABILITY_MEM_LIMIT=256m
OBSERVABILITY_CPU_LIMIT=0.25
OBSERVABILITY_MEM_RESERVATION=64m
OBSERVABILITY_CPU_RESERVATION=0.05
# ── OpenTelemetry & Distributed Tracing ───────────────────────────────────────
OTEL_ENABLED=true
OTEL_SERVICE_NAME=carbonledger-backend
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
# OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces
OTEL_TRACES_SAMPLER_ARG=0.1