Research: any-sync and Mātou's config server on the gateway — node types, NixOS packaging, resource floor, secrets/rescue, install-later #1314

Closed
opened 2026-09-08 05:11:42 +00:00 by ben · 2 comments
Owner

Parent

Map: The community wallet: matou-app holds and presents IDIP credentials, and the Coa and IDSS setups are paired (#1293)

Question

ADR 0226 (ticket #1295) installs any-sync on the gateway when Coa is chosen — a Coa-built wallet's community spaces live there — and always installs Mātou's config server on the IDIP path. Research, first-hand (~/Documents/1.projects/matou-infrastructure — docker-compose*.yml, client-external.yml, the any-sync node configs, config-server.py; ~/Documents/1.projects/matou-app/backend — what the Go backend does with the anysync block at startup and at org-setup step 9/10 (useOrgSetup.ts), DeriveSpaceKeySet, identity/set, spaces API; upstream any-sync repos (anyproto/any-sync, any-sync-node, any-sync-coordinator, any-sync-filenode, any-sync-consensusnode, any-sync-dockercompose); this repo's internal/clan/keri.go for how the KERI units are rendered and the gateway's resource floor (ADR 0184 capacity, DDR 0207 KERIA pins, research 2026-08-24-keria-stack-on-nixos.md §6 for the 4 GB floor)):

  1. What a minimal any-sync backend is for one community: which node types are mandatory (coordinator, sync node, file node, consensus node?), their ports, their config/network files (network.yml, node keys, the coordinator's account), how a client anysync block is minted from them (config-server.py in coa mode reads /etc/anysync/client-external.yml), and what storage they need (S3/MinIO for filenode? local?).
  2. Packaging on NixOS: anything in nixpkgs? Go modules buildable with buildGoModule (versions, vendor hashes), or an OCI image path (does the gateway run containers at all — check internal/clan for docker/podman — and what ADR 0062's three-part port pattern would make of it).
  3. Resource floor beside KERIA + witness + schema server + config server + idss-idp on the smallest gateway IDSS supports (ADR 0184): memory/CPU/disk of the any-sync nodes at idle and under one community's load; what the 4 GB floor becomes.
  4. Keys and rescue: what secrets the nodes hold (node keys, coordinator account, network id), whether they are re-derivable or must join the ADR 0201 backup dataset, and what a wallet loses if the any-sync nodes are lost but KERI survives.
  5. The config server unit: config-server.py's runtime deps, its data dir, the admin-token write path (POST /api/config, POST /admin/tenants), what PUBLIC_BASE_URL/EXTERNAL_* it needs on a gateway, single-tenant vs tenant mode, and what a 1.1 bump (ADR 0226 decision 5) touches in it.
  6. Install-later: what "install any-sync from the catalogue after founding" needs that founding-time install does not (re-rendering the descriptor's anysync block; the app backend's behaviour when the block appears later).

Output: docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md with a units table (unit → package path → ports → secrets → floor) and the dead ends; every claim cited; no decisions. Blocks the IDSS-first pairing grill (#1296).

## Parent Map: [The community wallet: matou-app holds and presents IDIP credentials, and the Coa and IDSS setups are paired](https://git.matou.nz/Matou/idss/issues/1293) (#1293) ## Question ADR 0226 (ticket #1295) installs **any-sync on the gateway when Coa is chosen** — a Coa-built wallet's community spaces live there — and always installs Mātou's **config server** on the IDIP path. Research, first-hand (`~/Documents/1.projects/matou-infrastructure` — `docker-compose*.yml`, `client-external.yml`, the any-sync node configs, `config-server.py`; `~/Documents/1.projects/matou-app/backend` — what the Go backend does with the `anysync` block at startup and at org-setup step 9/10 (`useOrgSetup.ts`), `DeriveSpaceKeySet`, `identity/set`, spaces API; upstream any-sync repos (anyproto/any-sync, any-sync-node, any-sync-coordinator, any-sync-filenode, any-sync-consensusnode, any-sync-dockercompose); this repo's `internal/clan/keri.go` for how the KERI units are rendered and the gateway's resource floor (ADR 0184 capacity, DDR 0207 KERIA pins, research `2026-08-24-keria-stack-on-nixos.md` §6 for the 4 GB floor)): 1. **What a minimal any-sync backend is** for one community: which node types are mandatory (coordinator, sync node, file node, consensus node?), their ports, their config/network files (`network.yml`, node keys, the coordinator's account), how a client `anysync` block is minted from them (`config-server.py` in coa mode reads `/etc/anysync/client-external.yml`), and what storage they need (S3/MinIO for filenode? local?). 2. **Packaging on NixOS**: anything in nixpkgs? Go modules buildable with `buildGoModule` (versions, vendor hashes), or an OCI image path (does the gateway run containers at all — check `internal/clan` for docker/podman — and what ADR 0062's three-part port pattern would make of it). 3. **Resource floor** beside KERIA + witness + schema server + config server + idss-idp on the smallest gateway IDSS supports (ADR 0184): memory/CPU/disk of the any-sync nodes at idle and under one community's load; what the 4 GB floor becomes. 4. **Keys and rescue**: what secrets the nodes hold (node keys, coordinator account, network id), whether they are re-derivable or must join the ADR 0201 backup dataset, and what a wallet loses if the any-sync nodes are lost but KERI survives. 5. **The config server unit**: `config-server.py`'s runtime deps, its data dir, the admin-token write path (`POST /api/config`, `POST /admin/tenants`), what `PUBLIC_BASE_URL`/`EXTERNAL_*` it needs on a gateway, single-tenant vs tenant mode, and what a `1.1` bump (ADR 0226 decision 5) touches in it. 6. **Install-later**: what "install any-sync from the catalogue after founding" needs that founding-time install does not (re-rendering the descriptor's `anysync` block; the app backend's behaviour when the block appears later). Output: `docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md` with a units table (unit → package path → ports → secrets → floor) and the dead ends; every claim cited; no decisions. Blocks the IDSS-first pairing grill (#1296).
ben self-assigned this 2026-09-08 05:11:48 +00:00
Author
Owner

Claimed 2026-09-08 (map session). Research subagent fired inline; findings land on branch research/anysync-and-config-server-on-the-gateway as docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md (laptop checkout, unpushed until reviewed).

Claimed 2026-09-08 (map session). Research subagent fired inline; findings land on branch `research/anysync-and-config-server-on-the-gateway` as `docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md` (laptop checkout, unpushed until reviewed).
Author
Owner

Resolution (research, 2026-09-08)

Findings: docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md on branch research/anysync-and-config-server-on-the-gateway (commit c6acd470, laptop checkout, unpushed): units table §7, dead ends §8, every claim cited. No decisions. Facts that matter for ADR 0226 decision 8 and the IDSS-first grill (#1296):

  1. Minimal node set for one community: coordinator + ≥1 sync ("tree") node + consensus node + a single-member MongoDB replica set (the coordinator runs Mongo transactions; ACL writes go through consensusclient, so consensus is mandatory for every invite/join). The file node (+ Redis-with-Bloom + S3/MinIO) is needed only for file bytes and degrades loud without it. go-chash clamps replication to member count, so a 1-tree network is library-valid — never run.
  2. any-sync is load-bearing DAILY, not just at org-setup. The wallet's Go backend refuses to start if the coordinator does not answer a 5 s ping (app.go:266-286, every env); every member's first identity/set creates a private space; profiles, notices, chat, contributions, projects and files are all any-sync object trees. KERI-only surfaces are just sign-in and credentials. → "any-sync when Coa is chosen" is the right ruling; a wallet against a KERI-only backend is not a working app.
  3. NixOS packaging: builds from source. Nothing in nixpkgs, but all five upstream repos (node 0.13.1, coordinator/filenode/consensus 0.13.0, tools 0.6.1) built on the repo's pinned nixpkgs with buildGoModule, CGO_ENABLED=0, -tags nographviz — static 21–47 MB binaries, vendorHashes recorded. One pinch: filenode's go 1.26.4 directive vs nixpkgs 1.26.3. The stores are the real cost: MongoDB is SSPL/unfree; nixpkgs redis lacks the Bloom module the filenode's BF.* calls need → podman OCI images (the archive port's shape) is the alternative.
  4. Floor: live coa-shared readings (2 vCPU / 3.9 GB): any-sync daemons ≈ 133 MiB idle, stores ≈ 258 MiB (Mongo 146, MinIO 107). Beside KERIA/witness/schema/config-server the any-sync half adds ≈ 0.2 GiB minimal, ≈ 0.4 GiB with the file node — the 4 GB floor holds on memory; CPU under load on 2 vCPU is unmeasured anywhere.
  5. Keys/rescue: network signing key + network id + six node account keys (none re-derivable; regenerate = a new network every wallet must re-fetch) + Mongo (space registry + ACL log) + the file store — no re-derive-from-a-phrase rung; these must join the ADR 0201 dataset. If nodes are lost but KERI survives: identities/memberships stand; content survives only as members' local copies; community/read-only/admin space IDs are random; re-seeding a rebuilt network from devices is unverified.
  6. Config server unit: one 837-line stdlib-Python file, pyyaml optional, flake8-clean under keri.go's ignore list → writePython3Bin like keri-schema; state = /data/org-config.json (+ tenants dir); GET /api/health = the ADR 0112 check; admin token fails closed in prod/coa mode.
  7. Neither of its URL layouts mints the gateway's doors (raw-port → host:3901; PUBLIC_BASE_URL → path prefixes; the gateway uses keria.<apex> hostnames) and the six demo witness AIDs are hard-coded → the 1.1 bump needs per-door URL env + witness AIDs from a file. The server-side anysync block is already optional (the hard requirement is the wallet's).
  8. Install-later: trivial server-side (write the YAML; re-read per request), but the wallet has no path to create a member's private space or the community spaces after the fact, and org-config.json is first-write-wins. → "Coa later from the catalogue" needs an app-side "spaces bootstrap" that does not exist.
  9. Ports: any-sync is yamux over raw TCP (client config carries TCP addresses only); it cannot ride Caddy 443 → the gateway grows public TCP ports for coordinator/tree/file (the mail-port precedent).
  10. Dead ends: no load numbers exist anywhere; client 0.11.9 ↔ nodes 0.13.x compatibility untested; 1-tree network untested; the Aug "path prefixes don't work" finding vs coa-shared's proven handle_path layout never compared on the same KERIA version.
## Resolution (research, 2026-09-08) Findings: `docs/research/2026-09-08-anysync-and-config-server-on-the-gateway.md` on branch `research/anysync-and-config-server-on-the-gateway` (commit `c6acd470`, laptop checkout, unpushed): units table §7, dead ends §8, every claim cited. No decisions. Facts that matter for ADR 0226 decision 8 and the IDSS-first grill (#1296): 1. **Minimal node set for one community:** coordinator + ≥1 sync ("tree") node + consensus node + a single-member MongoDB replica set (the coordinator runs Mongo transactions; ACL writes go through `consensusclient`, so consensus is mandatory for every invite/join). The file node (+ Redis-with-Bloom + S3/MinIO) is needed only for file bytes and degrades loud without it. `go-chash` clamps replication to member count, so a 1-tree network is library-valid — never run. 2. **any-sync is load-bearing DAILY, not just at org-setup.** The wallet's Go backend refuses to start if the coordinator does not answer a 5 s ping (`app.go:266-286`, every env); every member's first `identity/set` creates a private space; profiles, notices, chat, contributions, projects and files are all any-sync object trees. KERI-only surfaces are just sign-in and credentials. → "any-sync when Coa is chosen" is the right ruling; a wallet against a KERI-only backend is not a working app. 3. **NixOS packaging: builds from source.** Nothing in nixpkgs, but all five upstream repos (node 0.13.1, coordinator/filenode/consensus 0.13.0, tools 0.6.1) built on the repo's pinned nixpkgs with `buildGoModule`, `CGO_ENABLED=0`, `-tags nographviz` — static 21–47 MB binaries, vendorHashes recorded. One pinch: filenode's `go 1.26.4` directive vs nixpkgs 1.26.3. The **stores are the real cost**: MongoDB is SSPL/unfree; nixpkgs `redis` lacks the Bloom module the filenode's `BF.*` calls need → podman OCI images (the archive port's shape) is the alternative. 4. **Floor:** live coa-shared readings (2 vCPU / 3.9 GB): any-sync daemons ≈ 133 MiB idle, stores ≈ 258 MiB (Mongo 146, MinIO 107). Beside KERIA/witness/schema/config-server the any-sync half adds ≈ 0.2 GiB minimal, ≈ 0.4 GiB with the file node — the 4 GB floor holds on memory; **CPU under load on 2 vCPU is unmeasured anywhere.** 5. **Keys/rescue:** network signing key + network id + six node account keys (none re-derivable; regenerate = a new network every wallet must re-fetch) + Mongo (space registry + ACL log) + the file store — **no re-derive-from-a-phrase rung**; these must join the ADR 0201 dataset. If nodes are lost but KERI survives: identities/memberships stand; content survives only as members' local copies; community/read-only/admin space IDs are random; re-seeding a rebuilt network from devices is unverified. 6. **Config server unit:** one 837-line stdlib-Python file, `pyyaml` optional, flake8-clean under `keri.go`'s ignore list → `writePython3Bin` like `keri-schema`; state = `/data/org-config.json` (+ tenants dir); `GET /api/health` = the ADR 0112 check; admin token fails closed in prod/coa mode. 7. **Neither of its URL layouts mints the gateway's doors** (raw-port → `host:3901`; `PUBLIC_BASE_URL` → path prefixes; the gateway uses `keria.<apex>` hostnames) and the six demo witness AIDs are hard-coded → the `1.1` bump needs per-door URL env + witness AIDs from a file. The server-side `anysync` block is already optional (the hard requirement is the wallet's). 8. **Install-later:** trivial server-side (write the YAML; re-read per request), but **the wallet has no path to create a member's private space or the community spaces after the fact**, and `org-config.json` is first-write-wins. → "Coa later from the catalogue" needs an app-side "spaces bootstrap" that does not exist. 9. **Ports:** any-sync is yamux over raw TCP (client config carries TCP addresses only); it cannot ride Caddy 443 → the gateway grows public TCP ports for coordinator/tree/file (the mail-port precedent). 10. **Dead ends:** no load numbers exist anywhere; client 0.11.9 ↔ nodes 0.13.x compatibility untested; 1-tree network untested; the Aug "path prefixes don't work" finding vs coa-shared's proven `handle_path` layout never compared on the same KERIA version.
ben closed this issue 2026-09-08 13:27:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1314
No description provided.