logos-messaging-simulator/src/deploy-waku-network.md

60 lines
2.9 KiB
Markdown
Raw Normal View History

# Deploy a Logos Delivery network
2024-06-12 12:34:16 +02:00
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.
2024-06-12 12:34:16 +02:00
The most important parameters are:
2024-06-12 12:34:16 +02:00
- `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.
2024-06-12 12:34:16 +02:00
```bash
export LD_IMAGE=wakuorg/nwaku:latest
export NUM_LD_NODES=5
2024-06-12 12:34:16 +02:00
export RLN_RELAY_EPOCH_SEC=1
export RLN_RELAY_MSG_LIMIT=1
export TRAFFIC_DELAY_SECONDS=15
export MSG_SIZE_KBYTES=10
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
```
Once configured, start all containers:
```bash
docker-compose --compatibility up -d
```
2024-06-13 14:29:47 +02:00
After a couple of minutes, everything should be running at:
2024-06-12 12:34:16 +02:00
- `http://localhost:3000` Block explorer
- `http://localhost:3001` Grafana metrics
For greater observability, one can access each node logs as follows:
```bash
2026-04-10 19:59:51 +05:30
docker logs logos-delivery-simulator_nwaku_1
docker logs logos-delivery-simulator_nwaku_2
2024-06-12 12:34:16 +02:00
```
Or if you want to follow the logs
```bash
2026-04-10 19:59:51 +05:30
docker logs logos-delivery-simulator_nwaku_1 --follow
2024-06-12 12:34:16 +02:00
```
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.
2024-06-12 12:34:16 +02:00
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:
2024-06-12 12:34:16 +02:00
- Inject traffic:
- Connect external full node:
- Connect external spammer node:
- Connect external light node:
- Register memberships:
2024-06-13 14:29:47 +02:00
⚠️ For every use case, ensure that your node is configured in the same way as the rest of the nodes, otherwise messages may be lost. Note that it can be also an intended test, seeing how the network reacts to other nodes connecting to it.