Arseniy Klempner 9d368aeb44
build: add Docker image + GHCR for cross-platform simulation testing
Multi-stage Dockerfile pre-builds all heavy nix dependencies. Runtime
image (~8.5GB) at ghcr.io/adklempner/logos-chat-sim:latest includes
nix store closure + Rust + cargo-risczero/r0vm + system clang.

run_in_docker.sh pulls from GHCR, symlinks pre-built modules, builds
sequencer + run_setup from source (~10 min per run).

Update vendor/logos-lez-rln to a591645 (rebased onto main with
member-expiry merged, single squashed commit).

Add INSTRUCTIONS.md with macOS, Linux (native), and Docker instructions.
2026-05-11 18:30:28 -06:00

2.9 KiB

Running the Mix + LEZ RLN Chat Simulation

End-to-end private chat between two logos-chat-module clients over a 4-node mix network with LEZ-backed RLN spam protection.

Two logoscore instances (sender + receiver) establish an X3DH key agreement via an out-of-band intro bundle, then exchange double-ratchet-encrypted messages routed through 3-hop Sphinx onion routes with per-hop RLN proof generation and verification. Node 0 mounts the rln_gifter service; nodes 1-3 and both chat clients register RLN memberships on-chain via the gifter protocol. The sender publishes via lightpushPublish(mixify=true), the mix exit node verifies the RLN proof before fanning out via gossipsub relay, and the receiver consumes the message via a Waku filter subscription.

macOS

Prereqs: nix (with flakes), Docker, cargo-risczero, SSH access to GitHub.

git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git
cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh

First run: ~15-25 min. Re-runs: bash simulations/mix_lez_chat/run_simulation.sh --fresh (~5 min).

Linux (native)

Prereqs: nix (with flakes), Docker, cargo-risczero, SSH access to GitHub.

git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git
cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh

Same as macOS. On x86_64 Linux this should work out of the box. On aarch64 Linux, guest zkVM binaries must be pre-built on another platform (rzup doesn't support aarch64-linux) and the wallet module nix build needs RISC0_SKIP_BUILD_KERNELS=1.

Linux (via Docker)

Prereqs: Docker.

git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git
cd logos-chat && bash scripts/run_in_docker.sh

The pre-built image (ghcr.io/adklempner/logos-chat-sim) is pulled automatically (~8.5GB download). Guest zkVM binaries must exist on the host from a previous macOS/x86_64 build, or set GUEST_BINARIES_DIR.

Each sim run: ~10 min (clone + sequencer build + sim). To force a local image rebuild: REBUILD_IMAGE=1 bash scripts/run_in_docker.sh.

Pass criteria

ALL 15 CHECKS PASSED — 4 mix nodes mounted, gifter service, LEZ RLN active, sender+receiver initialized/started/mix-mounted, intro bundle created, messages sent and received.

Configuration

SIM_LOG_LEVEL=TRACE SIM_KADEMLIA_MIN_WAIT=10 bash simulations/mix_lez_chat/run_simulation.sh --fresh

Full list of SIM_* variables in simulations/mix_lez_chat/README.md.

If it fails

Re-run with fresh state:

bash simulations/mix_lez_chat/run_simulation.sh --fresh

Wallet/sequencer errors:

rm -f vendor/logos-lez-rln/dev/wallet_config.json vendor/logos-lez-rln/dev/storage.json

Guest binary errors after updating submodules:

rm -rf vendor/logos-lez-rln/lez-rln/methods/guest/target
bash simulations/mix_lez_chat/setup_and_run.sh

Docker logs are rescued to ./docker-sim-logs/ on failure.