mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-08-26 19:11:15 +00:00
chore: switch wakuv2 to waku fleet (#2519)
See https://github.com/status-im/infra-nim-waku/issues/91
This commit is contained in:
+14
-14
@@ -5,7 +5,7 @@
|
||||
The `chat2` application is a basic command-line chat app using the [Waku v2 suite of protocols](https://rfc.vac.dev/).
|
||||
It optionally connects to a [fleet of nodes](fleets.status.im) to provide end-to-end p2p chat capabilities.
|
||||
Each fleet is a publicly accessible network of Waku v2 peers, providing a bootstrap connection point for new peers, historical message storage, etc.
|
||||
The Waku team is currently using this application on the _production_ fleet for internal testing.
|
||||
The Waku team is currently using this application on the _sandbox_ fleet for internal testing.
|
||||
For more information on the available fleets, see [`Connecting to a Waku v2 fleet`](#connecting-to-a-waku-v2-fleet).
|
||||
If you want to try our protocols, or join the dogfooding fun, follow the instructions below.
|
||||
|
||||
@@ -33,16 +33,16 @@ You should be prompted to provide a nickname for the chat session.
|
||||
Choose a nickname >>
|
||||
```
|
||||
|
||||
After entering a nickname, the app will randomly select and connect to a peer from the `prod` fleet.
|
||||
After entering a nickname, the app will randomly select and connect to a peer from the `sandbox` fleet.
|
||||
|
||||
```
|
||||
No static peers configured. Choosing one at random from prod fleet...
|
||||
No static peers configured. Choosing one at random from sandbox fleet...
|
||||
```
|
||||
|
||||
It will then attempt to download historical messages from a random peer in the `prod` fleet.
|
||||
It will then attempt to download historical messages from a random peer in the `sandbox` fleet.
|
||||
|
||||
```
|
||||
Store enabled, but no store nodes configured. Choosing one at random from prod fleet...
|
||||
Store enabled, but no store nodes configured. Choosing one at random from sandbox fleet...
|
||||
```
|
||||
|
||||
Wait for the chat prompt (`>>`) and chat away!
|
||||
@@ -60,10 +60,10 @@ The `chat2` application can retrieve historical chat messages from a node suppor
|
||||
It's possible to query a *specific* store node by configuring its `multiaddr` as `storenode` when starting the app:
|
||||
|
||||
```
|
||||
./build/chat2 --storenode:/ip4/134.209.139.210/tcp/30303/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ
|
||||
./build/chat2 --storenode:/dns4/node-01.do-ams3.waku.test.statusim.net/tcp/30303/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
```
|
||||
|
||||
Alternatively, the `chat2` application will select a random `storenode` for you from the configured fleet (`prod` by default) if `storenode` is left unspecified.
|
||||
Alternatively, the `chat2` application will select a random `storenode` for you from the configured fleet (`sandbox` by default) if `storenode` is left unspecified.
|
||||
|
||||
```
|
||||
./build/chat2
|
||||
@@ -80,7 +80,7 @@ To disable historical message retrieval, use the `--store:false` option:
|
||||
In order to connect to a *specific* node as [`relay`](https://rfc.vac.dev/spec/11/) peer, define that node's `multiaddr` as a `staticnode` when starting the app:
|
||||
|
||||
```
|
||||
./build/chat2 --staticnode:/ip4/134.209.139.210/tcp/30303/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ
|
||||
./build/chat2 --staticnode:/dns4/node-01.do-ams3.waku.test.statusim.net/tcp/30303/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
```
|
||||
|
||||
This will bypass the random peer selection process and connect to the specified node.
|
||||
@@ -93,11 +93,11 @@ It is possible to specify a specific Waku v2 fleet to connect to when starting t
|
||||
./build/chat2 --fleet:test
|
||||
```
|
||||
|
||||
There are currently two fleets to select from, namely _production_ (`wakuv2.prod`) and _test_ (`wakuv2.test`).
|
||||
There are currently two fleets to select from, namely _sandbox_ (`waku.sandbox`) and _test_ (`waku.test`).
|
||||
The `test` fleet is updated with each incremental change to the `nim-waku` codebase.
|
||||
As a result it may have more advanced and experimental features, but will be less stable than `prod`.
|
||||
The `prod` fleet is a deployed network of the latest released Waku v2 nodes.
|
||||
If no `fleet` is specified, `chat2` will connect to the `prod` fleet by default.
|
||||
As a result it may have more advanced and experimental features, but will be less stable than `sandbox`.
|
||||
The `sandbox` fleet is a deployed network of the latest released Waku v2 nodes.
|
||||
If no `fleet` is specified, `chat2` will connect to the `sandbox` fleet by default.
|
||||
To start `chat2` without connecting to a fleet, use the `--fleet:none` option _or_ [specify a static peer](#specifying-a-static-peer).
|
||||
|
||||
## Specifying a content topic
|
||||
@@ -108,7 +108,7 @@ To publish chat messages on a specific [content topic](https://rfc.vac.dev/spec/
|
||||
./build/chat2 --content-topic:/waku/2/my-content-topic/proto
|
||||
```
|
||||
|
||||
> **NOTE:** Currently (2021/05/26) the content topic defaults to `/waku/2/huilong/proto` if left unspecified, where `huilong` is the name of our latest testnet.
|
||||
> **NOTE:** Currently (2021/05/26) the content topic defaults to `/waku/2/huilong/proto` if left unspecified, where `huilong` is the name of our latest testnet.
|
||||
|
||||
## In-chat options
|
||||
|
||||
@@ -153,7 +153,7 @@ Follow the matterbridge [Discord instructions](https://github.com/42wim/matterbr
|
||||
|
||||
# You can get your token by following the instructions on
|
||||
# https://github.com/42wim/matterbridge/wiki/Discord-bot-setup.
|
||||
# If you want roles/groups mentions to be shown with names instead of ID,
|
||||
# If you want roles/groups mentions to be shown with names instead of ID,
|
||||
# you'll need to give your bot the "Manage Roles" permission.
|
||||
Token="MTk4NjIyNDgzNDcdOTI1MjQ4.Cl2FMZ.ZnCjm1XVW7vRze4b7Cq4se7kKWs-abD"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> TODO (2023-05-24): Deprecate or fix
|
||||
|
||||
*NOTE: Some of these addresses might change. To get the latest, please see `curl -s https://fleets.status.im | jq '.fleets["wakuv2.test"]'`*
|
||||
*NOTE: Some of these addresses might change. To get the latest, please see `curl -s https://fleets.status.im | jq '.fleets["waku.test"]'`*
|
||||
|
||||
## Basic chat usage
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
Start two chat apps:
|
||||
|
||||
```
|
||||
./build/chat2 --ports-shift:0 --storenode:/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS --staticnode:/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS
|
||||
./build/chat2 --ports-shift:1 --storenode:/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS --staticnode:/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS
|
||||
./build/chat2 --ports-shift:0 --storenode:/ip4/178.128.141.171/tcp/60000/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W --staticnode:/ip4/178.128.141.171/tcp/60000/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
./build/chat2 --ports-shift:1 --storenode:/ip4/178.128.141.171/tcp/60000/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W --staticnode:/ip4/178.128.141.171/tcp/60000/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
```
|
||||
|
||||
By specifying `staticnode` it connects to that node subscribes to the `waku` topic. This ensures messages are relayed properly.
|
||||
@@ -25,9 +25,7 @@ There is also an interactive mode. Type `/connect` then paste address of other n
|
||||
|
||||
## Dingpu cluster node
|
||||
|
||||
```
|
||||
/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS
|
||||
```
|
||||
> TODO (2024-03-11): Fix node multiaddr
|
||||
|
||||
## Run a node
|
||||
|
||||
|
||||
@@ -42,30 +42,30 @@ The following command line options are available for both `wakunode2` or `chat2`
|
||||
|
||||
A node will attempt connection to all discovered nodes.
|
||||
|
||||
## Example for `wakuv2.test` fleet
|
||||
## Example for `waku.test` fleet
|
||||
|
||||
To illustrate the above and prove the concept,
|
||||
a list of `wakuv2.test` fleet nodes was encoded according to EIP-1459 and deployed to `test.nodes.vac.dev`.
|
||||
The list was signed by the public key `AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C`.
|
||||
The complete URL for DNS discovery is therefore: `enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.nodes.vac.dev`.
|
||||
a list of `waku.test` fleet nodes was encoded according to EIP-1459 and deployed to `test.waku.nodes.status.im`.
|
||||
The list was signed by the public key `AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI`.
|
||||
The complete URL for DNS discovery is therefore: `enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im`.
|
||||
|
||||
To run a `wakunode2` with DNS-based discovery of `wakuv2.test` nodes:
|
||||
To run a `wakunode2` with DNS-based discovery of `waku.test` nodes:
|
||||
|
||||
```
|
||||
./build/wakunode2 --dns-discovery:true --dns-discovery-url:enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.nodes.vac.dev
|
||||
./build/wakunode2 --dns-discovery:true --dns-discovery-url:enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im
|
||||
```
|
||||
|
||||
Similarly, for `chat2`:
|
||||
|
||||
```
|
||||
./build/chat2 --dns-discovery:true --dns-discovery-url:enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.nodes.vac.dev
|
||||
./build/chat2 --dns-discovery:true --dns-discovery-url:enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im
|
||||
```
|
||||
|
||||
The node will discover and attempt connection to all `wakuv2.test` nodes during setup procedures.
|
||||
The node will discover and attempt connection to all `waku.test` nodes during setup procedures.
|
||||
|
||||
To use specific DNS name servers, one or more `--dns-discovery-name-server` arguments can be added:
|
||||
|
||||
```
|
||||
./build/wakunode2 --dns-discovery:true --dns-discovery-url:enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.nodes.vac.dev --dns-dis
|
||||
./build/wakunode2 --dns-discovery:true --dns-discovery-url:enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im --dns-dis
|
||||
covery-name-server:8.8.8.8 --dns-discovery-name-server:8.8.4.4
|
||||
```
|
||||
|
||||
@@ -39,6 +39,4 @@ You should see other node receive something.
|
||||
|
||||
## Nangang cluster node
|
||||
|
||||
```
|
||||
/ip4/134.209.139.210/tcp/60000/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS
|
||||
```
|
||||
> TODO (2024-03-11): Fix node multiaddr
|
||||
|
||||
@@ -6,20 +6,20 @@ Members can be dynamically added to the group and the group size can grow up to
|
||||
This differs from the prior test scenarios in which the RLN group was static and the set of members' keys was hardcoded and fixed.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
To complete this tutorial, you will need
|
||||
## Prerequisites
|
||||
To complete this tutorial, you will need
|
||||
|
||||
1. An rln keystore file with credentials to the rln membership smart contract you wish to use. You may obtain this by registering to the smart contract and generating a keystore, or by using the [rln-keystore-generator](./rln-keystore-generator.md) which does that for you.
|
||||
|
||||
|
||||
## Overview
|
||||
Figure 1 provides an overview of the interaction of the chat2 clients with the test fleets and the membership contract.
|
||||
Figure 1 provides an overview of the interaction of the chat2 clients with the test fleets and the membership contract.
|
||||
At a high level, when a chat2 client is run with Waku-RLN-Relay mounted in on-chain mode.
|
||||
|
||||
Under the hood, the chat2 client constantly listens to the membership contract and keeps itself updated with the latest state of the group.
|
||||
|
||||
In the following test setting, the chat2 clients are to be connected to the Waku test fleets as their first hop.
|
||||
The test fleets will act as routers and are also set to run Waku-RLN-Relay over the same pubsub topic and content topic as chat2 clients i.e., the default pubsub topic of `/waku/2/default-waku/proto` and the content topic of `/toy-chat/3/mingde/proto`.
|
||||
In the following test setting, the chat2 clients are to be connected to the Waku test fleets as their first hop.
|
||||
The test fleets will act as routers and are also set to run Waku-RLN-Relay over the same pubsub topic and content topic as chat2 clients i.e., the default pubsub topic of `/waku/2/default-waku/proto` and the content topic of `/toy-chat/3/mingde/proto`.
|
||||
Spam messages published on the said combination of topics will be caught by the test fleet nodes and will not be routed.
|
||||
Note that spam protection does not rely on the presence of the test fleets.
|
||||
In fact, all the chat2 clients are also capable of catching and dropping spam messages if they receive any.
|
||||
@@ -30,7 +30,7 @@ You can test it by connecting two chat2 clients (running Waku-RLN-Relay) directl
|
||||
|
||||
# Set up
|
||||
## Build chat2
|
||||
First, build chat2
|
||||
First, build chat2
|
||||
|
||||
```bash
|
||||
make chat2
|
||||
@@ -38,7 +38,7 @@ make chat2
|
||||
|
||||
## Set up a chat2 client
|
||||
|
||||
Run the following command to set up your chat2 client.
|
||||
Run the following command to set up your chat2 client.
|
||||
|
||||
```bash
|
||||
./build/chat2 --fleet:test \
|
||||
@@ -49,7 +49,7 @@ Run the following command to set up your chat2 client.
|
||||
--rln-relay-cred-path:xxx/xx/rlnKeystore.json \
|
||||
--rln-relay-cred-password:xxxx \
|
||||
--rln-relay-eth-client-address:xxxx \
|
||||
--ports-shift:1
|
||||
--ports-shift:1
|
||||
```
|
||||
|
||||
In this command
|
||||
@@ -62,7 +62,7 @@ In this command
|
||||
You may check the state of the contract on the [Sepolia testnet](https://sepolia.etherscan.io/address/0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4).
|
||||
- the `--rln-relay-cred-path` option denotes the path to the keystore file described above
|
||||
- the `--rln-relay-cred-password` option denotes the password to the keystore
|
||||
- the `rln-relay-eth-client-address` is the WebSocket address of the hosted node on the Sepolia testnet.
|
||||
- the `rln-relay-eth-client-address` is the WebSocket address of the hosted node on the Sepolia testnet.
|
||||
You need to replace the `xxxx` with the actual node's address.
|
||||
|
||||
For `rln-relay-eth-client-address`, if you do not know how to obtain it, you may use the following tutorial on the [prerequisites of running on-chain spam-protected chat2](./pre-requisites-of-running-on-chain-spam-protected-chat2.md).
|
||||
@@ -79,11 +79,11 @@ then you will see a couple of other messages related to setting up the connectio
|
||||
the content may differ on your screen though:
|
||||
```
|
||||
Connecting to test fleet using DNS discovery...
|
||||
Discovered and connecting to @[16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm, 16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ, 16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS]
|
||||
Discovered and connecting to @[16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp, 16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W, 16Uiu2HAmDCp8XJ9z1ev18zuv8NHekAsjNyezAvmMfFEJkiharitG]
|
||||
Listening on
|
||||
/ip4/75.157.120.249/tcp/60001/p2p/16Uiu2HAmQXuZmbjFWGagthwVsPFrc5ZrZ9c53qdUA45TWoZaokQn
|
||||
Store enabled, but no store nodes configured. Choosing one at random from discovered peers
|
||||
Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
|
||||
Connecting to storenode: 16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp
|
||||
```
|
||||
You will also see some historical messages being fetched, again the content may be different on your end:
|
||||
|
||||
@@ -124,18 +124,18 @@ Once you type a chat line and hit enter, you will see a message that indicates t
|
||||
<Jul 26, 12:55> Alice: Hi
|
||||
```
|
||||
The numerical value `165886530` indicates the epoch of the message `Hi`.
|
||||
You will see a different value than `165886530` on your screen.
|
||||
You will see a different value than `165886530` on your screen.
|
||||
If two messages sent by the same chat2 client happen to have the same RLN epoch value, then one of them will be detected as spam and won't be routed (by test fleets in this test setting).
|
||||
At the time of this tutorial, the epoch duration is set to `10` seconds.
|
||||
You can inspect the current epoch value by checking the following [constant variable](https://github.com/waku-org/nwaku/blob/44c543129ee4149255a00a05f1e7d21f8fa28626/waku/v2/waku_rln_relay/constants.nim#L51) in the nim-waku codebase.
|
||||
Thus, if you send two messages less than `10` seconds apart, they are likely to get the same `rln epoch` values.
|
||||
|
||||
After sending a chat message, you may experience some delay before the next chat prompt appears.
|
||||
After sending a chat message, you may experience some delay before the next chat prompt appears.
|
||||
The reason is that under the hood a zero-knowledge proof is being generated and attached to your message.
|
||||
|
||||
|
||||
Try to spam the network by violating the message rate limit i.e.,
|
||||
sending more than one message per epoch.
|
||||
sending more than one message per epoch.
|
||||
Your messages will be routed via test fleets that are running in spam-protected mode over the same content topic i.e., `/toy-chat/3/mingde/proto` as your chat client.
|
||||
Your spam activity will be detected by them and your message will not reach the rest of the chat clients.
|
||||
You can check this by running a second chat user and verifying that spam messages are not displayed as they are filtered by the test fleets.
|
||||
@@ -158,26 +158,26 @@ Note that the value used for `rln-relay-eth-client-address` in the following cod
|
||||
|
||||
The two chat clients namely `Alice` and `Bob` are connected to the test fleets.
|
||||
`Alice` sends 4 messages i.e., `message1`, `message2`, `message3`, and `message4`.
|
||||
However, only three of them reach `Bob`.
|
||||
This is because the two messages `message2` and `message3` have identical RLN epoch values, so, one of them gets discarded by the test fleets as a spam message.
|
||||
However, only three of them reach `Bob`.
|
||||
This is because the two messages `message2` and `message3` have identical RLN epoch values, so, one of them gets discarded by the test fleets as a spam message.
|
||||
The test fleets do not relay `message3` further, hence `Bob` never receives it.
|
||||
You can check this fact by looking at `Bob`'s console, where `message3` is missing.
|
||||
You can check this fact by looking at `Bob`'s console, where `message3` is missing.
|
||||
|
||||
|
||||
**Alice**
|
||||
```bash
|
||||
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 --rln-relay-cred-path:rlnKeystore.json --rln-relay-cred-password:password --rln-relay-eth-client-address:https://sepolia.infura.io/v3/12345678901234567890123456789012 --ports-shift=1
|
||||
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 --rln-relay-cred-path:rlnKeystore.json --rln-relay-cred-password:password --rln-relay-eth-client-address:https://sepolia.infura.io/v3/12345678901234567890123456789012 --ports-shift=1
|
||||
```
|
||||
|
||||
```
|
||||
Choose a nickname >> Alice
|
||||
Welcome, Alice!
|
||||
Connecting to test fleet using DNS discovery...
|
||||
Discovered and connecting to @[16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm, 16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ, 16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS]
|
||||
Discovered and connecting to @[16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp, 16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W, 16Uiu2HAmDCp8XJ9z1ev18zuv8NHekAsjNyezAvmMfFEJkiharitG]
|
||||
Listening on
|
||||
/ip4/75.157.120.249/tcp/60001/p2p/16Uiu2HAmH7XbkcdbA1CCs91r93HuwZHSdXppCNvJTDVvgGhuxyuG
|
||||
Store enabled, but no store nodes configured. Choosing one at random from discovered peers
|
||||
Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
|
||||
Connecting to storenode: 16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp
|
||||
<Jul 26, 10:41> Bob: hi
|
||||
<Jul 26, 10:41> Bob: hi
|
||||
<Jun 29, 16:21> Alice: spam1
|
||||
@@ -204,23 +204,23 @@ your rln identity commitment key is: bd093cbf14fb933d53f596c33f98b3df83b7e9f7a19
|
||||
>> message4
|
||||
--rln epoch: 165886593
|
||||
<Jul 26, 13:05> Alice: message4
|
||||
>>
|
||||
>>
|
||||
```
|
||||
|
||||
**Bob**
|
||||
```bash
|
||||
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 --rln-relay-cred-path:rlnKeystore.json --rln-relay-cred-index:1 --rln-relay-cred-password:password --rln-relay-eth-client-address:https://sepolia.infura.io/v3/12345678901234567890123456789012 --ports-shift=2
|
||||
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 --rln-relay-cred-path:rlnKeystore.json --rln-relay-cred-index:1 --rln-relay-cred-password:password --rln-relay-eth-client-address:https://sepolia.infura.io/v3/12345678901234567890123456789012 --ports-shift=2
|
||||
```
|
||||
|
||||
```
|
||||
Choose a nickname >> Bob
|
||||
Welcome, Bob!
|
||||
Connecting to test fleet using DNS discovery...
|
||||
Discovered and connecting to @[16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm, 16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ, 16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS]
|
||||
Discovered and connecting to @[16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp, 16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W, 16Uiu2HAmDCp8XJ9z1ev18zuv8NHekAsjNyezAvmMfFEJkiharitG]
|
||||
Listening on
|
||||
/ip4/75.157.120.249/tcp/60002/p2p/16Uiu2HAmE7fPUWGJ7UFJ3p2a3RNiEtEvAWhpfUStcCDmVGhm4h4Z
|
||||
Store enabled, but no store nodes configured. Choosing one at random from discovered peers
|
||||
Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
|
||||
Connecting to storenode: 16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp
|
||||
rln-relay preparation is in progress ...
|
||||
your membership index is: xx
|
||||
your rln identity key is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
@@ -228,5 +228,5 @@ your rln identity commitment key is: d4961a7681521730bc7f9ade185c632b94b70624b2e
|
||||
>> <Jul 26, 13:05> Alice: message1
|
||||
>> <Jul 26, 13:05> Alice: message2
|
||||
>> <Jul 26, 13:05> Alice: message4
|
||||
>>
|
||||
```
|
||||
>>
|
||||
```
|
||||
|
||||
@@ -5,11 +5,11 @@ You will connect your chat2 client to waku2 test fleets.
|
||||
Note that test fleets will not filter spam messages, they merely route messages.
|
||||
Spam detection takes place at the chat2 users end.
|
||||
In this setting, you should try to spam the network by violating the message rate limit i.e.,
|
||||
sending more than one message per epoch.
|
||||
sending more than one message per epoch.
|
||||
At the time of this tutorial, the epoch duration is set to `10` seconds.
|
||||
You can inspect the current epoch value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/constants.nim#L245) in the nim-waku codebase.
|
||||
Your messages will be routed via test fleets and will arrive at other live chat2 clients that are running in rate-limited mode over the same content topic i.e., `/toy-chat/3/mingde/proto`.
|
||||
Your spam activity will be detected by them and a proper message will be shown on their console.
|
||||
Your spam activity will be detected by them and a proper message will be shown on their console.
|
||||
|
||||
# Set up
|
||||
## Build chat2
|
||||
@@ -20,7 +20,7 @@ make chat2
|
||||
```
|
||||
|
||||
## Setup a chat2 node in rate-limited mode
|
||||
Run the following command to set up your chat2 client.
|
||||
Run the following command to set up your chat2 client.
|
||||
|
||||
```
|
||||
./build/chat2 --content-topic:/toy-chat/3/mingde/proto --ports-shift=1 --fleet:test --rln-relay:true --rln-relay-membership-index:your_index
|
||||
@@ -28,7 +28,7 @@ Run the following command to set up your chat2 client.
|
||||
```
|
||||
In this command
|
||||
- the `rln-relay` flag is set to true to enable RLN-Relay protocol for spam protection.
|
||||
- the `rln-relay-membership-index` is used to pick one RLN key out of the 100 available hardcoded RLN keys.
|
||||
- the `rln-relay-membership-index` is used to pick one RLN key out of the 100 available hardcoded RLN keys.
|
||||
You can pass your index using this command `--rln-relay-membership-index: your_index` e.g., `--rln-relay-membership-index:19` .
|
||||
Please use the index assigned to you in the dogfooding coordination phase.
|
||||
If you pick an index at random you may end up using the same key-pair as someone else, hence your messaging rate will be shared with that person(s).
|
||||
@@ -53,12 +53,12 @@ Once you type a chat line and hit enter, you will see a message that indicates t
|
||||
<Feb 15, 12:27> Bob: Hi!
|
||||
```
|
||||
The numerical value `164495684` indicates the epoch of the message `Hi!`.
|
||||
You will see a different value than `164495684` on your screen.
|
||||
You will see a different value than `164495684` on your screen.
|
||||
If two messages sent by the same chat2 client happen to have the same RLN epoch value, then one of them will be detected as spam by the receiving chat2 clients.
|
||||
At the time of this tutorial, the epoch duration is set to `10` seconds.
|
||||
Thus, if you send two messages less than `10` seconds apart, they are likely to get the same `rln epoch` values.
|
||||
|
||||
After sending a chat message, you may experience some delay before the next chat prompt appears.
|
||||
After sending a chat message, you may experience some delay before the next chat prompt appears.
|
||||
The reason is that under the hood a zero-knowledge proof is being generated and attached to your message.
|
||||
|
||||
Once you are done with the test, make sure you close all the chat2 clients by typing `/exit` command.
|
||||
@@ -70,10 +70,10 @@ quitting...
|
||||
# Sample test output
|
||||
|
||||
In the following sample test, two chat2 clients are set up, namely `Alice` and `Bob`.
|
||||
`Bob` sends three messages i.e., `message1`, `message2`, and `message3` to the test fleets.
|
||||
`Bob` sends three messages i.e., `message1`, `message2`, and `message3` to the test fleets.
|
||||
Test fleets will route the messages to their connections including `Alice`.
|
||||
The two messages `message2` and `message3` have an identical RLN epoch value of `164504930`, so, one of them will be detected as a spam message by `Alice`.
|
||||
You can check this fact by looking at the `Alice` console, where `A spam message is found and discarded : <Feb 16, 14:08> Bob: message3` is presented.
|
||||
The two messages `message2` and `message3` have an identical RLN epoch value of `164504930`, so, one of them will be detected as a spam message by `Alice`.
|
||||
You can check this fact by looking at the `Alice` console, where `A spam message is found and discarded : <Feb 16, 14:08> Bob: message3` is presented.
|
||||
|
||||
|
||||
Bob
|
||||
@@ -82,11 +82,11 @@ Bob
|
||||
Choose a nickname >> Bob
|
||||
Welcome, Bob!
|
||||
Connecting to test fleet using DNS discovery...
|
||||
Discovered and connecting to @[16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ, 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm, 16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS]
|
||||
Discovered and connecting to @[16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W, 16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp, 16Uiu2HAmDCp8XJ9z1ev18zuv8NHekAsjNyezAvmMfFEJkiharitG]
|
||||
Listening on
|
||||
/ip4/75.157.120.249/tcp/60002/p2p/16Uiu2HAmKdCdP89q6CwLc6PeFDJnVR1EmM7fTgtphHiacSNBnuAz
|
||||
Store enabled, but no store nodes configured. Choosing one at random from discovered peers
|
||||
Connecting to storenode: 16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ
|
||||
Connecting to storenode: 16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
>> message1
|
||||
--rln epoch: 164504929
|
||||
<Feb 16, 14:08> Bob: message1
|
||||
@@ -111,11 +111,11 @@ Alice
|
||||
Choose a nickname >> Alice
|
||||
Welcome, Alice!
|
||||
Connecting to test fleet using DNS discovery...
|
||||
Discovered and connecting to @[16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ, 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm, 16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS]
|
||||
Discovered and connecting to @[16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W, 16Uiu2HAkzHaTP5JsUwfR9NR8Rj9HC24puS6ocaU8wze4QrXr9iXp, 16Uiu2HAmDCp8XJ9z1ev18zuv8NHekAsjNyezAvmMfFEJkiharitG]
|
||||
Listening on
|
||||
/ip4/75.157.120.249/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ
|
||||
Store enabled, but no store nodes configured. Choosing one at random from discovered peers
|
||||
Connecting to storenode: 16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ
|
||||
Connecting to storenode: 16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd38UcQD6ej5W
|
||||
>> <Feb 16, 14:08> Bob: message1
|
||||
>> <Feb 16, 14:08> Bob: message2
|
||||
>> A spam message is found and discarded : <Feb 16, 14:08> Bob: message3
|
||||
|
||||
Reference in New Issue
Block a user