this repo has no description

feat: add PDS initialization to setup script

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

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

Changed files
+32 -1
scripts
+32 -1
scripts/setup.js
··· 338 338 return true 339 339 } 340 340 341 + // === PDS INITIALIZATION === 342 + 343 + async function initializePds(pdsUrl, did, privateKeyHex, handle) { 344 + const url = `${pdsUrl}/init?did=${encodeURIComponent(did)}` 345 + 346 + const response = await fetch(url, { 347 + method: 'POST', 348 + headers: { 349 + 'Content-Type': 'application/json' 350 + }, 351 + body: JSON.stringify({ 352 + did, 353 + privateKey: privateKeyHex, 354 + handle 355 + }) 356 + }) 357 + 358 + if (!response.ok) { 359 + const text = await response.text() 360 + throw new Error(`PDS initialization failed: ${response.status} ${text}`) 361 + } 362 + 363 + return response.json() 364 + } 365 + 341 366 // === MAIN === 342 367 343 368 async function main() { ··· 375 400 console.log(' Registered successfully!') 376 401 console.log('') 377 402 378 - // TODO: Initialize PDS 403 + // Step 4: Initialize PDS 404 + console.log(`Initializing PDS at ${opts.pds}...`) 405 + const privateKeyHex = bytesToHex(keyPair.privateKey) 406 + await initializePds(opts.pds, did, privateKeyHex, fullHandle) 407 + console.log(' PDS initialized!') 408 + console.log('') 409 + 379 410 // TODO: Notify relay 380 411 } 381 412