You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/README.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,6 +159,32 @@ The endpoint returns **HTTP 503** when `status` is `degraded`, so orchestrators
159
159
160
160
---
161
161
162
+
## Stellar network (Testnet / Mainnet)
163
+
164
+
The backend selects a Stellar network with **`STELLAR_NETWORK`** (`testnet` or `mainnet`). That value drives:
165
+
166
+
-**Horizon URL** — defaults to the public Horizon for the chosen network (`https://horizon-testnet.stellar.org` or `https://horizon.stellar.org`). Override with **`STELLAR_HORIZON_URL`** if you use a proxy or custom Horizon.
167
+
-**Network passphrase** — exposed at runtime via `env.stellar.networkPassphrase` (same constants as the Stellar SDK) for any logic that must sign or verify against a specific network.
168
+
-**Contract ID** — defaults are empty until you deploy; set **`STELLAR_CONTRACT_ID`** to your raffle (or other) contract for the environment you are running.
169
+
-**Indexer base URL** — if **`INDEXER_URL`** is not set, it defaults to the URL in `stellar.constants.ts` for that network (currently `http://localhost:3002` for both). In production, set **`INDEXER_URL`** explicitly to the tikka-indexer instance that indexes the same chain as **`STELLAR_NETWORK`**.
170
+
171
+
Injectable services should read **`INDEXER_URL`** and **`INDEXER_TIMEOUT_MS`** from Nest **`ConfigService`** (validated at startup). For scripts or non-DI code, use **`env.indexer`** and **`env.stellar`** from `src/config/env.config.ts`.
172
+
173
+
Example `.env` fragments:
174
+
175
+
```dotenv
176
+
# Local development against testnet
177
+
STELLAR_NETWORK=testnet
178
+
INDEXER_URL=http://localhost:3002
179
+
180
+
# Production-style: mainnet Horizon defaults; point indexer at your fleet
181
+
STELLAR_NETWORK=mainnet
182
+
STELLAR_CONTRACT_ID=YOUR_MAINNET_CONTRACT_ID
183
+
INDEXER_URL=https://your-indexer.example.com
184
+
```
185
+
186
+
---
187
+
162
188
## Environment Variables
163
189
164
190
Copy `.env.example` to `.env` and fill in the required values before starting the server.
@@ -186,7 +212,10 @@ These must be set or the app will refuse to start:
0 commit comments