From e900362c0ef2223aaab41bd4f9e71765d0e6bc61 Mon Sep 17 00:00:00 2001 From: stubbsta Date: Fri, 21 Jun 2024 10:25:25 +0200 Subject: [PATCH] update connect-spam-node doc --- src/connect-spam-node.md | 50 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/src/connect-spam-node.md b/src/connect-spam-node.md index 02c390a..57642d6 100644 --- a/src/connect-spam-node.md +++ b/src/connect-spam-node.md @@ -1,16 +1,58 @@ # Connect external spam node -You can connect a node to the network that spams the nodes, sending messaging exceeding its rate limit. +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. ```bash -# TODO: Wait until we have waku-spammer +docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ + --relay=true \ + --rln-relay=true \ + --rln-relay-dynamic=true \ + --rln-relay-eth-client-address=http://foundry:8545 \ + --rln-relay-eth-contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ + --rln-relay-epoch-sec=1 \ + --rln-relay-user-message-limit=1 \ + --log-level=DEBUG \ + --staticnode=/ip4/10.2.0.16/tcp/60000/p2p/16Uiu2HAmAA99YfoLitSXgY1bHaqjaTKhyrU4M4y3D1rVj1bmcgL8 \ + --pubsub-topic=/waku/2/rs/66/0 \ + --cluster-id=66 \ + --rln-relay-eth-private-key=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + --rln-relay-cred-path=/keystore.json \ + --rln-relay-cred-password=password123 \ + --spammer=true \ + --spammer-delay-between-msg=200 ``` +You can try to connect multiple spamming nodes, but it might be necessary to use a different private-key for each one to avoid the limitation of multiple contract transactions with the same nonce. Otherwise add a delay before running a new node. Note the `&`. Remember to kill the new nodes once you are done. + +```bash +for i in {1..5}; do +docker run -it --network waku-simulator_simulation quay.io/wakuorg/nwaku-pr:2821 \ + --relay=true \ + --rln-relay=true \ + --rln-relay-dynamic=true \ + --rln-relay-eth-client-address=http://foundry:8545 \ + --rln-relay-eth-contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ + --rln-relay-epoch-sec=1 \ + --rln-relay-user-message-limit=1 \ + --log-level=DEBUG \ + --staticnode=/ip4/10.2.0.16/tcp/60000/p2p/16Uiu2HAmAA99YfoLitSXgY1bHaqjaTKhyrU4M4y3D1rVj1bmcgL8 \ + --pubsub-topic=/waku/2/rs/66/0 \ + --cluster-id=66 \ + --rln-relay-eth-private-key=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + --rln-relay-cred-path=/keystore.json \ + --rln-relay-cred-password=password123 \ + --spammer=true \ + --spammer-delay-between-msg=200 & +done +``` 🎯**Goals**: -- TODO: +- Connect a spamming node(s) to the network where spam messages are rejected and misbehaving peers are disconnected for a time. +- See how the network reacts to different spamming rates. 👀**Observability**: -- TODO: \ No newline at end of file +- Check the logs of the new node logs, ensuring the behaviour matches the expected. +- Check grafana metrics at `localhost:3001`. +- Check that the RLN membership was registered in the block explorer `localhost:3000`. \ No newline at end of file