| … | … | @@ -281,6 +281,22 @@ export class Sidecar { |
| 281 | 281 | this._registrySwarm.on('connection', (conn) => { |
| 282 | 282 | conn.on('error', () => {}) // absorb ECONNRESET from disconnecting peers |
| 283 | 283 | this._registryStore.replicate(conn) |
| 284 | // Multi-source content distribution: ALSO serve tree content by |
| 285 | // hash on the SHARED registry topic, muxed onto this same |
| 286 | // connection (keet many-protocols-one-connection pattern). Any |
| 287 | // peer that has the bytes can serve them — content is |
| 288 | // blake2b-addressed, no autobase writership needed. The DeployServer |
| 289 | // also seeds on its identity topic (above) for backward-compat with |
| 290 | // already-published releases whose serverKey = identity.publicKey; |
| 291 | // this adds the torrent-style shared-topic path so installers pull |
| 292 | // from EVERY sidecar seeding the registry, not just the publisher. |
| 293 | // replicate(conn) claims the Protomux first; serveOnConnection then |
| 294 | // attaches the overlay content channel onto Protomux.from(conn). |
| 295 | // Reuses the DeployServer's live FileIndex/manifest so trees added |
| 296 | // by the incremental rescan in publish-release are served here too. |
| 297 | try { this._deployServer.serveOnConnection(conn) } catch (err) { |
| 298 | console.error('[pgh-sidecar] registry-topic content serve (non-fatal):', err && err.message) |
| 299 | } |
| 284 | 300 | }) |
| 285 | 301 | this._registrySwarm.join(this._registry._base.discoveryKey, { server: true, client: true }) |
| 286 | 302 | await this._registrySwarm.flush() |