From 74400b61841ad8ed999a7392bddb7855294ef25c Mon Sep 17 00:00:00 2001 From: alrevuelta Date: Wed, 5 Jul 2023 11:09:15 +0200 Subject: [PATCH] Add support for gowaku --- README.md | 16 +++++++++------- docker-compose.yml | 29 ++++++++++++++++------------- run_wakupublisher.sh | 4 ++-- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9ee6b92..3b0c53c 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,31 @@ * docker-compose ## How to run -Without changing anything: ``` git clone cd waku-simulator ``` +Configure the simulation parameters. You can place the env variable in an `.env` file. + ``` +export GOWAKU_IMAGE=statusteam/go-waku:v0.7.0 export NWAKU_IMAGE=statusteam/nim-waku:v0.18.0-rc.0 export NUM_NWAKU_NODES=5 +export NUM_GOWAKU_NODES=5 +export MSG_PER_SECOND=10 +export MSG_SIZE_KBYTES=10 docker-compose up -d ``` This will: -* spin up grafana/prometheus for monitoring -* spin up a bootstrap nwaku node -* spin up NUM_NWAKU_NODES nwaku nodes +* spin up grafana/prometheus for monitoring, see `http://localhost:3000`. +* spin up a bootstrap nwaku node. +* spin up a given amount of nwaku/gowaku nodes with specific versions. * spin up a `waku-publisher` instance that will inject traffic into the network (see flags for rate and msg size) -Nodes can be monitored here: -http://localhost:3000/d/yns_4vFVk/nwaku-monitoring?orgId=1 - ## warning diff --git a/docker-compose.yml b/docker-compose.yml index 371ba22..98ea295 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,25 +30,28 @@ services: depends_on: - bootstrap - #gowaku: - # image: statusteam/go-waku:v0.7.0 - # restart: on-failure - # deploy: - # replicas: 5 - # entrypoint: sh - # command: - # - '/opt/run_gowaku.sh' - # volumes: - # - ./run_gowaku.sh:/opt/run_gowaku.sh:Z - # depends_on: - # - bootstrap + gowaku: + image: ${GOWAKU_IMAGE} + restart: on-failure + deploy: + replicas: ${NUM_GOWAKU_NODES} + entrypoint: sh + command: + - '/opt/run_gowaku.sh' + volumes: + - ./run_gowaku.sh:/opt/run_gowaku.sh:Z + depends_on: + - bootstrap waku-publisher: - image: alrevuelta/waku-publisher:c985cb3 + image: alrevuelta/waku-publisher:de34e2d entrypoint: sh - 'opt/run_wakupublisher.sh' volumes: - ./run_wakupublisher.sh:/opt/run_wakupublisher.sh:Z + environment: + MSG_PER_SECOND: 10 + MSG_SIZE_KBYTES: 10 prometheus: image: prom/prometheus:latest diff --git a/run_wakupublisher.sh b/run_wakupublisher.sh index 0849fb3..a99136b 100755 --- a/run_wakupublisher.sh +++ b/run_wakupublisher.sh @@ -22,7 +22,7 @@ echo "Using bootstrap node: ${BOOTSTRAP_ENR}" exec /main\ --pubsub-topic="/waku/2/default-waku/proto"\ --content-topic="my-ctopic"\ - --msg-per-second=10\ - --msg-size-kb=1\ + --msg-per-second=${MSG_PER_SECOND}\ + --msg-size-kb=${MSG_SIZE_KBYTES}\ --bootstrap-node=${BOOTSTRAP_ENR}\ --max-peers=50