OverviewFilesCommitsIssuesDocsReleasesPeers

pgh-sidecar commits / eddb4bf

0.2.37: serve tree content on the shared registry topic (multi-source)
In the _registrySwarm connection handler, after registryStore.replicate (conn), also call deployServer.serveOnConnection(conn) so the sidecar seeds blake2b-addressed tree content on the SHARED registry discoveryKey topic, muxed onto the registry-replication connection (keet many-protocols-one-connection). Any sidecar replicating the registry now also serves its content — torrent-style multi-source distribution, no addWriter needed (content needs bytes, not autobase writership). Keeps the existing identity-topic DeployServer for backward-compat with already-published releases (serverKey = identity.publicKey). Reuses the DeployServer's live FileIndex/manifest, so trees added by the incremental rescan in publish-release are served on the registry topic too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eddb4bf294f7c95b673abcd814d190764c8ffb2e
by plankatron <fleeky@gmail.com> · 2026-06-18T00:42:35.000Z

Changed files (2) +17 -1

lib/index.js +16 -0
……@@ -281,6 +281,22 @@ export class Sidecar {
281281 this._registrySwarm.on('connection', (conn) => {
282282 conn.on('error', () => {}) // absorb ECONNRESET from disconnecting peers
283283 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 }
284300 })
285301 this._registrySwarm.join(this._registry._base.discoveryKey, { server: true, client: true })
286302 await this._registrySwarm.flush()
package.json +1 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "pgh-sidecar",
3 "version": "0.2.36",
3 "version": "0.2.37",
44 "description": "Small optional user-level daemon for pgh — shared identity vault, OTA polling, device linking, bootstrap seed, NameRegistry host",
55 "type": "module",
66 "main": "lib/index.js",