logos-messaging-simulator/src/inject-traffic.md

25 lines
1.4 KiB
Markdown
Raw Normal View History

2024-06-12 12:34:16 +02:00
# Inject traffic
2024-06-13 14:29:47 +02:00
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]`.
2024-06-12 12:34:16 +02:00
```jsx
docker run -it --network waku-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"
2024-06-12 12:34:16 +02:00
```
2024-06-13 14:29:47 +02:00
Note that the REST API doesnt allow to publish messages exceeding the rate limit, so this tool cant be used to test beyond the rate limits.
2024-06-12 12:34:16 +02:00
🎯**Goals**:
- Test message publishing via the REST API and that they are valid across the network.
- Test the network under different message load: rates and sizes.
👀**Observability**:
- Check the logs of each `nwaku` node, verifying the messages are correctly received via the API and forwarded to other nodes.
- Check grafana dashboard `localhost:3001` ”RLN Valid Messages Total” increases as expected.