Update default config for relay without publishing (#169)

Co-authored-by: fryorcraken <commits@fryorcraken.xyz>
This commit is contained in:
Tanya S 2025-07-29 02:37:45 +02:00 committed by GitHub
parent 8c3ec4cd2f
commit 8e4a33b0a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 52 additions and 54 deletions

View File

@ -2,23 +2,9 @@
# e.g. https://linea-sepolia.infura.io/v3/123aa110320f4aec179150fba1e1b1b1
RLN_RELAY_ETH_CLIENT_ADDRESS=https://linea-sepolia.infura.io/v3/<key>
# Account of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
# e.g.: ETH_TESTNET_ACCOUNT=0xbecd1546a397a6bad875247d51c4c6da0e469021
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
# Private key of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
# Note: make sure you don't use the '0x' prefix.
# Use the following as a format example, but replace it with your own private key value
# e.g. ETH_TESTNET_KEY=abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
ETH_TESTNET_KEY=<YOUR_TESTNET_PRIVATE_KEY_HERE>
# Address of the RLN contract on Linea Sepolia.
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
# Password you would like to use to protect your RLN membership.
RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password"
# Advanced. Can be left empty in normal use cases.
NWAKU_IMAGE=

19
.env.example.rln Normal file
View File

@ -0,0 +1,19 @@
## RLN Credentials - EXPERIMENTAL
## If you have/want an RLN membership to send messages
# Account of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
# e.g.: ETH_TESTNET_ACCOUNT=0xbecd1546a397a6bad875247d51c4c6da0e469021
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
# Private key of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
# Note: make sure you don't use the '0x' prefix.
# Use the following as a format example, but replace it with your own private key value
# e.g. ETH_TESTNET_KEY=abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
ETH_TESTNET_KEY=<YOUR_TESTNET_PRIVATE_KEY_HERE>
# Path and password to the keystore file
RLN_RELAY_CRED_PATH=
RLN_RELAY_CRED_PASSWORD=

View File

@ -1,38 +1,33 @@
# nwaku-compose
Readytouse **dockercompose** stack for running your own [nwaku](https://github.com/waku-org/nwaku) full node:
Readytouse **dockercompose** stack for running your own [nwaku](https://github.com/waku-org/nwaku) node:
* RLNenabled nwaku node (relay + store protocols)
* Simple web UI to publish and receive messages
* RLNenabled nwaku node (relay + store protocols, excluding message publishing)
* Grafana dashboard for metrics
* Requires **Docker Compose** and **Git**
## 📝 Prerequisites
* **Linea Sepolia RPC endpoint** — grab one for free on [Infura](https://www.infura.io)
* **Linea Sepolia wallet** with at least **0.01 ETH**
* **Linea Sepolia wallet** with at least **0.01 ETH** (Only Required For RLN Membership Registration which is WIP)
* Need test ETH? Use the [Linea Sepolia faucet](https://www.infura.io/faucet/sepolia)
* Already have ETH on Sepolia? Bridge it to Linea via the [official bridge](https://bridge.linea.build/native-bridge)
### 🚀 Starting your node
| # | Option | Quick-start command | What happens |
|---|------|--------------------|--------------|
| **1** | **script** | Power user / CI | setup a .env file manually, run ./register_rln.sh, and then start the node.|
| **2** | **setup-wizard** | Fastest one-command bootstrap | Generates `.env`, registers RLN, and spins up the whole stack automatically |
| # | Option | Quick-start command | What happens |
|-------|----------------------|-------------------------------|-----------------------------------------------------------------------------|
| **A** | **script** | Power user / CI | setup a .env file manually and then start the node. |
| **B** | **WIP setup-wizard** | Fastest one-command bootstrap | Generates `.env`, registers RLN, and spins up the whole stack automatically |
<details>
<summary>🧪 option 1 :- SCRIPT [ manual ] [ recommended ] </summary>
<summary>🧪 option A :- SCRIPT [ manual ] [ recommended ] </summary>
```
cp .env.example .env
```
Edit the .env file and fill in all required parameters
This command will register your membership and store it in `keystore/keystore.json`:
```
./register_rln.sh
```
### 💽 2. Select DB Parameters
@ -73,7 +68,6 @@ docker-compose up -d
###🏄🏼‍♂️ 4. Interact with your nwaku node
* See [localhost:3000](http://localhost:3000/d/yns_4vFVk/nwaku-monitoring) for node metrics.
* See [localhost:4000](http://localhost:4000) for a nice frontend to chat with other users.
**📬 4. Use the REST API**
@ -86,14 +80,6 @@ curl http://127.0.0.1:8645/debug/v1/version
curl http://127.0.0.1:8645/debug/v1/info
```
**Publish a message to a `contentTopic`**. Everyone subscribed to it will receive it. Note that `payload` is base64 encoded.
```
curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
-H "content-type: application/json" \
-d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/my-app/2/chatroom-1/proto"}'
```
**Get messages sent to a `contentTopic`**. Note that any store node in the network is used to reply.
```
curl -X GET "http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app%2F2%2Fchatroom-1%2Fproto&pageSize=50&ascending=true" \
@ -105,7 +91,7 @@ For advanced documentation, refer to [ADVANCED.md](https://github.com/waku-org/n
</details>
<details>
<summary>⚙️ option 2 :- SETUP-WIZARD [ experimental ]</summary>
<summary>⚙️ option B (not recommended at this time):- SETUP-WIZARD [ experimental ]</summary>
Run the wizard script.
Once the script is done, the node will be started for you, so there is nothing else to do.
@ -123,8 +109,6 @@ RLN membership is your access key to The Waku Network. It is registered on-chain
If you just want to relay traffic (not publish), you don't need to perform the registration.
-----
<details>
<summary>How to update to latest version</summary>

View File

@ -143,16 +143,17 @@ services:
depends_on:
- postgres
waku-frontend:
# TODO: migrate to waku-org
image: alrevuelta/waku-frontend:aad9628
ports:
- 127.0.0.1:4000:4000
restart: on-failure:5
depends_on:
- nwaku
## Uncomment if you have RLN credentials and want to use play with a front end to send messages
# waku-frontend:
# # TODO: migrate to waku-org
# image: alrevuelta/waku-frontend:aad9628
# ports:
# - 127.0.0.1:4000:4000
# restart: on-failure:5
# depends_on:
# - nwaku
## Remove comment if you need pgadmin support in your container.
## Uncomment if you need pgadmin support in your container.
## Commented for backward version compatibility of docker-compose.
# pgadmin:
# image: dpage/pgadmin4:latest

View File

@ -87,13 +87,21 @@ if [ -n "${NODEKEY}" ]; then
NODEKEY=--nodekey=${NODEKEY}
fi
RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH:-/keystore/keystore.json}
if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password="${RLN_RELAY_CRED_PASSWORD}"
## Enable Light Push (RLNaaS) if RLN credentials are used
LIGHTPUSH=--lightpush=true
## Pass default value for credentials path if not set
RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH:-/keystore/keystore.json}
echo "Using RLN credentials from ${RLN_RELAY_CRED_PATH}"
else
LIGHTPUSH=--lightpush=false
# Ensure no empty values are passed
RLN_RELAY_CRED_PATH=""
RLN_RELAY_CRED_PASSWORD=""
fi
STORE_RETENTION_POLICY=--store-message-retention-policy=size:1GB
if [ -n "${STORAGE_SIZE}" ]; then
@ -103,7 +111,7 @@ fi
exec /usr/bin/wakunode\
--relay=true\
--filter=true\
--lightpush=true\
${LIGHTPUSH}\
--keep-alive=true\
--max-connections=150\
--cluster-id=1\
@ -126,8 +134,8 @@ exec /usr/bin/wakunode\
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/postgres"\
--rln-relay-eth-client-address="${RLN_RELAY_ETH_CLIENT_ADDRESS}"\
--rln-relay-tree-path="/etc/rln_tree"\
"${RLN_RELAY_CRED_PATH}"\
"${RLN_RELAY_CRED_PASSWORD}"\
${RLN_RELAY_CRED_PATH}\
${RLN_RELAY_CRED_PASSWORD}\
${DNS_WSS_CMD}\
${NODEKEY}\
${STORE_RETENTION_POLICY}\