From 8186e68a2fa1d5c1626409ea87222a7dc5b1f3e1 Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Sun, 7 Jun 2026 05:34:10 -0300 Subject: [PATCH 1/3] feat(deploy/atomicassets): aa-feed service + persistence:full (Phase 2 Slice C) - wormdb.json: store.persistence none -> full, so the live overlay (the SHiP feed's forward overrides + add-sets + checkpoint) is WAL-backed and survives a wormdb-aa restart instead of being lost. - docker-compose: mount a named volume (aa-wormdb-data) at /var/lib/wormdb for that WAL/snapshot; add a curl healthcheck on wormdb-aa; add the `aa-feed` service (profile "feed"/"all") that builds the bun feed (../../../../wormdb/apps/bun Dockerfile.feed), waits for wormdb-aa healthy, and EXECs into wormdb-aa:6389 from a nodeos SHiP (host.docker.internal:28080) with a per-block checkpoint. Run the live stack with `docker compose --profile all up` (state + feed). FEED_START defaults to the snapshot block; on a node whose SHiP retention starts later the feed clamps to the available range (a backfill gap the H-tier covers in Phase 3). Validated live on Jungle 4: aa-feed tracks LIB (0 behind); restarting wormdb-aa replays the WAL (40974 records) and the feed resumes from the persisted checkpoint. --- deploy/atomicassets/docker-compose.yml | 33 ++++++++++++++++++++++++++ deploy/atomicassets/wormdb.json | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/deploy/atomicassets/docker-compose.yml b/deploy/atomicassets/docker-compose.yml index bfa255b..e0d88f5 100644 --- a/deploy/atomicassets/docker-compose.yml +++ b/deploy/atomicassets/docker-compose.yml @@ -72,6 +72,7 @@ services: AA_SEGMENT: /data/aa.wseg volumes: - aa-data:/data + - aa-wormdb-data:/var/lib/wormdb # WAL + snapshot (persistence:full) → overlay survives a restart - ./wormdb.json:/etc/wormdb.json:ro # Loopback-only. 6390 = HTTP read API (curl from the host); 6389 = WormWire (privileged exec/peer # wire) — the Phase-2 SHiP feed reaches it over the bridge, so neither needs off-host exposure. @@ -85,10 +86,42 @@ services: condition: service_completed_successfully networks: [aa-stack] profiles: ["state", "all"] + healthcheck: + # the bun feed (aa-feed) waits on this; the wormdb image ships curl, so probe the HTTP gateway. + test: ["CMD-SHELL", "curl -fsS http://localhost:6390/atomicassets/v1/config >/dev/null || exit 1"] + interval: 5s + timeout: 4s + retries: 30 + start_period: 8s + + # Phase 2: bun SHiP feed — keeps the overlay live from the Jungle 4 node (host.docker.internal). Built + # from the wormdb bun app; EXECs aa_mint/aa_transfer/aa_burn over WormWire into wormdb-aa:6389. + aa-feed: + build: + context: ../../../../wormdb/apps/bun + dockerfile: Dockerfile.feed + image: aa-stack/feed:latest + container_name: aa-feed + restart: on-failure + environment: + SHIP: ws://host.docker.internal:28080/ + CHAIN_API: http://host.docker.internal:28888 + CHAIN: ${CHAIN:-jungle4} + AA_CONTRACT: atomicassets + WORMHOST: wormdb-aa + PORT: "6389" + START: ${FEED_START:-269541093} # snapshot block; the per-block checkpoint overrides on restart + extra_hosts: *host_gw + depends_on: + wormdb-aa: + condition: service_healthy + networks: [aa-stack] + profiles: ["feed", "all"] volumes: mongo-data: aa-data: + aa-wormdb-data: networks: aa-stack: diff --git a/deploy/atomicassets/wormdb.json b/deploy/atomicassets/wormdb.json index 418ba0d..4ed9a25 100644 --- a/deploy/atomicassets/wormdb.json +++ b/deploy/atomicassets/wormdb.json @@ -1,6 +1,6 @@ { "data": "/var/lib/wormdb", - "store": { "persistence": "none" }, + "store": { "persistence": "full" }, "server": { "port": 6389 }, "gateway": { "enabled": true, "port": 6390 }, "auth": { "require_auth": false } From 40a1f2a6294338647db8c94ef0b21b1e0c091458 Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Sun, 7 Jun 2026 05:44:37 -0300 Subject: [PATCH 2/3] fix(deploy/atomicassets): parameterize aa-feed context + 127.0.0.1 healthcheck (PR #11 review) - aa-feed build context: the hardcoded ../../../../wormdb assumed this repo's local nesting; parameterize as ${WORMDB_DIR:-../../../wormdb}/apps/bun (default = wormdb as a SIBLING of this repo, the common layout) + document WORMDB_DIR + FEED_START in .env.example. - wormdb-aa healthcheck: localhost -> 127.0.0.1 (avoid an IPv6 ::1 resolution that the IPv4-only listener wouldn't answer). --- deploy/atomicassets/.env.example | 8 ++++++++ deploy/atomicassets/docker-compose.yml | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/deploy/atomicassets/.env.example b/deploy/atomicassets/.env.example index 0d0f470..87db09e 100644 --- a/deploy/atomicassets/.env.example +++ b/deploy/atomicassets/.env.example @@ -22,3 +22,11 @@ WORMDB_WIRE_PORT=6389 # Mongo WiredTiger cache (GiB). MONGO_CACHE_GB=2 + +# Path to the `wormdb` repo (for building the aa-feed image), RELATIVE to deploy/atomicassets. Default +# assumes wormdb is a SIBLING of this repo (…/wormdb beside …/hyperion-tools). Override for other layouts. +WORMDB_DIR=../../../wormdb + +# aa-feed start block. Default = the snapshot block; the feed clamps up to the node's SHiP retention if +# that block is older than the node still serves (the gap is the Phase-3 archive backfill's job). +FEED_START=269541093 diff --git a/deploy/atomicassets/docker-compose.yml b/deploy/atomicassets/docker-compose.yml index e0d88f5..2e2afa5 100644 --- a/deploy/atomicassets/docker-compose.yml +++ b/deploy/atomicassets/docker-compose.yml @@ -88,7 +88,7 @@ services: profiles: ["state", "all"] healthcheck: # the bun feed (aa-feed) waits on this; the wormdb image ships curl, so probe the HTTP gateway. - test: ["CMD-SHELL", "curl -fsS http://localhost:6390/atomicassets/v1/config >/dev/null || exit 1"] + test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:6390/atomicassets/v1/config >/dev/null || exit 1"] interval: 5s timeout: 4s retries: 30 @@ -98,7 +98,9 @@ services: # from the wormdb bun app; EXECs aa_mint/aa_transfer/aa_burn over WormWire into wormdb-aa:6389. aa-feed: build: - context: ../../../../wormdb/apps/bun + # Default assumes `wormdb` is a SIBLING of this repo (…/hyperion-tools + …/wormdb). For a different + # layout, set WORMDB_DIR in .env to the wormdb repo path relative to this compose file's directory. + context: ${WORMDB_DIR:-../../../wormdb}/apps/bun dockerfile: Dockerfile.feed image: aa-stack/feed:latest container_name: aa-feed From 59bb4d7cfa8cddce7d28d054b6e21a1952a3bc5c Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Sun, 7 Jun 2026 05:49:51 -0300 Subject: [PATCH 3/3] fix(deploy/atomicassets): aa-feed in the 'all' profile only (PR #11 review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aa-feed depends_on wormdb-aa, which is in state/all. A standalone `--profile feed` project would include aa-feed but ignore wormdb-aa (per Docker's profiles rules: ignored services aren't auto-enabled by a depends_on reference), making the project invalid. Adding "feed" to the whole dependency chain (wormdb-aa -> aa-loader -> mongodb) would just make "feed" == "all". So drop the standalone "feed" profile: aa-feed is in "all" only. Run the live stack: `docker compose --profile all up`. Attach just the feed to a running state stack: `docker compose --profile all up -d aa-feed` (named service → deps resolve without restarting them). Static snapshot only: `--profile state up`. --- deploy/atomicassets/docker-compose.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/atomicassets/docker-compose.yml b/deploy/atomicassets/docker-compose.yml index 2e2afa5..33224cc 100644 --- a/deploy/atomicassets/docker-compose.yml +++ b/deploy/atomicassets/docker-compose.yml @@ -96,6 +96,11 @@ services: # Phase 2: bun SHiP feed — keeps the overlay live from the Jungle 4 node (host.docker.internal). Built # from the wormdb bun app; EXECs aa_mint/aa_transfer/aa_burn over WormWire into wormdb-aa:6389. + # In the "all" profile only (NOT a standalone "feed" profile): it depends_on wormdb-aa, which is in + # state/all, so a `--profile feed`-only project would reference an ignored service and be invalid. Run + # the live stack with `docker compose --profile all up`; attach just the feed to a running state stack + # with `docker compose --profile all up -d aa-feed` (the named service resolves its deps without + # restarting them); `docker compose --profile state up` serves the static snapshot without the feed. aa-feed: build: # Default assumes `wormdb` is a SIBLING of this repo (…/hyperion-tools + …/wormdb). For a different @@ -118,7 +123,7 @@ services: wormdb-aa: condition: service_healthy networks: [aa-stack] - profiles: ["feed", "all"] + profiles: ["all"] volumes: mongo-data: