diff options
Diffstat (limited to 'docs/reference/configuration.md')
| -rw-r--r-- | docs/reference/configuration.md | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index e2ec9aa..80ae45c 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md | |||
| @@ -265,6 +265,143 @@ NGIT_DATABASE_BACKEND=lmdb | |||
| 265 | 265 | ||
| 266 | --- | 266 | --- |
| 267 | 267 | ||
| 268 | ### Proactive Sync Configuration (GRASP-02) | ||
| 269 | |||
| 270 | These options configure the proactive sync feature that synchronizes events from other relays. | ||
| 271 | |||
| 272 | #### `NGIT_SYNC_RELAY_URL` | ||
| 273 | |||
| 274 | **Description:** URL of the primary relay to sync events from | ||
| 275 | **Type:** String (WebSocket URL) | ||
| 276 | **Default:** None (sync disabled) | ||
| 277 | **Required:** No | ||
| 278 | |||
| 279 | **Examples:** | ||
| 280 | ```bash | ||
| 281 | # Sync from a public relay | ||
| 282 | NGIT_SYNC_RELAY_URL=wss://relay.example.com | ||
| 283 | |||
| 284 | # Sync from another GRASP relay | ||
| 285 | NGIT_SYNC_RELAY_URL=wss://git.nostr.dev | ||
| 286 | |||
| 287 | # Local testing | ||
| 288 | NGIT_SYNC_RELAY_URL=ws://127.0.0.1:8081 | ||
| 289 | ``` | ||
| 290 | |||
| 291 | **Notes:** | ||
| 292 | - When set, enables proactive sync feature | ||
| 293 | - The relay will discover additional relays from repository announcements | ||
| 294 | - Synced events go through the same validation as directly-submitted events | ||
| 295 | - Use WebSocket protocol (`ws://` or `wss://`) | ||
| 296 | |||
| 297 | --- | ||
| 298 | |||
| 299 | #### `NGIT_SYNC_MAX_BACKOFF_SECS` | ||
| 300 | |||
| 301 | **Description:** Maximum backoff time in seconds for sync relay reconnection | ||
| 302 | **Type:** Integer (seconds) | ||
| 303 | **Default:** `3600` (1 hour) | ||
| 304 | **Required:** No | ||
| 305 | |||
| 306 | **Examples:** | ||
| 307 | ```bash | ||
| 308 | # Default: 1 hour max backoff | ||
| 309 | NGIT_SYNC_MAX_BACKOFF_SECS=3600 | ||
| 310 | |||
| 311 | # Aggressive: 5 minute max backoff | ||
| 312 | NGIT_SYNC_MAX_BACKOFF_SECS=300 | ||
| 313 | |||
| 314 | # Conservative: 2 hour max backoff | ||
| 315 | NGIT_SYNC_MAX_BACKOFF_SECS=7200 | ||
| 316 | ``` | ||
| 317 | |||
| 318 | **Notes:** | ||
| 319 | - Backoff starts at 5 seconds and doubles on each failure | ||
| 320 | - Capped at this maximum value | ||
| 321 | - After 24 hours of failures, relay is marked "dead" and retried daily | ||
| 322 | - Lower values mean more reconnection attempts | ||
| 323 | |||
| 324 | --- | ||
| 325 | |||
| 326 | #### `NGIT_SYNC_STARTUP_DELAY_SECS` | ||
| 327 | |||
| 328 | **Description:** Delay in seconds before running startup catchup | ||
| 329 | **Type:** Integer (seconds) | ||
| 330 | **Default:** `30` | ||
| 331 | **Required:** No | ||
| 332 | |||
| 333 | **Examples:** | ||
| 334 | ```bash | ||
| 335 | # Default: 30 second delay | ||
| 336 | NGIT_SYNC_STARTUP_DELAY_SECS=30 | ||
| 337 | |||
| 338 | # Quick startup (testing) | ||
| 339 | NGIT_SYNC_STARTUP_DELAY_SECS=5 | ||
| 340 | |||
| 341 | # Production: longer warm-up | ||
| 342 | NGIT_SYNC_STARTUP_DELAY_SECS=60 | ||
| 343 | ``` | ||
| 344 | |||
| 345 | **Notes:** | ||
| 346 | - Allows connections to stabilize before catchup | ||
| 347 | - Reduces load on remote relays at startup | ||
| 348 | - Set to 0 for immediate catchup (not recommended) | ||
| 349 | |||
| 350 | --- | ||
| 351 | |||
| 352 | #### `NGIT_SYNC_RECONNECT_DELAY_SECS` | ||
| 353 | |||
| 354 | **Description:** Delay in seconds before running catchup after reconnection | ||
| 355 | **Type:** Integer (seconds) | ||
| 356 | **Default:** `10` | ||
| 357 | **Required:** No | ||
| 358 | |||
| 359 | **Examples:** | ||
| 360 | ```bash | ||
| 361 | # Default: 10 second delay | ||
| 362 | NGIT_SYNC_RECONNECT_DELAY_SECS=10 | ||
| 363 | |||
| 364 | # Quick reconnect catchup | ||
| 365 | NGIT_SYNC_RECONNECT_DELAY_SECS=5 | ||
| 366 | |||
| 367 | # Conservative | ||
| 368 | NGIT_SYNC_RECONNECT_DELAY_SECS=30 | ||
| 369 | ``` | ||
| 370 | |||
| 371 | **Notes:** | ||
| 372 | - Prevents rate limiting from remote relays | ||
| 373 | - Applied after each successful reconnection | ||
| 374 | - Only catches up on recent events (see lookback days) | ||
| 375 | |||
| 376 | --- | ||
| 377 | |||
| 378 | #### `NGIT_SYNC_RECONNECT_LOOKBACK_DAYS` | ||
| 379 | |||
| 380 | **Description:** Number of days to look back for reconnect catchup | ||
| 381 | **Type:** Integer (days) | ||
| 382 | **Default:** `3` | ||
| 383 | **Required:** No | ||
| 384 | |||
| 385 | **Examples:** | ||
| 386 | ```bash | ||
| 387 | # Default: 3 days lookback | ||
| 388 | NGIT_SYNC_RECONNECT_LOOKBACK_DAYS=3 | ||
| 389 | |||
| 390 | # Short lookback (frequent reconnects expected) | ||
| 391 | NGIT_SYNC_RECONNECT_LOOKBACK_DAYS=1 | ||
| 392 | |||
| 393 | # Extended lookback | ||
| 394 | NGIT_SYNC_RECONNECT_LOOKBACK_DAYS=7 | ||
| 395 | ``` | ||
| 396 | |||
| 397 | **Notes:** | ||
| 398 | - Limits catchup queries to recent events only | ||
| 399 | - Reduces load compared to full historical sync | ||
| 400 | - Balance between completeness and performance | ||
| 401 | - Longer lookback useful for less reliable connections | ||
| 402 | |||
| 403 | --- | ||
| 404 | |||
| 268 | ### Logging Configuration | 405 | ### Logging Configuration |
| 269 | 406 | ||
| 270 | #### `RUST_LOG` | 407 | #### `RUST_LOG` |