2023-06-26 14:19:59 +00:00
# nwaku-simulator
## Requires
* docker
* docker-compose
## How to run
```
2023-07-05 08:46:40 +00:00
git clone https://github.com/waku-org/waku-simulator.git
2023-06-26 14:19:59 +00:00
cd waku-simulator
```
2023-07-05 09:09:15 +00:00
Configure the simulation parameters. You can place the env variable in an `.env` file.
2023-06-26 14:19:59 +00:00
```
2024-06-10 10:56:18 +00:00
export NWAKU_IMAGE=quay.io/wakuorg/nwaku-pr:2759-rln-v2
2023-06-26 14:19:59 +00:00
export NUM_NWAKU_NODES=5
2023-10-31 15:17:35 +00:00
export TRAFFIC_DELAY_SECONDS=15
2023-07-05 09:09:15 +00:00
export MSG_SIZE_KBYTES=10
2024-06-10 10:56:18 +00:00
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export RLN_RELAY_EPOCH_SEC=10
export RLN_RELAY_MSG_LIMIT=2
docker-compose --compatibility up -d
2023-06-26 14:19:59 +00:00
```
This will:
2024-06-10 15:56:34 +00:00
* create a private blockchain and attach a block explorer.
* deploy RLN contract to it.
2023-07-05 09:09:15 +00:00
* spin up a bootstrap nwaku node.
2024-04-18 14:07:55 +00:00
* spin up a given amount of nwaku nodes with specific versions.
2024-06-10 15:56:34 +00:00
* register an RLN membership for each nwaku node.
* spin up a `rest-traffic` instance that will inject traffic into the network via the REST API.
* see block-explorer `http://localhost:3000` .
* see grafana with node metrics `http://localhost:3001` .
2023-06-26 14:19:59 +00:00
2023-07-12 07:56:33 +00:00
## notes
The default login/password for grafana is `admin` /`admin`.
2023-06-26 14:19:59 +00:00
## warning
in case arp tables are overflowing:
```
sysctl net.ipv4.neigh.default.gc_thresh3=32000
```
2023-09-28 06:52:51 +00:00
2023-10-31 15:17:35 +00:00
Compose V2 users should spin up the containers with the following command:
```
docker-compose --compatibility up -d
```
2023-09-28 06:52:51 +00:00
# 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.
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 ).
2024-03-12 09:13:44 +00:00
The deployed branch is [deploy-wakusim ](https://github.com/waku-org/waku-simulator/tree/deploy-wakusim ).