update nwaku compose (#161)

This commit is contained in:
LordGhostX 2024-02-09 15:51:51 +01:00 committed by GitHub
parent 412a1c8c33
commit 48b42f6c02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 18 deletions

View File

@ -6,8 +6,8 @@ hide_table_of_contents: true
`nwaku-compose` is a ready-to-use Docker Compose setup that runs the following:
- `nwaku` node running [Relay](/learn/concepts/protocols#relay) and [Store](/learn/concepts/protocols#store) protocols with [RLN](/learn/concepts/protocols#rln-relay) enabled.
- Simple frontend to interact with your node and the network to send and receive messages.
- [Grafana](https://grafana.com/) metrics dashboard for advanced users or node operators.
- Simple frontend to interact with the node and Waku network to send and receive messages.
- [Grafana](https://grafana.com/) metrics dashboard for advanced users and node operators to monitor the node.
This guide provides detailed steps to configure, run, monitor, and interact with a `nwaku` node with [nwaku-compose](https://github.com/waku-org/nwaku-compose).
@ -28,17 +28,22 @@ cd nwaku-compose
## Configure the setup
Modify the `run_node.sh` file to customise your [node's configuration](/guides/nwaku/config-options) and `docker-compose.yml` to specify particular [Docker image](https://hub.docker.com/r/statusteam/nim-waku/tags) tag. Next, export your Ethereum Sepolia configuration and membership password:
Docker Compose [reads the ./.env file](https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information-3) from the filesystem. You can use `.env.example` as a template to provide the above values. The recommended process for working with `.env` files is to duplicate `.env.example`, rename it as `.env`, and then make the necessary value edits.
```shell
export ETH_CLIENT_ADDRESS=wss://sepolia.infura.io/ws/v3/[INFURA API KEY]
export ETH_TESTNET_KEY=[TESTNET PRIVATE KEY]
export KEYSTORE_PASSWORD=[RLN MEMBERSHIP PASSWORD]
cp .env.example .env
${EDITOR} .env
```
## Register RLN membership
:::caution
Ensure that you do **NOT** include any secrets in the `.env.example` file, as it could accidentally be shared in the Git repository.
:::
The RLN membership is your access key to The Waku Network. Its registration is done on-chain and allows your `nwaku` node to send messages decentralised and privately, respecting some rate limits. Other peers won't relay messages exceeding the rate limit:
## Register for RLN membership
The RLN membership is your access key to The Waku Network. Its registration is done on-chain, allowing your `nwaku` node to send messages decentralised and privately, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded). Other peers won't relay messages that exceed the rate limit.
This command registers your membership and saves it in the `keystore/keystore.json` file:
```shell
./register_rln.sh
@ -50,7 +55,7 @@ If you only want to relay traffic without sending messages to the network, you d
## Run the node
Start all processes: `nwaku` node, database and Grafana for metrics. Your RLN membership is loaded into nwaku under the hood:
Start all processes: `nwaku` node, database for storing messages, and Grafana for metrics. Your RLN membership is loaded into nwaku under the hood:
```shell
docker-compose up -d
@ -58,7 +63,7 @@ docker-compose up -d
## Interact with the node
Visit <http://localhost:3000/d/yns_4vFVk/nwaku-monitoring> to view your node metrics in real-time.
Visit <http://localhost:3000/d/yns_4vFVk/nwaku-monitoring> to view your node metrics in real time.
![nwaku compose dashboard](/img/nwaku-compose-dashboard.png)
@ -78,7 +83,7 @@ curl --location 'http://127.0.0.1:8645/debug/v1/version'
curl --location 'http://127.0.0.1:8645/debug/v1/info'
```
Send a message to a `contentTopic`, which all subscribers will receive. Please note that the payload is encoded in `base64`.
Send a message to a `contentTopic`, which all subscribers will receive. Please note that the `payload` is encoded in `base64`.
```shell
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' \

View File

@ -13,7 +13,18 @@ We recommend running a `nwaku` node with at least 2GB of RAM, especially if you
## Get the node binary
To run a node, you must have the `nwaku` binary. Nwaku provides multiple options for acquiring the node binary:
To run a node, you must have the `nwaku` binary. Nwaku provides multiple options for running a node:
#### Run nwaku in Docker (recommended)
| | Description | Documentation |
| - | - | - |
| Docker Compose | Run a `nwaku` node with Docker Compose | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) |
| Docker Container | Run a `nwaku` node in a Docker Container | [Run Nwaku in a Docker Container](/guides/nwaku/run-docker) |
:::tip
We recommend [using Docker Compose](/guides/nwaku/run-docker-compose) to run a node because it's the simplest and fastest way to configure and run one.
:::
#### Download the binary
@ -24,14 +35,9 @@ To run a node, you must have the `nwaku` binary. Nwaku provides multiple options
#### Build the binary
You can build the node binary directly from the [nwaku source code](https://github.com/waku-org/nwaku). Have a look at the [Build Nwaku from Source](/guides/nwaku/build-source) guide to learn more.
#### Run nwaku in Docker
| | Description | Documentation |
| - | - | - |
| Docker Container | Run a `nwaku` node in a Docker Container | [Run Nwaku in a Docker Container](/guides/nwaku/run-docker) |
| Docker Compose | Run a `nwaku` node with Docker Compose | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) |
| Build from Source | Build the node from the [nwaku source code](https://github.com/waku-org/nwaku) | [Build Nwaku from Source](/guides/nwaku/build-source) |
:::tip
You can run the `nwaku` binaries and Docker images on cloud service providers like [Google Cloud](https://cloud.google.com/), [Microsoft Azure](https://azure.microsoft.com/), [Amazon Web Services](https://aws.amazon.com/), and [DigitalOcean](https://www.digitalocean.com/).