Files
NagyZoltanPeterandClaude Opus 4.8 0d433ea83f feat(compose): add logosdeliverynode docker-compose stack (#4057)
* feat(compose): add logosdeliverynode docker-compose stack

Add apps/logos_delivery_node/compose/, a docker-compose project that runs the
logosdeliverynode image (built from the repo Dockerfile) as a service node with
a Postgres store and a Prometheus + Grafana monitoring stack. Ported from
logos-messaging/logos-delivery-compose and adapted for logosdeliverynode:

- Network selection via --preset (default logos.dev) and --entry-layer (default
  kernel), both configurable through PRESET / ENTRY_LAYER env vars.
- Postgres-backed store; node startup gated on the postgres healthcheck to avoid
  a crash-loop on connection-refused.
- WebSocket-Secure via certbot, enabled only when DOMAIN is explicitly set (no
  reverse-DNS auto-guess, which could deadlock the node waiting for a cert).
- --mix=true passed explicitly (the preset alone sets the flag but does not mount
  the mix protocol).
- Grafana branded with the Logos mark; dashboard file named
  logos-delivery-monitoring.json.
- RLN, setup_wizard and RLN keystore tooling intentionally omitted for now.

Also exclude /nimbledeps and /build from the Docker build context: a populated
host nimbledeps/ leaks into the context and has its package submodules stripped
by the **/vendor/* rule, breaking the in-container `make build-deps`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(ci): keep build/ in docker context; serialize container-image builds

Two fixes for the docker-build-ubuntu-22.04 job:

- .dockerignore: drop /build. docker/binaries/Dockerfile.bn.amd64 ADDs the
  freshly compiled binaries from ./build/, so ignoring it makes the docker
  build fail deterministically with '"/build/wakunode2": not found'.
  /nimbledeps stays ignored (that was the actual context-bloat culprit).

- container-image.yml: build wakunode2 and logosdeliverynode in sequential
  make invocations. Under a single `make -j` the two `nimble <task>`
  invocations re-resolve git deps concurrently and clobber each other in
  the shared ~/.nimble/pkgcache. Same fix as ci.yml's -j1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Review fixes: dashboard typo, missing target for docker build, env.example adjustment
2026-08-14 03:14:40 +02:00
..

logosdeliverynode compose

A docker compose project that runs a logosdeliverynode as a full service node on the Logos Dev network (--preset=logos.dev), backed by Postgres store and a Prometheus + Grafana monitoring stack.

It mirrors the logos-delivery-compose approach, adapted for the logosdeliverynode binary. RLN, the setup wizard and RLN keystore tooling are intentionally omitted for now.

Services

Service Purpose
logos-messaging-node The logosdeliverynode itself (relay + store + filter/lightpush)
postgres Persistent message store (--store-message-db-url)
postgres-exporter Exposes Postgres metrics to Prometheus
prometheus Scrapes node (:8003) and postgres-exporter
grafana Dashboards (http://localhost:3000, anonymous admin)
certbot Optional Let's Encrypt certs for WebSocket-Secure (needs DOMAIN)

Quick start

cd apps/logos_delivery_node/compose
cp .env.example .env          # edit POSTGRES_PASSWORD etc.

# Build the logosdeliverynode image from the repo Dockerfile
# (or set LOGOS_IMAGE in .env to a prebuilt image and skip this)
docker compose build

docker compose up -d
docker compose logs -f logos-messaging-node

Check node health:

./chkhealth.sh                # queries http://localhost:8645/health

Configuration

The node command lives in run_node.sh. Network parameters (cluster id, sharding, bootstrap nodes, RLN off) come from the network preset, logos.dev by default. The top API layer defaults to kernel (transport only; the messaging / reliable-channel REST layers are not mounted). Both are configurable via .env — see PRESET / ENTRY_LAYER below.

Key .env values:

Variable Default Meaning
PRESET logos.dev Network preset: logos.dev, logos.test, twn, status.prod. Empty = no preset (set cluster/shards via EXTRA_ARGS)
ENTRY_LAYER kernel Top API layer: kernel (transport only), messaging, or channels
LOGOS_IMAGE (build) Prebuilt image; empty builds locally
POSTGRES_USER / _PASSWORD postgres / test123 Store DB credentials
NODEKEY (random) Stable P2P identity (64 char hex)
DOMAIN (empty) Public domain for WebSocket-Secure; empty disables WSS
STORAGE_SIZE 1GB Store retention size
EXTRA_ARGS (empty) Extra CLI flags appended to the node

Helper scripts set_postgres_shm.sh and set_storage_retention.sh can append tuned POSTGRES_SHM / STORAGE_SIZE values to .env based on the host.

Ports

Port Service Notes
30304 tcp/udp node libp2p
9005 udp node discv5
8000 tcp node WebSocket-Secure
8645 node REST bound to 127.0.0.1
8003 node metrics bound to 127.0.0.1
3000 grafana
80 certbot ACME HTTP-01