From abe663f72ccc402e5760c58f3cd24b31b8021da6 Mon Sep 17 00:00:00 2001 From: Darshan <35736874+darshankabariya@users.noreply.github.com> Date: Sat, 11 Apr 2026 02:12:05 +0530 Subject: [PATCH] chore: upgrade (#120) --- README.md | 100 +++++-- book.toml | 14 +- docker-compose.yml | 16 +- monitoring/prometheus-config.yml | 400 +++++++++++++------------- src/SUMMARY.md | 22 +- src/connect-full-node.md | 7 +- src/connect-light-node.md | 8 +- src/connect-spam-node.md | 9 +- src/connect-store-node.md | 8 +- src/deploy-waku-network.md | 32 ++- src/inject-traffic.md | 7 +- src/intro-logos-delivery-simulator.md | 52 ++++ src/intro-waku-simulator.md | 19 -- src/register-memberships.md | 7 +- tools/rest-traffic/traffic.py | 4 +- wakusim.env | 4 +- 16 files changed, 407 insertions(+), 302 deletions(-) create mode 100644 src/intro-logos-delivery-simulator.md delete mode 100644 src/intro-waku-simulator.md diff --git a/README.md b/README.md index ffe5d25..dfd2890 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,103 @@ -# waku-simulator +# logos-delivery-simulator -Check πŸ“– [The Waku Simulator Book](https://waku-org.github.io/waku-simulator/)πŸ“– +A self-contained protocol simulator for [logos-delivery](https://github.com/logos-messaging/logos-delivery) β€” the Nim implementation of a libp2p protocol suite for private, censorship-resistant peer-to-peer messaging. + +On `docker-compose up`, the simulator orchestrates a network of `logos-delivery` nodes inside Docker (default 5, upper bound around 200), launches a private Anvil blockchain, deploys an RLN contract, registers an RLN membership for every node, and brings up a Grafana + Prometheus + cAdvisor + Epirus block-explorer stack pre-wired to the network. The whole thing runs on an isolated Docker bridge with cluster id `66`, so it cannot accidentally talk to any production fleet. + +πŸ“– Full tutorials live in **[The Logos Delivery Simulator Book](https://logos-messaging.github.io/logos-delivery-simulator/)**. + +## Prerequisites + +- `docker` and `docker-compose` v2 (tested with v2.28.1; v1 is **not** supported) +- Linux or macOS host with at least a few GB of free RAM (scales with `NUM_LD_NODES`) ## Quickstart -``` -git clone https://github.com/waku-org/waku-simulator.git -cd waku-simulator +```bash +git clone https://github.com/logos-messaging/logos-delivery-simulator.git +cd logos-delivery-simulator ``` -Configure the simulation parameters. You can place the env variable in an `.env` file. +Configure the simulation. Either `export` the variables in your shell or drop them in a local `.env` file (gitignored) β€” `docker-compose` picks `.env` up automatically. -``` -export NWAKU_IMAGE=quay.io/wakuorg/nwaku-pr:2759-rln-v2 -export NUM_NWAKU_NODES=5 +```bash +# Image & network size +export LD_IMAGE=wakuorg/nwaku:latest +export NUM_LD_NODES=5 + +# Traffic injector (rest-traffic service) export TRAFFIC_DELAY_SECONDS=15 export MSG_SIZE_KBYTES=10 -export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -export ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 + +# RLNv2 limits export RLN_RELAY_EPOCH_SEC=10 export RLN_RELAY_MSG_LIMIT=2 -export MAX_MESSAGE_LIMIT=100 # Contract's message limit. Needs to be higher or equal than RLN_RELAY_MSG_LIMIT, otherwise nodes won't start correctly. +export MAX_MESSAGE_LIMIT=100 # contract-side cap; must be >= RLN_RELAY_MSG_LIMIT + +# Foundry / contract deployment +export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 +export ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 ``` -Run the following command +Bring everything up: + +```bash +docker-compose up -d ``` -docker compose up -d + +After a couple of minutes the stack is ready. Open: + +| URL | What it is | +|---|---| +| | Block explorer (Epirus, fronted by nginx) | +| | Grafana β€” pre-wired dashboards for the simulated network | +| | REST API of the bootstrap node (each `nwaku_N` container also exposes its own) | + +To follow logs from a specific node: + +```bash +# Stream all nwaku replicas merged +docker-compose logs -f nwaku + +# Or a specific replica (index = the N in logos-delivery-simulator_nwaku_N) +docker-compose logs -f --index=1 nwaku ``` -(tested with Docker Compose version v2.28.1. Notice that we don't support docker compose v1) -## Warning +## What you can do with it -In case arp tables are overflowing: +Each tutorial in the book targets one libp2p protocol implemented in `logos-delivery`: - ``` - sysctl net.ipv4.neigh.default.gc_thresh3=32000 - ``` +| Tutorial | Protocol exercised | +|---|---| +| [Inject traffic](https://logos-messaging.github.io/logos-delivery-simulator/inject-traffic.html) | Relay (gossipsub) + REST publish | +| [Connect external full node](https://logos-messaging.github.io/logos-delivery-simulator/connect-full-node.html) | Relay + RLN membership | +| [Connect external spam node](https://logos-messaging.github.io/logos-delivery-simulator/connect-spam-node.html) | RLN spam protection + peer scoring | +| [Connect external light node](https://logos-messaging.github.io/logos-delivery-simulator/connect-light-node.html) | Lightpush + RLN proofs from contract | +| [Connect external store node](https://logos-messaging.github.io/logos-delivery-simulator/connect-store-node.html) | Store (historical message retrieval) | +| [Register memberships](https://logos-messaging.github.io/logos-delivery-simulator/register-memberships.html) | RLN membership registration on the contract | + +## A note on naming + +`logos-delivery` was previously called **nwaku**, and Logos Messaging is a rebrand of the Waku project. Legacy names are still in flight upstream β€” the binary is `wakunode2`, the Docker image is published as `wakuorg/nwaku`, the Docker Compose service is named `nwaku`, and module paths under `logos-delivery/waku/...` keep the old prefix. These all refer to the same thing. This repo's own variables (`LD_IMAGE`, `NUM_LD_NODES`) and docs use the new naming. + +## Troubleshooting + +If your kernel ARP table overflows (common with `NUM_LD_NODES` > ~50): + +```bash +sysctl net.ipv4.neigh.default.gc_thresh3=32000 +``` # Infrastructure An instance of this service is deployed at https://simulator.waku.org/. -It is configured using [`wakusim.env`](./wakusim.env) file, and new changes to this repository are picked up using a [GitHub webhook handler](https://github.com/status-im/infra-role-github-webhook). -The docker images used are updated using [Watchtower](https://github.com/containrrr/watchtower) as well. +It is configured using the [`wakusim.env`](./wakusim.env) file, and new changes to this repository are picked up using a [GitHub webhook handler](https://github.com/status-im/infra-role-github-webhook). The docker images used are updated using [Watchtower](https://github.com/containrrr/watchtower) as well. For details on how it works please read the [Ansible role readme file](https://github.com/status-im/infra-misc/blob/master/ansible/roles/waku-simulator/). The original deployment issue can be found [here](https://github.com/status-im/infra-nim-waku/issues/79). -The deployed branch is [deploy-wakusim](https://github.com/waku-org/waku-simulator/tree/deploy-wakusim). +The deployed branch is [deploy-wakusim](https://github.com/logos-messaging/logos-delivery-simulator/tree/deploy-wakusim). + +## License + +Dual-licensed under [Apache 2.0](./LICENSE-APACHE) and [MIT](./LICENSE-MIT). diff --git a/book.toml b/book.toml index c630463..caa2e03 100644 --- a/book.toml +++ b/book.toml @@ -1,12 +1,12 @@ [book] -authors = ["waku-org"] +authors = ["logos-messaging"] language = "en" -multilingual = false src = "src" -title = "Waku Simulator Book" -description = "A brief description of your book." +title = "Logos Delivery Simulator Book" +description = "Documentation for the Logos Delivery Simulator." [output.html] -git-repository-url = "https://github.com/waku-org/waku-simulator" -git-repository-icon = "fa-github" -edit-url-template = "https://github.com/waku-org/waku-simulator/edit/master/{path}" +git-repository-url = "https://github.com/logos-messaging/logos-delivery-simulator" +edit-url-template = "https://github.com/logos-messaging/logos-delivery-simulator/edit/master/{path}" +default-theme = "coal" +preferred-dark-theme = "coal" diff --git a/docker-compose.yml b/docker-compose.yml index c28cdd9..825e26e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ networks: services: # Accounts are hardcoded to 520 with the idea that nwaku nodes use up to 500 for membership registration and the last 20 are used for ad-hoc testing. -# The account number and private key pairs of the last 20 accounts can be found in the Register memberships section of the Waku-simulator book. +# The account number and private key pairs of the last 20 accounts can be found in the Register memberships section of the Logos Delivery Simulator book. foundry: image: ghcr.io/foundry-rs/foundry:nightly-9b73e06e1fe376738b92ae081107620291d50188 labels: @@ -44,7 +44,7 @@ services: - PRIVATE_KEY=${PRIVATE_KEY} - RPC_URL=${RPC_URL:-http://foundry:8545} - ETH_FROM=${ETH_FROM} - - NUM_NWAKU_NODES=${NUM_NWAKU_NODES:-5} + - NUM_LD_NODES=${NUM_LD_NODES:-5} entrypoint: sh command: - '/opt/deploy_rln_contract.sh' @@ -57,7 +57,7 @@ services: - simulation bootstrap: - image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} + image: ${LD_IMAGE:-wakuorg/nwaku:latest} restart: on-failure labels: com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' @@ -76,12 +76,12 @@ services: - simulation nwaku: - image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} + image: ${LD_IMAGE:-wakuorg/nwaku:latest} restart: on-failure labels: com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' deploy: - replicas: ${NUM_NWAKU_NODES:-5} + replicas: ${NUM_LD_NODES:-5} entrypoint: sh environment: - RPC_URL=${RPC_URL:-http://foundry:8545} @@ -115,9 +115,9 @@ services: - TOKEN_ADDRESS=${TOKEN_ADDRESS:-0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512} - CONTRACT_ADDRESS=${RLN_CONTRACT_ADDRESS:-0x0165878A594ca255338adfa4d48449f69242Eb8F} - PRIVATE_KEY=${PRIVATE_KEY} - - NUM_NWAKU_NODES=${NUM_NWAKU_NODES:-5} + - NUM_LD_NODES=${NUM_LD_NODES:-5} deploy: - replicas: ${NUM_NWAKU_NODES:-5} + replicas: ${NUM_LD_NODES:-5} volumes: - privatekeys-volume:/shared depends_on: @@ -131,7 +131,7 @@ services: context: ./tools/rest-traffic dockerfile: Dockerfile command: - --multiple-nodes=http://waku-simulator-nwaku-[1..${NUM_NWAKU_NODES:-5}]:8645 + --multiple-nodes=http://logos-delivery-simulator_nwaku_[1..${NUM_LD_NODES:-5}]:8645 --msg-size-kbytes=${MSG_SIZE_KBYTES:-10} --delay-seconds=${TRAFFIC_DELAY_SECONDS:-15} networks: diff --git a/monitoring/prometheus-config.yml b/monitoring/prometheus-config.yml index 033f8d0..6392321 100644 --- a/monitoring/prometheus-config.yml +++ b/monitoring/prometheus-config.yml @@ -14,203 +14,203 @@ scrape_configs: static_configs: - targets: - bootstrap:8008 - - waku-simulator-nwaku-1:8008 - - waku-simulator-nwaku-2:8008 - - waku-simulator-nwaku-3:8008 - - waku-simulator-nwaku-4:8008 - - waku-simulator-nwaku-5:8008 - - waku-simulator-nwaku-6:8008 - - waku-simulator-nwaku-7:8008 - - waku-simulator-nwaku-8:8008 - - waku-simulator-nwaku-9:8008 - - waku-simulator-nwaku-10:8008 - - waku-simulator-nwaku-11:8008 - - waku-simulator-nwaku-12:8008 - - waku-simulator-nwaku-13:8008 - - waku-simulator-nwaku-14:8008 - - waku-simulator-nwaku-15:8008 - - waku-simulator-nwaku-16:8008 - - waku-simulator-nwaku-17:8008 - - waku-simulator-nwaku-18:8008 - - waku-simulator-nwaku-19:8008 - - waku-simulator-nwaku-20:8008 - - waku-simulator-nwaku-21:8008 - - waku-simulator-nwaku-22:8008 - - waku-simulator-nwaku-23:8008 - - waku-simulator-nwaku-24:8008 - - waku-simulator-nwaku-25:8008 - - waku-simulator-nwaku-26:8008 - - waku-simulator-nwaku-27:8008 - - waku-simulator-nwaku-28:8008 - - waku-simulator-nwaku-29:8008 - - waku-simulator-nwaku-30:8008 - - waku-simulator-nwaku-31:8008 - - waku-simulator-nwaku-32:8008 - - waku-simulator-nwaku-33:8008 - - waku-simulator-nwaku-34:8008 - - waku-simulator-nwaku-35:8008 - - waku-simulator-nwaku-36:8008 - - waku-simulator-nwaku-37:8008 - - waku-simulator-nwaku-38:8008 - - waku-simulator-nwaku-39:8008 - - waku-simulator-nwaku-40:8008 - - waku-simulator-nwaku-41:8008 - - waku-simulator-nwaku-42:8008 - - waku-simulator-nwaku-43:8008 - - waku-simulator-nwaku-44:8008 - - waku-simulator-nwaku-45:8008 - - waku-simulator-nwaku-46:8008 - - waku-simulator-nwaku-47:8008 - - waku-simulator-nwaku-48:8008 - - waku-simulator-nwaku-49:8008 - - waku-simulator-nwaku-50:8008 - - waku-simulator-nwaku-51:8008 - - waku-simulator-nwaku-52:8008 - - waku-simulator-nwaku-53:8008 - - waku-simulator-nwaku-54:8008 - - waku-simulator-nwaku-55:8008 - - waku-simulator-nwaku-56:8008 - - waku-simulator-nwaku-57:8008 - - waku-simulator-nwaku-58:8008 - - waku-simulator-nwaku-59:8008 - - waku-simulator-nwaku-60:8008 - - waku-simulator-nwaku-61:8008 - - waku-simulator-nwaku-62:8008 - - waku-simulator-nwaku-63:8008 - - waku-simulator-nwaku-64:8008 - - waku-simulator-nwaku-65:8008 - - waku-simulator-nwaku-66:8008 - - waku-simulator-nwaku-67:8008 - - waku-simulator-nwaku-68:8008 - - waku-simulator-nwaku-69:8008 - - waku-simulator-nwaku-70:8008 - - waku-simulator-nwaku-71:8008 - - waku-simulator-nwaku-72:8008 - - waku-simulator-nwaku-73:8008 - - waku-simulator-nwaku-74:8008 - - waku-simulator-nwaku-75:8008 - - waku-simulator-nwaku-76:8008 - - waku-simulator-nwaku-77:8008 - - waku-simulator-nwaku-78:8008 - - waku-simulator-nwaku-79:8008 - - waku-simulator-nwaku-80:8008 - - waku-simulator-nwaku-81:8008 - - waku-simulator-nwaku-82:8008 - - waku-simulator-nwaku-83:8008 - - waku-simulator-nwaku-84:8008 - - waku-simulator-nwaku-85:8008 - - waku-simulator-nwaku-86:8008 - - waku-simulator-nwaku-87:8008 - - waku-simulator-nwaku-88:8008 - - waku-simulator-nwaku-89:8008 - - waku-simulator-nwaku-90:8008 - - waku-simulator-nwaku-91:8008 - - waku-simulator-nwaku-92:8008 - - waku-simulator-nwaku-93:8008 - - waku-simulator-nwaku-94:8008 - - waku-simulator-nwaku-95:8008 - - waku-simulator-nwaku-96:8008 - - waku-simulator-nwaku-97:8008 - - waku-simulator-nwaku-98:8008 - - waku-simulator-nwaku-99:8008 - - waku-simulator-nwaku-100:8008 - - waku-simulator-nwaku-101:8008 - - waku-simulator-nwaku-102:8008 - - waku-simulator-nwaku-103:8008 - - waku-simulator-nwaku-104:8008 - - waku-simulator-nwaku-105:8008 - - waku-simulator-nwaku-106:8008 - - waku-simulator-nwaku-107:8008 - - waku-simulator-nwaku-108:8008 - - waku-simulator-nwaku-109:8008 - - waku-simulator-nwaku-110:8008 - - waku-simulator-nwaku-111:8008 - - waku-simulator-nwaku-112:8008 - - waku-simulator-nwaku-113:8008 - - waku-simulator-nwaku-114:8008 - - waku-simulator-nwaku-115:8008 - - waku-simulator-nwaku-116:8008 - - waku-simulator-nwaku-117:8008 - - waku-simulator-nwaku-118:8008 - - waku-simulator-nwaku-119:8008 - - waku-simulator-nwaku-120:8008 - - waku-simulator-nwaku-121:8008 - - waku-simulator-nwaku-122:8008 - - waku-simulator-nwaku-123:8008 - - waku-simulator-nwaku-124:8008 - - waku-simulator-nwaku-125:8008 - - waku-simulator-nwaku-126:8008 - - waku-simulator-nwaku-127:8008 - - waku-simulator-nwaku-128:8008 - - waku-simulator-nwaku-129:8008 - - waku-simulator-nwaku-130:8008 - - waku-simulator-nwaku-131:8008 - - waku-simulator-nwaku-132:8008 - - waku-simulator-nwaku-133:8008 - - waku-simulator-nwaku-134:8008 - - waku-simulator-nwaku-135:8008 - - waku-simulator-nwaku-136:8008 - - waku-simulator-nwaku-137:8008 - - waku-simulator-nwaku-138:8008 - - waku-simulator-nwaku-139:8008 - - waku-simulator-nwaku-140:8008 - - waku-simulator-nwaku-141:8008 - - waku-simulator-nwaku-142:8008 - - waku-simulator-nwaku-143:8008 - - waku-simulator-nwaku-144:8008 - - waku-simulator-nwaku-145:8008 - - waku-simulator-nwaku-146:8008 - - waku-simulator-nwaku-147:8008 - - waku-simulator-nwaku-148:8008 - - waku-simulator-nwaku-149:8008 - - waku-simulator-nwaku-150:8008 - - waku-simulator-nwaku-151:8008 - - waku-simulator-nwaku-152:8008 - - waku-simulator-nwaku-153:8008 - - waku-simulator-nwaku-154:8008 - - waku-simulator-nwaku-155:8008 - - waku-simulator-nwaku-156:8008 - - waku-simulator-nwaku-157:8008 - - waku-simulator-nwaku-158:8008 - - waku-simulator-nwaku-159:8008 - - waku-simulator-nwaku-160:8008 - - waku-simulator-nwaku-161:8008 - - waku-simulator-nwaku-162:8008 - - waku-simulator-nwaku-163:8008 - - waku-simulator-nwaku-164:8008 - - waku-simulator-nwaku-165:8008 - - waku-simulator-nwaku-166:8008 - - waku-simulator-nwaku-167:8008 - - waku-simulator-nwaku-168:8008 - - waku-simulator-nwaku-169:8008 - - waku-simulator-nwaku-170:8008 - - waku-simulator-nwaku-171:8008 - - waku-simulator-nwaku-172:8008 - - waku-simulator-nwaku-173:8008 - - waku-simulator-nwaku-174:8008 - - waku-simulator-nwaku-175:8008 - - waku-simulator-nwaku-176:8008 - - waku-simulator-nwaku-177:8008 - - waku-simulator-nwaku-178:8008 - - waku-simulator-nwaku-179:8008 - - waku-simulator-nwaku-180:8008 - - waku-simulator-nwaku-181:8008 - - waku-simulator-nwaku-182:8008 - - waku-simulator-nwaku-183:8008 - - waku-simulator-nwaku-184:8008 - - waku-simulator-nwaku-185:8008 - - waku-simulator-nwaku-186:8008 - - waku-simulator-nwaku-187:8008 - - waku-simulator-nwaku-188:8008 - - waku-simulator-nwaku-189:8008 - - waku-simulator-nwaku-190:8008 - - waku-simulator-nwaku-191:8008 - - waku-simulator-nwaku-192:8008 - - waku-simulator-nwaku-193:8008 - - waku-simulator-nwaku-194:8008 - - waku-simulator-nwaku-195:8008 - - waku-simulator-nwaku-196:8008 - - waku-simulator-nwaku-197:8008 - - waku-simulator-nwaku-198:8008 - - waku-simulator-nwaku-199:8008 - - waku-simulator-nwaku-200:8008 \ No newline at end of file + - logos-delivery-simulator_nwaku_1:8008 + - logos-delivery-simulator_nwaku_2:8008 + - logos-delivery-simulator_nwaku_3:8008 + - logos-delivery-simulator_nwaku_4:8008 + - logos-delivery-simulator_nwaku_5:8008 + - logos-delivery-simulator_nwaku_6:8008 + - logos-delivery-simulator_nwaku_7:8008 + - logos-delivery-simulator_nwaku_8:8008 + - logos-delivery-simulator_nwaku_9:8008 + - logos-delivery-simulator_nwaku_10:8008 + - logos-delivery-simulator_nwaku_11:8008 + - logos-delivery-simulator_nwaku_12:8008 + - logos-delivery-simulator_nwaku_13:8008 + - logos-delivery-simulator_nwaku_14:8008 + - logos-delivery-simulator_nwaku_15:8008 + - logos-delivery-simulator_nwaku_16:8008 + - logos-delivery-simulator_nwaku_17:8008 + - logos-delivery-simulator_nwaku_18:8008 + - logos-delivery-simulator_nwaku_19:8008 + - logos-delivery-simulator_nwaku_20:8008 + - logos-delivery-simulator_nwaku_21:8008 + - logos-delivery-simulator_nwaku_22:8008 + - logos-delivery-simulator_nwaku_23:8008 + - logos-delivery-simulator_nwaku_24:8008 + - logos-delivery-simulator_nwaku_25:8008 + - logos-delivery-simulator_nwaku_26:8008 + - logos-delivery-simulator_nwaku_27:8008 + - logos-delivery-simulator_nwaku_28:8008 + - logos-delivery-simulator_nwaku_29:8008 + - logos-delivery-simulator_nwaku_30:8008 + - logos-delivery-simulator_nwaku_31:8008 + - logos-delivery-simulator_nwaku_32:8008 + - logos-delivery-simulator_nwaku_33:8008 + - logos-delivery-simulator_nwaku_34:8008 + - logos-delivery-simulator_nwaku_35:8008 + - logos-delivery-simulator_nwaku_36:8008 + - logos-delivery-simulator_nwaku_37:8008 + - logos-delivery-simulator_nwaku_38:8008 + - logos-delivery-simulator_nwaku_39:8008 + - logos-delivery-simulator_nwaku_40:8008 + - logos-delivery-simulator_nwaku_41:8008 + - logos-delivery-simulator_nwaku_42:8008 + - logos-delivery-simulator_nwaku_43:8008 + - logos-delivery-simulator_nwaku_44:8008 + - logos-delivery-simulator_nwaku_45:8008 + - logos-delivery-simulator_nwaku_46:8008 + - logos-delivery-simulator_nwaku_47:8008 + - logos-delivery-simulator_nwaku_48:8008 + - logos-delivery-simulator_nwaku_49:8008 + - logos-delivery-simulator_nwaku_50:8008 + - logos-delivery-simulator_nwaku_51:8008 + - logos-delivery-simulator_nwaku_52:8008 + - logos-delivery-simulator_nwaku_53:8008 + - logos-delivery-simulator_nwaku_54:8008 + - logos-delivery-simulator_nwaku_55:8008 + - logos-delivery-simulator_nwaku_56:8008 + - logos-delivery-simulator_nwaku_57:8008 + - logos-delivery-simulator_nwaku_58:8008 + - logos-delivery-simulator_nwaku_59:8008 + - logos-delivery-simulator_nwaku_60:8008 + - logos-delivery-simulator_nwaku_61:8008 + - logos-delivery-simulator_nwaku_62:8008 + - logos-delivery-simulator_nwaku_63:8008 + - logos-delivery-simulator_nwaku_64:8008 + - logos-delivery-simulator_nwaku_65:8008 + - logos-delivery-simulator_nwaku_66:8008 + - logos-delivery-simulator_nwaku_67:8008 + - logos-delivery-simulator_nwaku_68:8008 + - logos-delivery-simulator_nwaku_69:8008 + - logos-delivery-simulator_nwaku_70:8008 + - logos-delivery-simulator_nwaku_71:8008 + - logos-delivery-simulator_nwaku_72:8008 + - logos-delivery-simulator_nwaku_73:8008 + - logos-delivery-simulator_nwaku_74:8008 + - logos-delivery-simulator_nwaku_75:8008 + - logos-delivery-simulator_nwaku_76:8008 + - logos-delivery-simulator_nwaku_77:8008 + - logos-delivery-simulator_nwaku_78:8008 + - logos-delivery-simulator_nwaku_79:8008 + - logos-delivery-simulator_nwaku_80:8008 + - logos-delivery-simulator_nwaku_81:8008 + - logos-delivery-simulator_nwaku_82:8008 + - logos-delivery-simulator_nwaku_83:8008 + - logos-delivery-simulator_nwaku_84:8008 + - logos-delivery-simulator_nwaku_85:8008 + - logos-delivery-simulator_nwaku_86:8008 + - logos-delivery-simulator_nwaku_87:8008 + - logos-delivery-simulator_nwaku_88:8008 + - logos-delivery-simulator_nwaku_89:8008 + - logos-delivery-simulator_nwaku_90:8008 + - logos-delivery-simulator_nwaku_91:8008 + - logos-delivery-simulator_nwaku_92:8008 + - logos-delivery-simulator_nwaku_93:8008 + - logos-delivery-simulator_nwaku_94:8008 + - logos-delivery-simulator_nwaku_95:8008 + - logos-delivery-simulator_nwaku_96:8008 + - logos-delivery-simulator_nwaku_97:8008 + - logos-delivery-simulator_nwaku_98:8008 + - logos-delivery-simulator_nwaku_99:8008 + - logos-delivery-simulator_nwaku_100:8008 + - logos-delivery-simulator_nwaku_101:8008 + - logos-delivery-simulator_nwaku_102:8008 + - logos-delivery-simulator_nwaku_103:8008 + - logos-delivery-simulator_nwaku_104:8008 + - logos-delivery-simulator_nwaku_105:8008 + - logos-delivery-simulator_nwaku_106:8008 + - logos-delivery-simulator_nwaku_107:8008 + - logos-delivery-simulator_nwaku_108:8008 + - logos-delivery-simulator_nwaku_109:8008 + - logos-delivery-simulator_nwaku_110:8008 + - logos-delivery-simulator_nwaku_111:8008 + - logos-delivery-simulator_nwaku_112:8008 + - logos-delivery-simulator_nwaku_113:8008 + - logos-delivery-simulator_nwaku_114:8008 + - logos-delivery-simulator_nwaku_115:8008 + - logos-delivery-simulator_nwaku_116:8008 + - logos-delivery-simulator_nwaku_117:8008 + - logos-delivery-simulator_nwaku_118:8008 + - logos-delivery-simulator_nwaku_119:8008 + - logos-delivery-simulator_nwaku_120:8008 + - logos-delivery-simulator_nwaku_121:8008 + - logos-delivery-simulator_nwaku_122:8008 + - logos-delivery-simulator_nwaku_123:8008 + - logos-delivery-simulator_nwaku_124:8008 + - logos-delivery-simulator_nwaku_125:8008 + - logos-delivery-simulator_nwaku_126:8008 + - logos-delivery-simulator_nwaku_127:8008 + - logos-delivery-simulator_nwaku_128:8008 + - logos-delivery-simulator_nwaku_129:8008 + - logos-delivery-simulator_nwaku_130:8008 + - logos-delivery-simulator_nwaku_131:8008 + - logos-delivery-simulator_nwaku_132:8008 + - logos-delivery-simulator_nwaku_133:8008 + - logos-delivery-simulator_nwaku_134:8008 + - logos-delivery-simulator_nwaku_135:8008 + - logos-delivery-simulator_nwaku_136:8008 + - logos-delivery-simulator_nwaku_137:8008 + - logos-delivery-simulator_nwaku_138:8008 + - logos-delivery-simulator_nwaku_139:8008 + - logos-delivery-simulator_nwaku_140:8008 + - logos-delivery-simulator_nwaku_141:8008 + - logos-delivery-simulator_nwaku_142:8008 + - logos-delivery-simulator_nwaku_143:8008 + - logos-delivery-simulator_nwaku_144:8008 + - logos-delivery-simulator_nwaku_145:8008 + - logos-delivery-simulator_nwaku_146:8008 + - logos-delivery-simulator_nwaku_147:8008 + - logos-delivery-simulator_nwaku_148:8008 + - logos-delivery-simulator_nwaku_149:8008 + - logos-delivery-simulator_nwaku_150:8008 + - logos-delivery-simulator_nwaku_151:8008 + - logos-delivery-simulator_nwaku_152:8008 + - logos-delivery-simulator_nwaku_153:8008 + - logos-delivery-simulator_nwaku_154:8008 + - logos-delivery-simulator_nwaku_155:8008 + - logos-delivery-simulator_nwaku_156:8008 + - logos-delivery-simulator_nwaku_157:8008 + - logos-delivery-simulator_nwaku_158:8008 + - logos-delivery-simulator_nwaku_159:8008 + - logos-delivery-simulator_nwaku_160:8008 + - logos-delivery-simulator_nwaku_161:8008 + - logos-delivery-simulator_nwaku_162:8008 + - logos-delivery-simulator_nwaku_163:8008 + - logos-delivery-simulator_nwaku_164:8008 + - logos-delivery-simulator_nwaku_165:8008 + - logos-delivery-simulator_nwaku_166:8008 + - logos-delivery-simulator_nwaku_167:8008 + - logos-delivery-simulator_nwaku_168:8008 + - logos-delivery-simulator_nwaku_169:8008 + - logos-delivery-simulator_nwaku_170:8008 + - logos-delivery-simulator_nwaku_171:8008 + - logos-delivery-simulator_nwaku_172:8008 + - logos-delivery-simulator_nwaku_173:8008 + - logos-delivery-simulator_nwaku_174:8008 + - logos-delivery-simulator_nwaku_175:8008 + - logos-delivery-simulator_nwaku_176:8008 + - logos-delivery-simulator_nwaku_177:8008 + - logos-delivery-simulator_nwaku_178:8008 + - logos-delivery-simulator_nwaku_179:8008 + - logos-delivery-simulator_nwaku_180:8008 + - logos-delivery-simulator_nwaku_181:8008 + - logos-delivery-simulator_nwaku_182:8008 + - logos-delivery-simulator_nwaku_183:8008 + - logos-delivery-simulator_nwaku_184:8008 + - logos-delivery-simulator_nwaku_185:8008 + - logos-delivery-simulator_nwaku_186:8008 + - logos-delivery-simulator_nwaku_187:8008 + - logos-delivery-simulator_nwaku_188:8008 + - logos-delivery-simulator_nwaku_189:8008 + - logos-delivery-simulator_nwaku_190:8008 + - logos-delivery-simulator_nwaku_191:8008 + - logos-delivery-simulator_nwaku_192:8008 + - logos-delivery-simulator_nwaku_193:8008 + - logos-delivery-simulator_nwaku_194:8008 + - logos-delivery-simulator_nwaku_195:8008 + - logos-delivery-simulator_nwaku_196:8008 + - logos-delivery-simulator_nwaku_197:8008 + - logos-delivery-simulator_nwaku_198:8008 + - logos-delivery-simulator_nwaku_199:8008 + - logos-delivery-simulator_nwaku_200:8008 \ No newline at end of file diff --git a/src/SUMMARY.md b/src/SUMMARY.md index ada3e74..407f854 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -1,10 +1,16 @@ # Summary -- [Introduction to Waku Simulator](./intro-waku-simulator.md) -- [Deploy a waku network](./deploy-waku-network.md) -- [Inject traffic](./inject-traffic.md) -- [Connect external full node](./connect-full-node.md) -- [Connect external spam node](./connect-spam-node.md) -- [Connect external light node](./connect-light-node.md) -- [Connect external store node](./connect-store-node.md) -- [Register memberships](./register-memberships.md) \ No newline at end of file +[Introduction to Logos Delivery Simulator](./intro-logos-delivery-simulator.md) + +# Getting started + +- [Deploy a Logos Delivery network](./deploy-waku-network.md) + +# Protocol tutorials + +- [Inject traffic (Relay)](./inject-traffic.md) +- [Connect external full node (Relay + RLN)](./connect-full-node.md) +- [Connect external spam node (RLN spam protection)](./connect-spam-node.md) +- [Connect external light node (Lightpush)](./connect-light-node.md) +- [Connect external store node (Store)](./connect-store-node.md) +- [Register memberships (RLN registration)](./register-memberships.md) diff --git a/src/connect-full-node.md b/src/connect-full-node.md index 2e89d61..c9e0bb1 100644 --- a/src/connect-full-node.md +++ b/src/connect-full-node.md @@ -1,12 +1,13 @@ # Connect external full node +> **Protocol exercised:** Relay + RLN Relay β€” attaches an additional [logos-delivery](https://github.com/logos-messaging/logos-delivery) node to the simulated network as a full relay participant with its own RLN membership. -If you want to connect to the existing waku network a node with some custom configuration. Perhaps a different image or some other configuration, you can do it as follows. Bear in mind that if this node has other configuration (eg `rln-relay-epoch-sec` or `rln-relay-user-message-limit`) then it won’t behave properly. +If you want to attach a node with some custom configuration to the simulated Logos Delivery network β€” perhaps a different image, a different RLN epoch length, or any other knob β€” you can do it as follows. Bear in mind that if this node uses different RLN parameters (e.g. `rln-relay-epoch-sec` or `rln-relay-user-message-limit`) than the rest of the network, the gossipsub layer will treat its messages as invalid and you won't see them propagate. - ⚠️set your own `staticnode` ```bash -docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2759-rln-v2 \ +docker run -it --network logos-delivery-simulator_simulation wakuorg/nwaku:latest \ --relay=true \ --rln-relay=true \ --rln-relay-dynamic=true \ @@ -26,7 +27,7 @@ You can also try to connect multiple nodes with a loop. Note the `&`. Remember t ```bash for i in {1..5}; do - docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2759-rln-v2 \ + docker run -it --network logos-delivery-simulator_simulation wakuorg/nwaku:latest \ --relay=true \ --rln-relay=true \ --rln-relay-dynamic=true \ diff --git a/src/connect-light-node.md b/src/connect-light-node.md index 5e90fcc..689c40b 100644 --- a/src/connect-light-node.md +++ b/src/connect-light-node.md @@ -1,13 +1,15 @@ # Connect external light node -By using [go-waku-light](https://github.com/alrevuelta/go-waku-light), you can connect one or multiple light clients to the network. This utility can be configured to send messages at a given rate using a given peer as `light-push`. It will register a RLN membership at startup. Bear in mind that it should be configured with the same contract and `user-message-limit` as the waku nodes. You should modify the `lightpush-peer`. +> **Protocol exercised:** Lightpush + RLN β€” a resource-restricted client publishes messages through a full [logos-delivery](https://github.com/logos-messaging/logos-delivery) node using the lightpush protocol, with RLN proofs fetched directly from the contract. + +By using [go-waku-light](https://github.com/alrevuelta/go-waku-light), you can connect one or multiple light clients to the network. This utility can be configured to send messages at a given rate using a given peer as `light-push`. It will register an RLN membership at startup. Bear in mind that it should be configured with the same contract and `user-message-limit` as the rest of the network. You should modify the `lightpush-peer`. Note that if you spin up multiple services like this using the same `priv-key` some of the transactions registering the RLN membership may fail due to the nonce being repeated. This can be fixed by using multiple keys or waiting for the registration to be completed before spinning up the next process. - ⚠️ change `lightpush-peer` to the node you wish. Note that the multiaddress is logged by every peer at startup. ```jsx -docker run --network waku-simulator_simulation alrevuelta/go-waku-light:4fabb22 \ +docker run --network logos-delivery-simulator_simulation alrevuelta/go-waku-light:4fabb22 \ --eth-endpoint=http://foundry:8545 \ --contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ send-messages-loop \ @@ -26,7 +28,7 @@ Note that in some examples, it could be interesting to run multiple instances, e ```bash for i in {1..5}; do - docker run --rm --network waku-simulator_simulation alrevuelta/go-waku-light:4fabb22 \ + docker run --rm --network logos-delivery-simulator_simulation alrevuelta/go-waku-light:4fabb22 \ --eth-endpoint=http://foundry:8545 \ --contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ send-messages-loop \ diff --git a/src/connect-spam-node.md b/src/connect-spam-node.md index a9524ca..996adf3 100644 --- a/src/connect-spam-node.md +++ b/src/connect-spam-node.md @@ -1,12 +1,13 @@ # Connect external spam node +> **Protocol exercised:** RLN Relay (spam protection) + gossipsub peer scoring β€” verifies that nodes exceeding their RLN rate limit are detected and disconnected via peer score. -By using the [nwaku-spammer] (https://github.com/waku-org/nwaku/pull/2821), you can connect a node to the network that spams the other nodes, sending messages exceeding its rate limit. It will register an RLN membership at startup. It should be configured with the same contract and `rln-relay-user-message-limit` as the waku nodes. If a node spams enough for the peer-score to go below the threshold, then the peers will disconnect from the spamming node. +By using the [nwaku-spammer](https://github.com/waku-org/nwaku/pull/2821) build, you can connect a node to the network that spams the other nodes, sending messages exceeding its rate limit. It will register an RLN membership at startup. It should be configured with the same contract and `rln-relay-user-message-limit` as the rest of the network. If a node spams enough for its gossipsub peer score to drop below the threshold, the other [logos-delivery](https://github.com/logos-messaging/logos-delivery) nodes will disconnect from it. - ⚠️ change `staticnode` to the node you wish. Note that the multiaddress is logged by every peer at startup. ```bash -docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ +docker run -it --network logos-delivery-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ --relay=true \ --rln-relay=true \ --rln-relay-dynamic=true \ @@ -38,7 +39,7 @@ You can also try to connect multiple spamming nodes, but it might be necessary t ```bash for i in {1..5}; do -docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ +docker run -it --network logos-delivery-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ --relay=true \ --rln-relay=true \ --rln-relay-dynamic=true \ @@ -61,7 +62,7 @@ done The spammer node also provides a method to test burst messaging. It will send the total user-message-limit of messages sequentially without pauses, then rests for the epoch period and repeats. ```bash -docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ +docker run -it --network logos-delivery-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ --relay=true \ --rln-relay=true \ --rln-relay-dynamic=true \ diff --git a/src/connect-store-node.md b/src/connect-store-node.md index 86b5141..04151ee 100644 --- a/src/connect-store-node.md +++ b/src/connect-store-node.md @@ -1,7 +1,9 @@ # Connect external store node -One or more external store nodes can be connected to the waku-simulator network by using configuration similar to that shown below. The store node(s) can use the DB as backend from an existing staging or production system DB or a custom one. When connecting to any DB ensure that the `store-message-retention-policy` matches that of the system. -The staticnode that the store node connects to can be any existing node in the waku-simulator network, alternatively use the discv5 configuration. +> **Protocol exercised:** Store β€” a [logos-delivery](https://github.com/logos-messaging/logos-delivery) node with persistent storage joins the network, archives messages it sees on the relay, and serves historical queries via the store protocol. + +One or more external store nodes can be connected to the logos-delivery-simulator network by using configuration similar to that shown below. The store node(s) can use the DB as backend from an existing staging or production system DB or a custom one. When connecting to any DB ensure that the `store-message-retention-policy` matches that of the system. +The staticnode that the store node connects to can be any existing node in the logos-delivery-simulator network, alternatively use the discv5 configuration. ```bash --discv5-discovery=true \ @@ -21,7 +23,7 @@ The [message-finder](https://github.com/waku-org/message-finder) tool could also ```bash -docker run -it --network waku-simulator_simulation --name nwaku_storenode_1 -d harbor.status.im/wakuorg/nwaku:latest \ +docker run -it --network logos-delivery-simulator_simulation --name nwaku_storenode_1 -d harbor.status.im/wakuorg/nwaku:latest \ --relay=true\ --rest=true\ --rest-address=0.0.0.0\ diff --git a/src/deploy-waku-network.md b/src/deploy-waku-network.md index 314d4f8..ce667f4 100644 --- a/src/deploy-waku-network.md +++ b/src/deploy-waku-network.md @@ -1,17 +1,17 @@ -# Deploy a waku network +# Deploy a Logos Delivery network -The network can be deployed in a few commands, and requires `docker` and `docker-compose`. Some of the configuration is exposed via env flags, but if you are missing some, PRs are accepted. +This page deploys a self-contained network of [logos-delivery](https://github.com/logos-messaging/logos-delivery) nodes (the `wakunode2` binary, distributed as a Docker image) on a single machine. It requires `docker` and `docker-compose`. Configuration is exposed through environment variables β€” if a knob you need is missing, PRs are welcome. -Some of the most important parameters are: +The most important parameters are: -- `NWAKU_IMAGE` Docker image of nwaku that all nodes will run -- `NUM_NWAKU_NODES` Amount of nwaku nodes -- `RLN_RELAY_EPOCH_SEC` and `RLN_RELAY_MSG_LIMIT` configure the RLNv2 parameter, specifying the amount of messages that are allowed per unit of time. -- `TRAFFIC_DELAY_SECONDS` and `MSG_SIZE_KBYTES` are used to inject traffic via the rest API into the network. +- `LD_IMAGE` β€” the `logos-delivery` Docker image that every node will run. The image is still published under the legacy `wakuorg/nwaku` namespace (see [the upstream container build](https://github.com/logos-messaging/logos-delivery/blob/master/.github/workflows/container-image.yml)); pin a tag for reproducible runs. +- `NUM_LD_NODES` β€” number of `logos-delivery` nodes to launch (default 5; upper bound around 200 depending on host resources). +- `RLN_RELAY_EPOCH_SEC` and `RLN_RELAY_MSG_LIMIT` β€” RLNv2 parameters that cap how many messages each node may publish per epoch. +- `TRAFFIC_DELAY_SECONDS` and `MSG_SIZE_KBYTES` β€” used by the bundled `rest-traffic` injector to drive load through each node's REST API. ```bash -export NWAKU_IMAGE=quay.io/wakuorg/nwaku-pr:2759-rln-v2 -export NUM_NWAKU_NODES=5 +export LD_IMAGE=wakuorg/nwaku:latest +export NUM_LD_NODES=5 export RLN_RELAY_EPOCH_SEC=1 export RLN_RELAY_MSG_LIMIT=1 @@ -36,20 +36,24 @@ After a couple of minutes, everything should be running at: For greater observability, one can access each node logs as follows: ```bash -docker logs waku-simulator-nwaku-1 -docker logs waku-simulator-nwaku-2 +# All nwaku replicas at once +docker-compose logs nwaku + +# A specific replica (e.g. index 1 or 2) +docker-compose logs --index=1 nwaku +docker-compose logs --index=2 nwaku ``` Or if you want to follow the logs ```bash -docker logs waku-simulator-nwaku-1 --follow +docker-compose logs -f --index=1 nwaku ``` -Once the network of nwaku nodes is up and running we can use it to perform different tests, connecting other nodes that we fully control with some specific characteristics. This ranges from connecting spammer nodes, light clients, and in the future unsynced nodes, etc. +Once the network of `logos-delivery` nodes is up and running we can use it to perform different tests, connecting other nodes that we fully control with specific characteristics. This ranges from connecting spammer nodes, light clients, store nodes, and in the future unsynced nodes, etc. -Now that we have the network deployed we can use it. Hereunder we describe how to use the network deployed by `waku-simulator` to perform end-to-end tests of any desired feature. We focus on the following ones: +Now that we have the network deployed we can use it. Hereunder we describe how to use the network deployed by `logos-delivery-simulator` to perform end-to-end tests of any desired feature. Each tutorial below targets a specific protocol from the [logos-delivery](https://github.com/logos-messaging/logos-delivery) suite: - Inject traffic: - Connect external full node: diff --git a/src/inject-traffic.md b/src/inject-traffic.md index 715d6f1..08b5475 100644 --- a/src/inject-traffic.md +++ b/src/inject-traffic.md @@ -1,14 +1,15 @@ # Inject traffic +> **Protocol exercised:** Relay (gossipsub) β€” messages are published via the REST API and propagated to every node through the relay protocol from [logos-delivery](https://github.com/logos-messaging/logos-delivery). The REST API itself is documented at [waku-org.github.io/waku-rest-api](https://waku-org.github.io/waku-rest-api/). -In order to inject traffic into the network, we can use the REST API of each nwaku node. We have a simple dockerized script in [rest-traffic](https://github.com/alrevuelta/rest-traffic), that can perform this task. In the following command we run a docker container, connected to the waku-simulator network. This script will inject a message every `delay-seconds` with a size of `msg-size-kbytes` into a given `pubsub-topic`. Note that in `multiple-nodes` you can configure the nodes that will publish messages, where `[1..5]` will publish to node 1, 2, 3, 4, 5. You can publish to a single node (e.g. node 1) by using `[1..1]`. +In order to inject traffic into the network, we can use the REST API of each `logos-delivery` node. We have a simple dockerized script in [rest-traffic](https://github.com/alrevuelta/rest-traffic), that can perform this task. In the following command we run a docker container connected to the logos-delivery-simulator network. This script will inject a message every `delay-seconds` with a size of `msg-size-kbytes` into a given `pubsub-topic`. Note that in `multiple-nodes` you can configure the nodes that will publish messages, where `[1..5]` will publish to nodes 1, 2, 3, 4, 5. You can publish to a single node (e.g. node 1) by using `[1..1]`. ```jsx -docker run -it --network waku-simulator_simulation alrevuelta/rest-traffic:d936446 \ +docker run -it --network logos-delivery-simulator_simulation alrevuelta/rest-traffic:d936446 \ --delay-seconds=10 \ --msg-size-kbytes=5 \ --pubsub-topic=/waku/2/rs/66/0 \ ---multiple-nodes="http://waku-simulator-nwaku-[1..5]:8645" +--multiple-nodes="http://logos-delivery-simulator_nwaku_[1..5]:8645" ``` Note that the REST API doesn’t allow to publish messages exceeding the rate limit, so this tool can’t be used to test beyond the rate limits. diff --git a/src/intro-logos-delivery-simulator.md b/src/intro-logos-delivery-simulator.md new file mode 100644 index 0000000..b81fd16 --- /dev/null +++ b/src/intro-logos-delivery-simulator.md @@ -0,0 +1,52 @@ +# Introduction to Logos Delivery Simulator + +The [logos-delivery-simulator](https://github.com/logos-messaging/logos-delivery-simulator) is a **protocol simulator** for [logos-delivery](https://github.com/logos-messaging/logos-delivery) β€” the Nim implementation of a libp2p protocol suite for private, censorship-resistant peer-to-peer messaging. + +## What it does + +The simulator orchestrates a network of `logos-delivery` nodes inside Docker, on a single machine, so you can exercise the protocol stack end-to-end without depending on any public network. Concretely, on `docker-compose up` it: + +- spins up a configurable number of `logos-delivery` nodes (default: 5, upper bound around 200) all connected through a single bootstrap node via discv5, +- launches a private Anvil blockchain ([foundry](https://github.com/foundry-rs/foundry)) under your full control, +- deploys an RLN (Rate Limiting Nullifier) contract on that chain and registers an RLN membership for every node so they can publish valid rate-limited messages, +- exposes each node's REST API so you can inject traffic, query the store, attach external nodes, etc., +- ships a Grafana + Prometheus + cAdvisor + Epirus block-explorer stack pre-wired to the simulated network for observability. + +The whole network runs on an isolated Docker bridge (`logos-delivery-simulator_simulation`) and uses an ad-hoc cluster id (`66`) so it cannot accidentally talk to any production fleet. + +## What protocols you can exercise + +The tutorials in this book each target one of the libp2p protocols implemented in `logos-delivery`: + +| Tutorial | Protocol exercised | +|---|---| +| [Inject traffic](./inject-traffic.md) | Relay (gossipsub) + REST publish | +| [Connect external full node](./connect-full-node.md) | Relay + RLN membership | +| [Connect external spam node](./connect-spam-node.md) | RLN spam protection + peer scoring | +| [Connect external light node](./connect-light-node.md) | Lightpush + RLN proofs from contract | +| [Connect external store node](./connect-store-node.md) | Store (historical message retrieval) | +| [Register memberships](./register-memberships.md) | RLN membership registration on the contract | + +A full list of the protocols implemented by `logos-delivery` (Relay, Store, Filter, Lightpush, Peer Exchange, RLN Relay, Metadata, Mix, Rendezvous) is in [logos-delivery/AGENTS.md](https://github.com/logos-messaging/logos-delivery/blob/master/AGENTS.md). The specifications themselves live at [rfc.vac.dev/waku](https://rfc.vac.dev/waku) under the `WAKU2-XXX` identifiers. + +## Goals + +- Test new protocol features end-to-end with multiple nodes before they go to a real fleet. +- Run as a long-lived network on `master` to catch breaking changes early. +- Explore the protocol's limits under different loads, message sizes, and rate limits. +- Provide a controlled, easily-reproducible environment for debugging. + +## A note on naming + +`logos-delivery` was previously called **nwaku**, and [Logos Messaging](https://github.com/logos-messaging) is a rebrand of the [Waku](https://waku.org) project. A lot of legacy names are still in flight and you'll see them in this repo and the upstream β€” they all refer to the same thing: + +- The compiled binary is still called `wakunode2` (`logos-delivery/Makefile`). +- The shared library is `liblogosdelivery`. +- The published Docker image used by `${LD_IMAGE}` is still pushed to `quay.io/wakuorg/nwaku-pr:` (`logos-delivery/.github/workflows/container-image.yml:91`). +- The default fallback in `docker-compose.yml` is `wakuorg/nwaku:latest`. +- Specifications still live under the `WAKU2-XXX` namespace at `rfc.vac.dev/waku`. +- Inside the source tree of `logos-delivery`, modules are still named `waku/waku_relay`, `waku/waku_store`, etc. + +This is consistent with the upstream project's stance, quoted from `logos-delivery/AGENTS.md`: *"Logos Messaging was formerly known as Waku. Waku-related terminology remains within the codebase for historical reasons."* + +You don't need to do anything about it β€” it's just useful to know that `nwaku`, `wakunode2`, and `logos-delivery` all refer to the same binary in this repo. diff --git a/src/intro-waku-simulator.md b/src/intro-waku-simulator.md deleted file mode 100644 index f2abd7a..0000000 --- a/src/intro-waku-simulator.md +++ /dev/null @@ -1,19 +0,0 @@ -# Introduction to Waku Simulator - -The [waku-simulator](https://github.com/waku-org/waku-simulator) tool allows simulating a waku network with a set of interconnected [nwaku](https://github.com/waku-org/nwaku) nodes with the following features: - -- Configurable amount of nodes. Limits depend on the machine and are upper bounded at around 200. -- Runs in a single machine, using `docker-compose` to orchestrate the containers. -- It uses discv5 for peer discovery, using a common bootstrap node. -- It runs a custom ad hoc network, isolated from the existing waku networks. -- It uses a freshly deployed private blockchain, with full control over it and minimum state to track. -- It deploys an RLN contract in the said private blockchain and configures it to be used by all nodes. -- It registers an RLN membership for each node in the network, configuring it in the node to publish valid messages. -- It exposes each node’s API, so that it can be used to inject traffic into the network. -- Simple to run. Everything is automated. Requires two commands to run. - -The main goals of `waku-simulator` include but are not limited to: -* Test new features in an end to end setup with multiple nodes. -* Use as a long-lived running network on latest master, to anticipate breaking changes. -* Explore waku's limits by using different loads and configurations. -* Offer a tool to debug problems in a controlled and easy to replicate environment. diff --git a/src/register-memberships.md b/src/register-memberships.md index 448994a..1268e43 100644 --- a/src/register-memberships.md +++ b/src/register-memberships.md @@ -1,10 +1,11 @@ # Register memberships +> **Protocol exercised:** RLN membership registration β€” bulk-registers RLN memberships against the on-chain RLN contract that the simulator deploys, so you can stress how the [logos-delivery](https://github.com/logos-messaging/logos-delivery) nodes pick up new memberships in real time. -The [go-waku-light](https://github.com/alrevuelta/go-waku-light) tool can be used as well to register multiple RLN memberships. This can be useful to stress test the nodes, forcing a large amount of memberships. Set `amount` to the amount of memberships that you want to register. Note that it takes some time, since memberships are registered one after the other. You can spin up multiple services like this, but in that case you must provide different `priv-key` to each. Note that these memberships are kind of thrown away and not used to send messages. +The [go-waku-light](https://github.com/alrevuelta/go-waku-light) tool can be used as well to register multiple RLN memberships. This can be useful to stress test the nodes, forcing a large amount of memberships. Set `amount` to the amount of memberships that you want to register. Note that it takes some time, since memberships are registered one after the other. You can spin up multiple services like this, but in that case you must provide different `priv-key` to each. Note that these memberships are essentially throwaway β€” they are not used to send messages. ```jsx -docker run --network waku-simulator_simulation alrevuelta/go-waku-light:07b8f32 \ +docker run --network logos-delivery-simulator_simulation alrevuelta/go-waku-light:07b8f32 \ --eth-endpoint=http://foundry:8545 \ --contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ register \ @@ -14,7 +15,7 @@ register \ ``` -The foundry service in the waku-simulator generates deterministic accounts that can be used to register memberships. It is recommended to use different accounts for registering multiple memberships at the same time. The last 20 accounts generated are provided for ad-hoc testing purposes. +The foundry service in the logos-delivery-simulator generates deterministic accounts that can be used to register memberships. It is recommended to use different accounts for registering multiple memberships at the same time. The last 20 accounts generated are provided for ad-hoc testing purposes.
Account and Private-key Pairs diff --git a/tools/rest-traffic/traffic.py b/tools/rest-traffic/traffic.py index 0f8d837..6d8e341 100644 --- a/tools/rest-traffic/traffic.py +++ b/tools/rest-traffic/traffic.py @@ -44,8 +44,8 @@ parser = argparse.ArgumentParser(description='') # these flags are mutually exclusive, one or the other, never at once group = parser.add_mutually_exclusive_group(required=True) -group.add_argument('-sn', '--single-node', type=str, help='example: http://waku-simulator-nwaku-1:8645') -group.add_argument('-mn', '--multiple-nodes', type=str, help='example: http://waku-simulator-nwaku-[1..10]:8645') +group.add_argument('-sn', '--single-node', type=str, help='example: http://logos-delivery-simulator_nwaku_1:8645') +group.add_argument('-mn', '--multiple-nodes', type=str, help='example: http://logos-delivery-simulator_nwaku_[1..10]:8645') # rest of araguments parser.add_argument('-c', '--content-topic', type=str, help='content topic', default="my-ctopic") diff --git a/wakusim.env b/wakusim.env index d5981fb..b60f584 100644 --- a/wakusim.env +++ b/wakusim.env @@ -1,7 +1,7 @@ # Env variables for metal-01.he-eu-hel1.misc.wakusim host. -NWAKU_IMAGE=harbor.status.im/wakuorg/nwaku:latest +LD_IMAGE=harbor.status.im/wakuorg/nwaku:latest # Network scaling. -NUM_NWAKU_NODES=50 +NUM_LD_NODES=50 # Simulation traffic. MSG_SIZE_KBYTES=10 TRAFFIC_DELAY_SECONDS=6