this repo has no description

feat: add relay notification to setup script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Changed files
+33 -1
scripts
+33 -1
scripts/setup.js
··· 363 363 return response.json() 364 364 } 365 365 366 + // === RELAY NOTIFICATION === 367 + 368 + async function notifyRelay(relayUrl, pdsHostname) { 369 + const url = `${relayUrl}/xrpc/com.atproto.sync.requestCrawl` 370 + 371 + const response = await fetch(url, { 372 + method: 'POST', 373 + headers: { 374 + 'Content-Type': 'application/json' 375 + }, 376 + body: JSON.stringify({ 377 + hostname: pdsHostname 378 + }) 379 + }) 380 + 381 + // Relay might return 200 or 202, both are OK 382 + if (!response.ok && response.status !== 202) { 383 + const text = await response.text() 384 + console.warn(` Warning: Relay notification returned ${response.status}: ${text}`) 385 + return false 386 + } 387 + 388 + return true 389 + } 390 + 366 391 // === MAIN === 367 392 368 393 async function main() { ··· 407 432 console.log(' PDS initialized!') 408 433 console.log('') 409 434 410 - // TODO: Notify relay 435 + // Step 5: Notify relay 436 + const pdsHostname = new URL(opts.pds).host 437 + console.log(`Notifying relay at ${opts.relayUrl}...`) 438 + const relayOk = await notifyRelay(opts.relayUrl, pdsHostname) 439 + if (relayOk) { 440 + console.log(' Relay notified!') 441 + } 442 + console.log('') 411 443 } 412 444 413 445 main().catch(err => {