| … | … | @@ -123,6 +123,19 @@ if (cfg.swarm) { |
| 123 | 123 | const shutdownM = async () => { try { await daemon.close() } catch {} ; process.exit(0) } |
| 124 | 124 | process.on('SIGINT', shutdownM) |
| 125 | 125 | process.on('SIGTERM', shutdownM) |
| 126 | |
| 127 | // Sidecar registration — THIS is the path the fleet runs (multi-DID). Without it the sidecar has no |
| 128 | // udsPath for hpp and cannot push `release-ready`, so autoupdate installs a tree the daemon never |
| 129 | // adopts. The primary DID's control.sock is the one to register: `pgh app status` and the OTA push |
| 130 | // both resolve through it. Best-effort; a management failure must not stop the daemon serving. |
| 131 | try { |
| 132 | const { maintainSidecarRegistration } = await import('./lib/sidecar.js') |
| 133 | const ctl = join(cfg.storage, 'control.sock') |
| 134 | maintainSidecarRegistration({ udsPath: ctl, name: process.env.PGH_APP_NAME || 'hyper-proto-peer', runtime: 'bare', version: null }) |
| 135 | console.log(JSON.stringify({ msg: 'sidecar registration armed', uds: ctl })) |
| 136 | } catch (e) { |
| 137 | console.error(JSON.stringify({ msg: 'sidecar registration unavailable (non-fatal)', error: e.message })) |
| 138 | } |
| 126 | 139 | } else { |
| 127 | 140 | const node = await bootSwarmDevice({ |
| 128 | 141 | storage: cfg.storage, |