chore(rln-relay): docs and config update for testnet 3 (#1738)

* chore(rln-relay): docs and config update for testnet 3

* chore(rln-relay): update more docs
This commit is contained in:
Aaryamann Challani 2023-05-19 18:22:01 +05:30 committed by GitHub
parent 0ced21959a
commit bb9d231bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 66 additions and 68 deletions

View File

@ -238,8 +238,8 @@ type
name: "rln-relay-membership-index" }: uint name: "rln-relay-membership-index" }: uint
rlnRelayContentTopic* {. rlnRelayContentTopic* {.
desc: "the pubsub topic for which rln-relay gets enabled", desc: "the content topic for which rln-relay gets enabled",
defaultValue: "/toy-chat/2/luzhou/proto" defaultValue: "/toy-chat/3/mingde/proto"
name: "rln-relay-content-topic" }: ContentTopic name: "rln-relay-content-topic" }: ContentTopic
rlnRelayPubsubTopic* {. rlnRelayPubsubTopic* {.

View File

@ -151,8 +151,8 @@ type
name: "rln-relay-pubsub-topic" }: string name: "rln-relay-pubsub-topic" }: string
rlnRelayContentTopic* {. rlnRelayContentTopic* {.
desc: "the pubsub topic for which rln-relay gets enabled", desc: "the content topic for which rln-relay gets enabled",
defaultValue: "/toy-chat/2/luzhou/proto" defaultValue: "/toy-chat/3/mingde/proto"
name: "rln-relay-content-topic" }: string name: "rln-relay-content-topic" }: string
rlnRelayDynamic* {. rlnRelayDynamic* {.
@ -172,12 +172,12 @@ type
# NOTE: This can be derived from the private key, but kept for future use # NOTE: This can be derived from the private key, but kept for future use
rlnRelayEthAccountAddress* {. rlnRelayEthAccountAddress* {.
desc: "Account address for the Ethereum testnet Goerli", desc: "Account address for the Ethereum testnet Sepolia",
defaultValue: "" defaultValue: ""
name: "rln-relay-eth-account-address" }: string name: "rln-relay-eth-account-address" }: string
rlnRelayEthAccountPrivateKey* {. rlnRelayEthAccountPrivateKey* {.
desc: "Account private key for the Ethereum testnet Goerli", desc: "Account private key for the Ethereum testnet Sepolia",
defaultValue: "" defaultValue: ""
name: "rln-relay-eth-account-private-key" }: string name: "rln-relay-eth-account-private-key" }: string

View File

@ -41,8 +41,8 @@ into your wakunode2 binary.
Follow [Step 10](../droplet-quickstart.md#10-run-nwaku) of the [droplet quickstart](../droplet-quickstart.md) guide, while replacing the run command with - Follow [Step 10](../droplet-quickstart.md#10-run-nwaku) of the [droplet quickstart](../droplet-quickstart.md) guide, while replacing the run command with -
```bash ```bash
export GOERLI_WS_NODE_ADDRESS=<WS RPC URL to a Goerli Node> export SEPOLIA_WS_NODE_ADDRESS=<WS RPC URL to a Sepolia Node>
export RLN_RELAY_CONTRACT_ADDRESS="0x4252105670fe33d2947e8ead304969849e64f2a6" # Replace this with any compatible implementation export RLN_RELAY_CONTRACT_ADDRESS="0x9C09146844C1326c2dBC41c451766C7138F88155" # Replace this with any compatible implementation
$WAKUNODE_DIR/wakunode2 \ $WAKUNODE_DIR/wakunode2 \
--store:true \ --store:true \
--persist-messages \ --persist-messages \
@ -52,7 +52,7 @@ $WAKUNODE_DIR/wakunode2 \
--rln-relay:true \ --rln-relay:true \
--rln-relay-dynamic:true \ --rln-relay-dynamic:true \
--rln-relay-eth-contract-address:"$RLN_RELAY_CONTRACT_ADDRESS" \ --rln-relay-eth-contract-address:"$RLN_RELAY_CONTRACT_ADDRESS" \
--rln-relay-eth-client-address:"$GOERLI_WS_NODE_ADDRESS" --rln-relay-eth-client-address:"$SEPOLIA_WS_NODE_ADDRESS"
``` ```
OR OR
@ -61,8 +61,8 @@ If you are running the nwaku node within docker, follow [Step 2](../docker-quick
```bash ```bash
export WAKU_FLEET=<entree of the fleet> export WAKU_FLEET=<entree of the fleet>
export GOERLI_WS_NODE_ADDRESS=<WS RPC URL to a Goerli Node> export SEPOLIA_WS_NODE_ADDRESS=<WS RPC URL to a Sepolia Node>
export RLN_RELAY_CONTRACT_ADDRESS="0x4252105670fe33d2947e8ead304969849e64f2a6" # Replace this with any compatible implementation export RLN_RELAY_CONTRACT_ADDRESS="0x9C09146844C1326c2dBC41c451766C7138F88155" # Replace this with any compatible implementation
docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.12.0 \ docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.12.0 \
--dns-discovery:true \ --dns-discovery:true \
--dns-discovery-url:"$WAKU_FLEET" \ --dns-discovery-url:"$WAKU_FLEET" \
@ -71,7 +71,7 @@ docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.12.0 \
--rln-relay:true \ --rln-relay:true \
--rln-relay-dynamic:true \ --rln-relay-dynamic:true \
--rln-relay-eth-contract-address:"$RLN_RELAY_CONTRACT_ADDRESS" \ --rln-relay-eth-contract-address:"$RLN_RELAY_CONTRACT_ADDRESS" \
--rln-relay-eth-client-address:"$GOERLI_WS_NODE_ADDRESS" --rln-relay-eth-client-address:"$SEPOLIA_WS_NODE_ADDRESS"
``` ```
> Note: You can choose to keep connections to other nodes alive by adding the `--keep-alive` flag. > Note: You can choose to keep connections to other nodes alive by adding the `--keep-alive` flag.
@ -82,7 +82,7 @@ runtime arguments -
1. `--rln-relay`: Allows waku-rln-relay to be mounted into the setup of the nwaku node 1. `--rln-relay`: Allows waku-rln-relay to be mounted into the setup of the nwaku node
2. `--rln-relay-dynamic`: Enables waku-rln-relay to connect to an ethereum node to fetch the membership group 2. `--rln-relay-dynamic`: Enables waku-rln-relay to connect to an ethereum node to fetch the membership group
3. `--rln-relay-eth-contract-address`: The contract address of an RLN membership group 3. `--rln-relay-eth-contract-address`: The contract address of an RLN membership group
4. `--rln-relay-eth-client-address`: The websocket url to a Goerli ethereum node 4. `--rln-relay-eth-client-address`: The websocket url to a Sepolia ethereum node
You should now have nwaku running, with RLN enabled! You should now have nwaku running, with RLN enabled!

View File

@ -1,13 +1,13 @@
# Spam-protected chat2 application with on-chain group management # Spam-protected chat2 application with on-chain group management
This document is a tutorial on how to run the chat2 application in the spam-protected mode using the Waku-RLN-Relay protocol and with dynamic/on-chain group management. This document is a tutorial on how to run the chat2 application in the spam-protected mode using the Waku-RLN-Relay protocol and with dynamic/on-chain group management.
In the on-chain/dynamic group management, the state of the group members i.e., their identity commitment keys is moderated via a membership smart contract deployed on the Goerli network which is one of the Ethereum test-nets. In the on-chain/dynamic group management, the state of the group members i.e., their identity commitment keys is moderated via a membership smart contract deployed on the Sepolia network which is one of the Ethereum test-nets.
Members can be dynamically added to the group and the group size can grow up to 2^20 members. Members can be dynamically added to the group and the group size can grow up to 2^20 members.
This differs from the prior test scenarios in which the RLN group was static and the set of members' keys was hardcoded and fixed. 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 ## Prerequisites
To complete this tutorial, you will need 1) an account with at least `0.001` ethers on the Goerli test net and 2) a hosted node on the Goerli testnet. To complete this tutorial, you will need 1) an account with at least `0.001` ethers on the Sepolia testnet and 2) a hosted node on the Sepolia testnet.
In case you are not familiar with either of these two steps, you may follow the following tutorial to fulfill the [prerequisites of running on-chain spam-protected chat2](./pre-requisites-of-running-on-chain-spam-protected-chat2.md). In case you are not familiar with either of these two steps, you may follow the following tutorial to fulfill the [prerequisites of running on-chain spam-protected chat2](./pre-requisites-of-running-on-chain-spam-protected-chat2.md).
Note that the required `0.001` ethers correspond to the registration fee, Note that the required `0.001` ethers correspond to the registration fee,
however, you still need to have more funds in your account to cover the cost of the transaction gas fee. however, you still need to have more funds in your account to cover the cost of the transaction gas fee.
@ -19,15 +19,15 @@ Figure 1 provides an overview of the interaction of the chat2 clients with the t
At a high level, when a chat2 client is run with Waku-RLN-Relay mounted in on-chain mode, it creates an RLN credential (i.e., an identity key and an identity commitment key) and At a high level, when a chat2 client is run with Waku-RLN-Relay mounted in on-chain mode, it creates an RLN credential (i.e., an identity key and an identity commitment key) and
sends a transaction to the membership contract to register the corresponding membership identity commitment key. sends a transaction to the membership contract to register the corresponding membership identity commitment key.
This transaction will also transfer `0.001` Ethers to the contract as a membership fee. This transaction will also transfer `0.001` Ethers to the contract as a membership fee.
This amount plus the transaction fee will be deducted from the supplied Goerli account. This amount plus the transaction fee will be deducted from the supplied Sepolia account.
Once the transaction is mined and the registration is successful, the registered credential will get displayed on the console of your chat2 client. Once the transaction is mined and the registration is successful, the registered credential will get displayed on the console of your chat2 client.
You may copy the displayed RLN credential and reuse them for the future execution of the chat2 application. You may copy the displayed RLN credential and reuse them for the future execution of the chat2 application.
Proper instructions in this regard is provided in the following [section](#how-to-persist-and-reuse-rln-credential). Proper instructions in this regard is provided in the following [section](#how-to-persist-and-reuse-rln-credential).
If you choose not to reuse the same credential, then for each execution, a new registration will take place and more funds will get deducted from your Goerli account. If you choose not to reuse the same credential, then for each execution, a new registration will take place and more funds will get deducted from your Sepolia account.
Under the hood, the chat2 client constantly listens to the membership contract and keeps itself updated with the latest state of the group. 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. 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/2/luzhou/proto`. 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. 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. 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. In fact, all the chat2 clients are also capable of catching and dropping spam messages if they receive any.
@ -49,20 +49,20 @@ make chat2 RLN=true
Run the following command to set up your chat2 client. Run the following command to set up your chat2 client.
```bash ```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/2/luzhou/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x4252105670fe33d2947e8ead304969849e64f2a6 --rln-relay-eth-account-private-key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --rln-relay-eth-client-address:xxxx --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:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --rln-relay-eth-client-address:xxxx --ports-shift=1
``` ```
In this command In this command
- the `--fleet:test` indicates that the chat2 app gets connected to the test fleets. - the `--fleet:test` indicates that the chat2 app gets connected to the test fleets.
- the `toy-chat/2/luzhou/proto` passed to the `content-topic` option indicates the content topic on which the chat2 application is going to run. - the `toy-chat/3/mingde/proto` passed to the `content-topic` option indicates the content topic on which the chat2 application is going to run.
- the `rln-relay` flag is set to `true` to enable the Waku-RLN-Relay protocol for spam protection. - the `rln-relay` flag is set to `true` to enable the Waku-RLN-Relay protocol for spam protection.
- the `--rln-relay-dynamic` flag is set to `true` to enable the on-chain mode of Waku-RLN-Relay protocol with dynamic group management. - the `--rln-relay-dynamic` flag is set to `true` to enable the on-chain mode of Waku-RLN-Relay protocol with dynamic group management.
- the `--rln-relay-eth-contract-address` option gets the address of the membership contract. - the `--rln-relay-eth-contract-address` option gets the address of the membership contract.
The current address of the contract is `0x4252105670fe33d2947e8ead304969849e64f2a6`. The current address of the contract is `0x9C09146844C1326c2dBC41c451766C7138F88155`.
You may check the state of the contract on the [Goerli testnet](https://goerli.etherscan.io/address/0x4252105670fe33d2947e8ead304969849e64f2a6). You may check the state of the contract on the [Sepolia testnet](https://sepolia.etherscan.io/address/0x9C09146844C1326c2dBC41c451766C7138F88155).
- the `rln-relay-eth-account-private-key` option is for your account private key on the Goerli testnet. - the `rln-relay-eth-account-private-key` option is for your account private key on the Sepolia testnet.
It is made up of 64 hex characters (not sensitive to the `0x` prefix). It is made up of 64 hex characters (not sensitive to the `0x` prefix).
- the `rln-relay-eth-client-address` is the WebSocket address of the hosted node on the Goerli 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. You need to replace the `xxxx` with the actual node's address.
For the last two config options i.e., `rln-relay-eth-account-private-key` and `rln-relay-eth-client-address`, if you do not know how to obtain those, 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). For the last two config options i.e., `rln-relay-eth-account-private-key` and `rln-relay-eth-client-address`, if you do not know how to obtain those, 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).
@ -106,9 +106,9 @@ rln-relay preparation is in progress ...
``` ```
At this phase, your RLN credential is being created and a transaction is being sent to the membership smart contract. At this phase, your RLN credential is being created and a transaction is being sent to the membership smart contract.
It will take some time for the transaction to be finalized. It will take some time for the transaction to be finalized.
Once finalized, a link to the transaction on the Goerli network will be shown i.e., Once finalized, a link to the transaction on the Sepolia network will be shown i.e.,
``` ```
You are registered to the rln membership contract, find details of your registration transaction in https://goerli.etherscan.io/tx/0xxxx You are registered to the rln membership contract, find details of your registration transaction in https://sepolia.etherscan.io/tx/0xxxx
``` ```
Note that you will see the actual transaction hash instead of `0xxxx`. Note that you will see the actual transaction hash instead of `0xxxx`.
Also, the registered RLN identity key, the RLN identity commitment key, and the index of the registered credential will be displayed as given below. Also, the registered RLN identity key, the RLN identity commitment key, and the index of the registered credential will be displayed as given below.
@ -142,7 +142,7 @@ The reason is that under the hood a zero-knowledge proof is being generated and
Try to spam the network by violating the message rate limit i.e., 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/2/luzhou/proto` as your chat client. 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. 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. 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.
Furthermore, the chat client will prompt you with the following warning message indicating that the message rate is being violated: Furthermore, the chat client will prompt you with the following warning message indicating that the message rate is being violated:
@ -165,7 +165,7 @@ If this file does not already exist under the supplied path, then a new credenti
Otherwise, the chat client does not generate a new credential and will use, instead, the persisted RLN credential. Otherwise, the chat client does not generate a new credential and will use, instead, the persisted RLN credential.
```bash ```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/2/luzhou/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x4252105670fe33d2947e8ead304969849e64f2a6 --rln-relay-eth-account-private-key:your_eth_private_key --rln-relay-eth-client-address:your_goerli_node --ports-shift=1 --rln-relay-cred-path:./ ./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:your_eth_private_key --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./
``` ```
Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-private-key` flag. Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-private-key` flag.
@ -173,7 +173,7 @@ Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-pr
Therefore, the command to start chat2 would be - Therefore, the command to start chat2 would be -
```bash ```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/2/luzhou/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x4252105670fe33d2947e8ead304969849e64f2a6 --rln-relay-eth-client-address:your_goerli_node --ports-shift=1 --rln-relay-cred-path:./ ./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./
``` ```
# Sample test output # Sample test output
@ -190,7 +190,7 @@ You can check this fact by looking at `Bob`'s console, where `message3` is missi
**Alice** **Alice**
```bash ```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/2/luzhou/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x4252105670fe33d2947e8ead304969849e64f2a6 --rln-relay-eth-account-private-key:0x1234567890123456789012345678901234567890123456789012345678901234 --rln-relay-eth-client-address:wss://goerli.infura.io/ws/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:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:0x1234567890123456789012345678901234567890123456789012345678901234 --rln-relay-eth-client-address:wss://sepolia.infura.io/ws/v3/12345678901234567890123456789012 --ports-shift=1
``` ```
``` ```
@ -213,7 +213,7 @@ Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
<Jun 29, 16:15> b: hi <Jun 29, 16:15> b: hi
<Jun 29, 16:15> h: hi <Jun 29, 16:15> h: hi
rln-relay preparation is in progress ... rln-relay preparation is in progress ...
You are registered to the rln membership contract, find details of your registration transaction in https://goerli.etherscan.io/tx/0xxxx You are registered to the rln membership contract, find details of your registration transaction in https://sepolia.etherscan.io/tx/0xxxx
your membership index is: xx your membership index is: xx
your rln identity key is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx your rln identity key is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
your rln identity commitment key is: bd093cbf14fb933d53f596c33f98b3df83b7e9f7a1906cf4355fac712077cb28 your rln identity commitment key is: bd093cbf14fb933d53f596c33f98b3df83b7e9f7a1906cf4355fac712077cb28
@ -234,7 +234,7 @@ your rln identity commitment key is: bd093cbf14fb933d53f596c33f98b3df83b7e9f7a19
**Bob** **Bob**
```bash ```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/2/luzhou/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x4252105670fe33d2947e8ead304969849e64f2a6 --rln-relay-eth-account-private-key:0x1234567890123456789012345678901234567890123456789012345678901234 --rln-relay-eth-client-address:wss://goerli.infura.io/ws/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:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:0x1234567890123456789012345678901234567890123456789012345678901234 --rln-relay-eth-client-address:wss://sepolia.infura.io/ws/v3/12345678901234567890123456789012 --ports-shift=2
``` ```
``` ```
@ -247,7 +247,7 @@ Listening on
Store enabled, but no store nodes configured. Choosing one at random from discovered peers Store enabled, but no store nodes configured. Choosing one at random from discovered peers
Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm Connecting to storenode: 16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
rln-relay preparation is in progress ... rln-relay preparation is in progress ...
You are registered to the rln membership contract, find details of your registration transaction in https://goerli.etherscan.io/tx/0xxxx You are registered to the rln membership contract, find details of your registration transaction in https://sepolia.etherscan.io/tx/0xxxx
your membership index is: xx your membership index is: xx
your rln identity key is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx your rln identity key is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
your rln identity commitment key is: d4961a7681521730bc7f9ade185c632b94b70624b2e87e21a97c07b83353f306 your rln identity commitment key is: d4961a7681521730bc7f9ade185c632b94b70624b2e87e21a97c07b83353f306

View File

@ -1,10 +1,10 @@
In this tutotial you will learn how to: In this tutotial you will learn how to:
1. Create Goerli Ethereum Account and obtain its private key. 1. Create Sepolia Ethereum Account and obtain its private key.
2. Obtain Goerli Ethers from faucet. 2. Obtain Sepolia Ethers from faucet.
3. Set up a hosted node on Goerli Testnet using Infura. 3. Set up a hosted node on Sepolia Testnet using Infura.
If you already have an Ethereum account with sufficient ethers on the Goerli testnet then you can skip the first two sections. If you already have an Ethereum account with sufficient ethers on the Sepolia testnet then you can skip the first two sections.
## Creating Goerli Ethereum Account and obtaining its private key ## Creating Sepolia Ethereum Account and obtaining its private key
1. Download and install Metamask. [https://metamask.io/download/](https://metamask.io/download/) 1. Download and install Metamask. [https://metamask.io/download/](https://metamask.io/download/)
@ -20,8 +20,8 @@ If you already have an Ethereum account with sufficient ethers on the Goerli tes
![](https://i.imgur.com/gk3TWUd.jpg) ![](https://i.imgur.com/gk3TWUd.jpg)
5. You can use the same account for different networks. For Waku we need to connect to the Goerli test network. 5. You can use the same account for different networks. For Waku we need to connect to the Sepolia test network.
6. You can switch to a test network by clicking on the drop down menu. Select Goerli test network for Waku: 6. You can switch to a test network by clicking on the drop down menu. Select Sepolia test network for Waku:
![](https://i.imgur.com/kbuup6y.jpg) ![](https://i.imgur.com/kbuup6y.jpg)
@ -36,7 +36,7 @@ If you already have an Ethereum account with sufficient ethers on the Goerli tes
![](https://i.imgur.com/leSYt4z.jpg) ![](https://i.imgur.com/leSYt4z.jpg)
10. Switch to Goerli Test Network. 10. Switch to Sepolia Test Network.
11. You can see that the same account can be used with different networks. But note that the ETH balance on different networks are different and are different tokens. 11. You can see that the same account can be used with different networks. But note that the ETH balance on different networks are different and are different tokens.
![](https://i.imgur.com/Y7YkuEe.jpg) ![](https://i.imgur.com/Y7YkuEe.jpg)
@ -56,35 +56,33 @@ If you already have an Ethereum account with sufficient ethers on the Goerli tes
16. You will be shown the private key. Copy it as needed. 16. You will be shown the private key. Copy it as needed.
Obtain Goerli Ethers from faucet Obtain Sepolia Ethers from faucet
--- ---
1. Ethers on Goerli test networks can be obtained from different faucets. 1. Ethers on Sepolia test networks can be obtained from different faucets.
2. Some of the faucets are as follows: 2. One of the faucets is as follows:
1. [https://goerlifaucet.com/](https://goerlifaucet.com/) 1. [https://sepoliafaucet.com//](https://sepoliafaucet.com/)
2. [https://goerli-faucet.slock.it/](https://goerli-faucet.slock.it/) (NOTE: We have not tested the security of these faucets so please feel free to do your own research or obtain Sepolia ethers from other faucets if needed.)
3. [https://goerli-faucet.pk910.de/](https://goerli-faucet.pk910.de/)
(NOTE: We have not tested the security of these faucets so please feel free to do your own research or obtain Goerli ethers from other faucets if needed.)
3. Please follow the instructions on the webpages of these faucets. 3. Please follow the instructions on the webpages of these faucets.
4. A lot of faucets limit the Goerli ETH to 0.05 ETH/day. 4. A lot of faucets limit the Sepolia ETH to 0.05 ETH/day.
5. To obtain more eth, you can do some POW mining. One of those POW faucet is: 5. To obtain more eth, you can do some POW mining. One of those POW faucet is:
[https://goerli-faucet.pk910.de/](https://goerli-faucet.pk910.de/) [https://sepolia-faucet.pk910.de/](https://sepolia-faucet.pk910.de/)
6. Enter your Eth account address, accept Captcha and start mining. 6. Enter your Eth account address, accept Captcha and start mining.
![](https://i.imgur.com/IvHNsei.jpg) ![](https://i.imgur.com/IvHNsei.jpg)
7. You can see the estimated Goerli ETH mined per hour. Each session is restricted to a few hours. 7. You can see the estimated Sepolia ETH mined per hour. Each session is restricted to a few hours.
![](https://i.imgur.com/qTWwyNr.jpg) ![](https://i.imgur.com/qTWwyNr.jpg)
8. When you exceed the hour limit of the session, then the mining will be stopped. 8. When you exceed the hour limit of the session, then the mining will be stopped.
9. Alternatively, stop the mining when mined enough goerli ether. 9. Alternatively, stop the mining when mined enough sepolia ether.
10. Do not forget to claim your goerli ether. 10. Do not forget to claim your sepolia ether.
![](https://i.imgur.com/cGCSexB.jpg) ![](https://i.imgur.com/cGCSexB.jpg)
Setting up a hosted node on Goerli Testnet using Infura Setting up a hosted node on Sepolia Testnet using Infura
--- ---
(Note: Infura provides a simple straight-forward way of setting up endpoints for interaction with the Ethereum chain and the Waku RLN smart contract without having to run a dedicated Ethereum node. Setting up infura is not mandatory. Operators concerned with the centralized aspect introduced by infura can setup their own node.) (Note: Infura provides a simple straight-forward way of setting up endpoints for interaction with the Ethereum chain and the Waku RLN smart contract without having to run a dedicated Ethereum node. Setting up infura is not mandatory. Operators concerned with the centralized aspect introduced by infura can setup their own node.)
@ -101,11 +99,11 @@ Setting up a hosted node on Goerli Testnet using Infura
![](imgs/infura-dashboard-mainnet.png) ![](imgs/infura-dashboard-mainnet.png)
4. Select Goerli network in Endpoints. 4. Select Sepolia network in Endpoints.
![](https://i.imgur.com/RgmH7C1.png) ![](https://i.imgur.com/RgmH7C1.png)
5. You can find the endpoints for the hosted node using https and wss. The wss endpoint is the relevant one for connecting the waku node to the RLN contract on Goerli network. Like follows: 5. You can find the endpoints for the hosted node using https and wss. The wss endpoint is the relevant one for connecting the waku node to the RLN contract on Sepolia network. Like follows:
![](https://i.imgur.com/xqbOcOH.png) ![](https://i.imgur.com/xqbOcOH.png)

View File

@ -14,7 +14,7 @@ As for the setup, please follow the tutorials below:
- [JS-chat](https://examples.waku.org/rln-js/) - [JS-chat](https://examples.waku.org/rln-js/)
Once you set up your chat client, it will be connected to the Waku v2 test fleets as its first hop. Once you set up your chat client, it will be connected to the Waku v2 test fleets as its first hop.
Messages generated by the chat client are set to be published on a specific combination of pubsub and content topic i.e., the default pubsub topic of `/waku/2/default-waku/proto` and the content topic of `/toy-chat/2/luzhou/proto`. Messages generated by the chat client are set to be published on a specific combination of pubsub and content topic i.e., the default pubsub topic of `/waku/2/default-waku/proto` and the content topic of `/toy-chat/3/mingde/proto`.
The test fleets also run Waku-RLN-Relay over the same pubsub topic and content topic. The test fleets also run Waku-RLN-Relay over the same pubsub topic and content topic.
Test fleets act as routers and enforce the message rate limit. Test fleets act as routers and enforce the message rate limit.
As such, any spam messages published by a chat client on the said combination of topics will be caught by the Waku v2 test fleet nodes and will not be routed. As such, any spam messages published by a chat client on the said combination of topics will be caught by the Waku v2 test fleet nodes and will not be routed.

View File

@ -1,6 +1,6 @@
# Communicating with waku2 test fleets using chat2 application in spam-protected mode # Communicating with waku2 test fleets using chat2 application in spam-protected mode
This document is a tutorial on how to run chat2 in spam-protected/rate-limited mode using the waku-RLN-Relay protocol on a designated content topic `/toy-chat/2/luzhou/proto`. This document is a tutorial on how to run chat2 in spam-protected/rate-limited mode using the waku-RLN-Relay protocol on a designated content topic `/toy-chat/3/mingde/proto`.
You will connect your chat2 client to waku2 test fleets. You will connect your chat2 client to waku2 test fleets.
Note that test fleets will not filter spam messages, they merely route messages. Note that test fleets will not filter spam messages, they merely route messages.
Spam detection takes place at the chat2 users end. Spam detection takes place at the chat2 users end.
@ -8,7 +8,7 @@ In this setting, you should try to spam the network by violating the message rat
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. 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. 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/2/luzhou/proto`. 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 samp activity will be detected by them and a proper message will be shown on their console. Your samp activity will be detected by them and a proper message will be shown on their console.
# Set up # Set up
@ -23,7 +23,7 @@ make chat2 RLN=true
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/2/luzhou/proto --ports-shift=1 --fleet:test --rln-relay:true --rln-relay-membership-index:your_index ./build/chat2 --content-topic:/toy-chat/3/mingde/proto --ports-shift=1 --fleet:test --rln-relay:true --rln-relay-membership-index:your_index
``` ```
In this command In this command
@ -78,7 +78,7 @@ You can check this fact by looking at the `Alice` console, where `A spam message
Bob Bob
``` ```
./build/chat2 --content-topic:/toy-chat/2/luzhou/proto --ports-shift=2 --fleet:test --rln-relay:true --rln-relay-membership-index:2 ./build/chat2 --content-topic:/toy-chat/3/mingde/proto --ports-shift=2 --fleet:test --rln-relay:true --rln-relay-membership-index:2
Choose a nickname >> Bob Choose a nickname >> Bob
Welcome, Bob! Welcome, Bob!
Connecting to test fleet using DNS discovery... Connecting to test fleet using DNS discovery...
@ -106,7 +106,7 @@ quitting...
Alice Alice
``` ```
./build/chat2 --content-topic:/toy-chat/2/luzhou/proto --ports-shift=1 --fleet:test --rln-relay:true --rln-relay-membership-index:1 ./build/chat2 --content-topic:/toy-chat/3/mingde/proto --ports-shift=1 --fleet:test --rln-relay:true --rln-relay-membership-index:1
Choose a nickname >> Alice Choose a nickname >> Alice
Welcome, Alice! Welcome, Alice!

View File

@ -28,7 +28,7 @@ The `rln-relay-membership-index` is used to pick one RLN key out of the 100 avai
We use the first RLN key of the list for `Alice` i.e., `--rln-relay-membership-index:1`. We use the first RLN key of the list for `Alice` i.e., `--rln-relay-membership-index:1`.
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60010/p2p/16Uiu2HAmKdCdP89q6CwLc6PeFDJnVR1EmM7fTgtphHiacSNBnuAz --content-topic:/toy-chat/2/luzhou/proto --ports-shift=1 --fleet:none --nodekey=f157b19b13e9ee818acfc9d3d7eec6b81f70c0a978dec19def261172acbe26e6 --rln-relay:true --rln-relay-membership-index:1 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60010/p2p/16Uiu2HAmKdCdP89q6CwLc6PeFDJnVR1EmM7fTgtphHiacSNBnuAz --content-topic:/toy-chat/3/mingde/proto --ports-shift=1 --fleet:none --nodekey=f157b19b13e9ee818acfc9d3d7eec6b81f70c0a978dec19def261172acbe26e6 --rln-relay:true --rln-relay-membership-index:1
``` ```
@ -45,7 +45,7 @@ Now your first chat2 client is ready.
**Bob setup**: **Bob setup**:
Set up the second chat2 client using the command below. Choose `Bob` as the nickname. Set up the second chat2 client using the command below. Choose `Bob` as the nickname.
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/2/luzhou/proto --ports-shift=2 --fleet:none --nodekey=9ab635854ffe8fed32b17d7ef38e0b2f354ca1f3283b7f78fb77227004d2cbe6 --rln-relay:true --rln-relay-membership-index:2 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/3/mingde/proto --ports-shift=2 --fleet:none --nodekey=9ab635854ffe8fed32b17d7ef38e0b2f354ca1f3283b7f78fb77227004d2cbe6 --rln-relay:true --rln-relay-membership-index:2
Choose a nickname >> Bob Choose a nickname >> Bob
``` ```
@ -53,7 +53,7 @@ Choose a nickname >> Bob
**Carol setup**: **Carol setup**:
Run the following command to set up the third chat2 client, and choose `Carol` as the nickname. Run the following command to set up the third chat2 client, and choose `Carol` as the nickname.
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/2/luzhou/proto --ports-shift=3 --fleet:none --nodekey=0aa89d7f27300c9fb4e119acc225c8873a3bf96bbb4c82045c94934bcc6a6af8 --rln-relay:true --rln-relay-membership-index:3 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/3/mingde/proto --ports-shift=3 --fleet:none --nodekey=0aa89d7f27300c9fb4e119acc225c8873a3bf96bbb4c82045c94934bcc6a6af8 --rln-relay:true --rln-relay-membership-index:3
Choose a nickname >> Carol Choose a nickname >> Carol
@ -92,7 +92,7 @@ You can check this fact by looking at the `Alice` console, where `A spam message
Bob Bob
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/2/luzhou/proto --ports-shift=2 --fleet:none --nodekey=9ab635854ffe8fed32b17d7ef38e0b2f354ca1f3283b7f78fb77227004d2cbe6 --rln-relay:true --rln-relay-membership-index:2 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/3/mingde/proto --ports-shift=2 --fleet:none --nodekey=9ab635854ffe8fed32b17d7ef38e0b2f354ca1f3283b7f78fb77227004d2cbe6 --rln-relay:true --rln-relay-membership-index:2
Choose a nickname >> Bob Choose a nickname >> Bob
Welcome, Bob! Welcome, Bob!
Connecting to nodes Connecting to nodes
@ -116,7 +116,7 @@ quitting...
Alice Alice
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60010/p2p/16Uiu2HAmKdCdP89q6CwLc6PeFDJnVR1EmM7fTgtphHiacSNBnuAz --content-topic:/toy-chat/2/luzhou/proto --ports-shift=1 --fleet:none --nodekey=f157b19b13e9ee818acfc9d3d7eec6b81f70c0a978dec19def261172acbe26e6 --rln-relay:true --rln-relay-membership-index:1 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60010/p2p/16Uiu2HAmKdCdP89q6CwLc6PeFDJnVR1EmM7fTgtphHiacSNBnuAz --content-topic:/toy-chat/3/mingde/proto --ports-shift=1 --fleet:none --nodekey=f157b19b13e9ee818acfc9d3d7eec6b81f70c0a978dec19def261172acbe26e6 --rln-relay:true --rln-relay-membership-index:1
Choose a nickname >> Alice Choose a nickname >> Alice
Welcome, Alice! Welcome, Alice!
@ -133,7 +133,7 @@ quitting...
Carol Carol
``` ```
./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/2/luzhou/proto --ports-shift=3 --fleet:none --nodekey=0aa89d7f27300c9fb4e119acc225c8873a3bf96bbb4c82045c94934bcc6a6af8 --rln-relay:true --rln-relay-membership-index:3 ./build/chat2 --staticnode:/ip4/127.0.0.1/tcp/60001/p2p/16Uiu2HAkyTos6LeGrj1YJyA3WYzp9qKQGCsxbtvyoBRHSu9PCrQZ --content-topic:/toy-chat/3/mingde/proto --ports-shift=3 --fleet:none --nodekey=0aa89d7f27300c9fb4e119acc225c8873a3bf96bbb4c82045c94934bcc6a6af8 --rln-relay:true --rln-relay-membership-index:3
Choose a nickname >> Carol Choose a nickname >> Carol
Welcome, Carol! Welcome, Carol!
Connecting to nodes Connecting to nodes