implement guides feedback

This commit is contained in:
LordGhostX 2023-06-18 09:34:09 +01:00
parent 4e1cc330fd
commit 5e45aad734
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7
8 changed files with 71 additions and 48 deletions

View File

@ -5,7 +5,7 @@ title: Build Nwaku from Source
This guide provides detailed steps to build a `nwaku` node from the source to access the latest development version or a specific commit or tag of `nwaku`. If you prefer a more stable version, [download a pre-compiled binary](https://github.com/waku-org/nwaku/tags) instead. This guide provides detailed steps to build a `nwaku` node from the source to access the latest development version or a specific commit or tag of `nwaku`. If you prefer a more stable version, [download a pre-compiled binary](https://github.com/waku-org/nwaku/tags) instead.
:::info :::info
A minimum of 2GB of RAM is required to build `nwaku`. The build process will only succeed on systems that meet this requirement. A minimum of 2GB of RAM is required to build `nwaku`.
::: :::
## Install Dependencies ## Install Dependencies
@ -96,7 +96,7 @@ Nwaku will create the `wakunode2` binary in the `./build/` directory.
To learn more about running nwaku, please refer to: To learn more about running nwaku, please refer to:
- [Run a Nwaku Node](/guides/run-nwaku-node#run-the-node) - [Run a Nwaku Node](/guides/run-nwaku-node#run-the-node)
- [Run Nwaku in Docker Container](/guides/nwaku/run-docker) - [Run Nwaku in a Docker Container](/guides/nwaku/run-docker)
- [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) - [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose)
- [Node Configuration Methods](/guides/reference/node-config-methods) - [Node Configuration Methods](/guides/reference/node-config-methods)

View File

@ -13,11 +13,19 @@ You can configure a `nwaku` node to use multiple peer discovery mechanisms simul
You can provide static peers to a `nwaku` node during startup using the `staticnode` configuration option. To connect to multiple peers on startup, repeat the `staticnode` option: You can provide static peers to a `nwaku` node during startup using the `staticnode` configuration option. To connect to multiple peers on startup, repeat the `staticnode` option:
```bash ```bash
wakunode2 \ ./build/wakunode2 \
--staticnode:[Libp2p MULTIADDR PEER 1] \ --staticnode:[Libp2p MULTIADDR PEER 1] \
--staticnode:[Libp2p MULTIADDR PEER 2] --staticnode:[Libp2p MULTIADDR PEER 2]
``` ```
For instance, consider a `nwaku` node that connects to two static peers on the same local host (IP: `0.0.0.0`) using TCP ports `60002` and `60003`:
```bash
./build/wakunode2 \
--staticnode:/ip4/0.0.0.0/tcp/60002/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H \
--staticnode:/ip4/0.0.0.0/tcp/60003/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ
```
## Configure DNS Discovery ## Configure DNS Discovery
To enable [DNS Discovery](/overview/concepts/dns-discovery) in a `nwaku` node, use the following configuration options: To enable [DNS Discovery](/overview/concepts/dns-discovery) in a `nwaku` node, use the following configuration options:
@ -26,23 +34,45 @@ To enable [DNS Discovery](/overview/concepts/dns-discovery) in a `nwaku` node, u
- `dns-discovery-url`: URL for DNS node list in the format `enrtree://<key>@<fqdn>` where `<fqdn>` is the fully qualified domain name and `<key>` is the base32 encoding of the compressed 32-byte public key that signed the list at that location. - `dns-discovery-url`: URL for DNS node list in the format `enrtree://<key>@<fqdn>` where `<fqdn>` is the fully qualified domain name and `<key>` is the base32 encoding of the compressed 32-byte public key that signed the list at that location.
- `dns-discovery-name-server` (optional): DNS name server IPs to query. You can repeat this option to provide multiple DNS name servers. - `dns-discovery-name-server` (optional): DNS name server IPs to query. You can repeat this option to provide multiple DNS name servers.
``` ```bash
wakunode2 \ ./build/wakunode2 \
--dns-discovery:true \ --dns-discovery:true \
--dns-discovery-url:[DNS NODE LIST] --dns-discovery-url:[DNS NODE LIST] \
--dns-discovery-name-server:[DNS NAME SERVER IP]
```
For instance, consider a `nwaku` node that enables `DNS Discovery`, connects to a DNS node list, and queries the IPs `1.1.1.1` and `1.0.0.1`:
```bash
./build/wakunode2 \
--dns-discovery:true \
--dns-discovery-url:enrtree://AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM@test.waku.nodes.status.im \
--dns-discovery-name-server:1.1.1.1 \
--dns-discovery-name-server:1.0.0.1
``` ```
## Configure Discv5 ## Configure Discv5
You can enable [Discv5](/overview/concepts/discv5) in a `nwaku` node using the `discv5-discovery` and `discv5-bootstrap-node` configuration options. To configure multiple bootstrap entries for the Discv5 routing table, repeat the `discv5-bootstrap-node` option: To enable [Discv5](/overview/concepts/discv5) in a `nwaku` node, use the following configuration options:
- `discv5-discovery`: Enables Discv5 on the node (disabled by default).
- `discv5-bootstrap-node`: ENR for Discv5 routing table bootstrap node. You can repeat this option to provide multiple bootstrap entries.
```bash ```bash
wakunode2 \ ./build/wakunode2 \
--discv5-discovery:true \ --discv5-discovery:true \
--discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 1] \ --discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 1] \
--discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 2] --discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 2]
``` ```
For instance, consider a `nwaku` node that enables `Discv5` and bootstraps it's routing table using a static `ENR`:
```bash
./build/wakunode2 \
--discv5-discovery:true \
--discv5-bootstrap-node:enr:-IO4QDxToTg86pPCK2KvMeVCXC2ADVZWrxXSvNZeaoa0JhShbM5qed69RQz1s1mWEEqJ3aoklo_7EU9iIBcPMVeKlCQBgmlkgnY0iXNlY3AyNTZrMaEDdBHK1Gx6y_zv5DVw5Qb3DtSOMmVHTZO1WSORrF2loL2DdWRwgiMohXdha3UyAw
```
:::info :::info
When Discv5 is enabled and used with [DNS Discovery](#configure-dns-discovery), the `nwaku` node will attempt to bootstrap the Discv5 routing table by extracting `ENRs` from peers discovered through DNS. When Discv5 is enabled and used with [DNS Discovery](#configure-dns-discovery), the `nwaku` node will attempt to bootstrap the Discv5 routing table by extracting `ENRs` from peers discovered through DNS.
::: :::

View File

@ -21,7 +21,7 @@ cd nwaku-compose
## Configure the Setup ## Configure the Setup
Modify the `docker-compose.yml` file to customize your node's configuration, including the Docker image and [nwaku arguments](/guides/reference/node-config-options). Please visit [statusteam/nim-waku/tags](https://hub.docker.com/r/statusteam/nim-waku/tags) for images of specific `nwaku` releases. Modify the `docker-compose.yml` file to customize your node's configuration, including the [Docker image](https://hub.docker.com/r/statusteam/nim-waku/tags) and [nwaku arguments](/guides/reference/node-config-options).
## Run Docker Compose ## Run Docker Compose

View File

@ -1,5 +1,5 @@
--- ---
title: Run Nwaku in Docker Container title: Run Nwaku in a Docker Container
--- ---
This guide provides detailed steps to build and run a `nwaku` node in a Docker container. If you prefer a pre-configured setup that includes a monitoring dashboard, see the [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) guide. This guide provides detailed steps to build and run a `nwaku` node in a Docker container. If you prefer a pre-configured setup that includes a monitoring dashboard, see the [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) guide.
@ -33,6 +33,8 @@ cd nwaku
# Build image using docker build # Build image using docker build
docker build -t statusteam/nim-waku:latest . docker build -t statusteam/nim-waku:latest .
# or
# Build image using make # Build image using make
make docker-image make docker-image
``` ```

View File

@ -6,7 +6,7 @@ Waku nodes can be configured using a combination of the following methods:
1. Command line options and flags 1. Command line options and flags
2. Environment variables (recommended) 2. Environment variables (recommended)
3. [TOML](https://toml.io/) configuration file (currently the only supported format) 3. TOML configuration files (currently the only supported format)
4. Default values 4. Default values
:::info :::info
@ -18,7 +18,7 @@ Note the precedence order: Each configuration method overrides the one below it
Node configuration is primarily done using command line options, which override other methods. Specify [configuration options](/guides/reference/node-config-options) by providing them in this format after the binary name: Node configuration is primarily done using command line options, which override other methods. Specify [configuration options](/guides/reference/node-config-options) by providing them in this format after the binary name:
```bash ```bash
wakunode2 --tcp-port=65000 ./build/wakunode2 --tcp-port=65000
``` ```
When running your node with Docker, provide the command line options after the image name in this format: When running your node with Docker, provide the command line options after the image name in this format:
@ -34,7 +34,7 @@ Nodes can be configured using environment variables by prefixing the variable na
To set the `tcp-port` configuration, the `wakunode2` binary should be called in this format: To set the `tcp-port` configuration, the `wakunode2` binary should be called in this format:
```bash ```bash
WAKUNODE2_TCP_PORT=65000 wakunode2 WAKUNODE2_TCP_PORT=65000 ./build/wakunode2
``` ```
When running your node with Docker, start the node using the `-e` command option: When running your node with Docker, start the node using the `-e` command option:
@ -44,54 +44,55 @@ docker run -e "WAKUNODE2_TCP_PORT=65000" statusteam/nim-waku
``` ```
:::info :::info
This is the second configuration method in order of precedence. [Command line options](#command-line-options) override environment variables. This is the second configuration method in order of precedence. [Command Line Options](#command-line-options) override environment variables.
::: :::
## Configuration File ## Configuration Files
Nodes can be configured using a configuration file following the [TOML](https://toml.io/en/) format: Nodes can be configured using a configuration file following the [TOML](https://toml.io/en/) format:
```toml title="TOML Config File" showLineNumbers ```toml title="TOML Config File" showLineNumbers
log-level = "DEBUG" log-level = "DEBUG"
tcp-port = 65000 tcp-port = 65000
topic = ["/waku/2/default-waku/proto"]
metrics-logging = false
``` ```
The `config-file` [configuration option](/guides/reference/node-config-options) lets you specify the configuration file path: The `config-file` [configuration option](/guides/reference/node-config-options) lets you specify the configuration file path:
```bash ```bash
wakunode2 --config-file=[TOML CONFIGURATION FILE] ./build/wakunode2 --config-file=[TOML CONFIGURATION FILE]
``` ```
You can also specify the configuration file via environment variables: You can also specify the configuration file via environment variables:
```bash ```bash
# Using environment variables # Using environment variables
WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE] wakunode2 WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE] ./build/wakunode2
# Using environment variables with Docker # Using environment variables with Docker
docker run -e "WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE]" statusteam/nim-waku docker run -e "WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE]" statusteam/nim-waku
``` ```
:::info :::info
This is the third configuration method in order of precedence. [Command line options](#command-line-options) and [environment variables](#environment-variables) override configuration files. This is the third configuration method in order of precedence. [Command Line Options](#command-line-options) and [Environment Variables](#environment-variables) override configuration files.
::: :::
## Configuration Default Values ## Default Configuration Values
The default configuration is used if no other options are specified. To see the default values of all [configuration options](/guides/reference/node-config-options), run `wakunode2 --help`: The default configuration is used when no other options are specified. By default, a `nwaku` node does the following:
- Generate a new `Node Key` and `PeerID`.
- Listen for incoming libp2p connections on the default TCP port (`60000`).
- Subscribe to the default Pub/Sub topic (`/waku/2/default-waku/proto`).
- Start the `JSON-RPC` server on the default port (`8545`).
- Enable the `Relay` protocol for relaying messages.
- Enable the `Store` protocol as a client, allowing it to query peers for historical messages but not store any message itself.
To see the default values of all [configuration options](/guides/reference/node-config-options), run `wakunode2 --help`:
```bash ```bash
$ wakunode2 --help ./build/wakunode2 --help
Usage:
wakunode2 [OPTIONS]...
The following options are available:
--config-file Loads configuration from a TOML file (cmd-line parameters take precedence).
--tcp-port TCP listening port. [=60000].
<...>
``` ```
:::tip :::tip

View File

@ -18,7 +18,7 @@ Before running a `nwaku` node, it is necessary to build it. Nwaku provides multi
| - | - | - | | - | - | - |
| Precompiled Binary | Download a precompiled binary of the `nwaku` node | [Download Nwaku Binary](https://github.com/waku-org/nwaku/tags) | | Precompiled Binary | Download a precompiled binary of the `nwaku` node | [Download Nwaku Binary](https://github.com/waku-org/nwaku/tags) |
| Build Source | Build a `nwaku` node directly from the source code | [Build Nwaku from Source](/guides/nwaku/build-source) | | Build Source | Build a `nwaku` node directly from the source code | [Build Nwaku from Source](/guides/nwaku/build-source) |
| Docker Container | Build and run a `nwaku` node in a Docker Container | [Run Nwaku in Docker Container](/guides/nwaku/run-docker) | | Docker Container | Build and run a `nwaku` node in a Docker Container | [Run Nwaku in a Docker Container](/guides/nwaku/run-docker) |
| Docker Compose | Build and run a `nwaku` node with Docker Compose | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) | | Docker Compose | Build and run a `nwaku` node with Docker Compose | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) |
:::tip :::tip
@ -28,7 +28,7 @@ Before running a `nwaku` node, it is necessary to build it. Nwaku provides multi
## Run the Node ## Run the Node
Once you have built the `nwaku` node, run it using the default configuration: Once you have built the `nwaku` node, run it using the [default configuration](/guides/reference/node-config-methods#default-configuration-values):
```bash ```bash
# Run with default configuration # Run with default configuration
@ -38,15 +38,6 @@ Once you have built the `nwaku` node, run it using the default configuration:
./build/wakunode2 --help ./build/wakunode2 --help
``` ```
By default, a `nwaku` node is configured to do the following:
- Generate a new private key and `PeerID`.
- Listen for incoming libp2p connections on the default TCP port (`60000`).
- Subscribe to the default Pub/Sub topic (`/waku/2/default-waku/proto`).
- Start the `JSON-RPC` HTTP server on the default port (`8545`).
- Enable the `Relay` protocol for relaying messages.
- Enable the `Store` protocol as a client, allowing it to query peers for historical messages but not store any message itself.
:::tip :::tip
For more advanced configurations like enabling other protocols or maintaining a consistent `PeerID`, please refer to the [Node Configuration Methods](/guides/reference/node-config-methods) guide. For more advanced configurations like enabling other protocols or maintaining a consistent `PeerID`, please refer to the [Node Configuration Methods](/guides/reference/node-config-methods) guide.
::: :::
@ -58,8 +49,8 @@ To join the Waku Network, nodes must connect with peers. Nwaku provides multiple
| | Description | Documentation | | | Description | Documentation |
| - | - | - | | - | - | - |
| Static Peers | Configure the bootstrap nodes that `nwaku` should establish connections upon startup | [Configure Static Peers](/guides/nwaku/configure-discovery#configure-static-peers) | | Static Peers | Configure the bootstrap nodes that `nwaku` should establish connections upon startup | [Configure Static Peers](/guides/nwaku/configure-discovery#configure-static-peers) |
| DNS Discovery | Enable `nwaku` to locate peers to connect to using the `DNS Discovery` mechanism | [Configure DNS Discovery](/guides/nwaku/configure-discovery#configure-dns-discovery) | | DNS Discovery | Enable `nwaku` to locate peers to connect to using the [DNS Discovery](/overview/concepts/dns-discovery) mechanism | [Configure DNS Discovery](/guides/nwaku/configure-discovery#configure-dns-discovery) |
| Discv5 | Enable `nwaku` to locate peers to connect to using the `Discv5` mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) | | Discv5 | Enable `nwaku` to locate peers to connect to using the [Discv5](/overview/concepts/discv5) mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) |
:::tip :::tip
You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously. You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously.
@ -137,7 +128,7 @@ INF 2023-06-15 16:09:54.448+01:00 Listening on top
### Discoverable ENR Address(es) ### Discoverable ENR Address(es)
A `nwaku` node can encode it's addressing information in an [Ethereum Node Record (ENR)](https://eips.ethereum.org/EIPS/eip-778) following the [WAKU2-ENR](https://rfc.vac.dev/spec/31/) specification, primarily for peer discovery. A `nwaku` node can encode its addressing information in an [Ethereum Node Record (ENR)](https://eips.ethereum.org/EIPS/eip-778) following the [WAKU2-ENR](https://rfc.vac.dev/spec/31/) specification, primarily for peer discovery.
#### ENR for DNS discovery #### ENR for DNS discovery

View File

@ -1,5 +1,5 @@
--- ---
title: Static Peer title: Static Peers
--- ---
Waku applications have the flexibility to embed bootstrap node addresses directly into their codebase. Developers can either use [static peers by Status](https://github.com/waku-org/js-waku/blob/master/packages/core/src/lib/predefined_bootstrap_nodes.ts#L45) or [run a node](/guides/nodes-and-sdks#run-a-waku-node) per their preference. Waku applications have the flexibility to embed bootstrap node addresses directly into their codebase. Developers can either use [static peers by Status](https://github.com/waku-org/js-waku/blob/master/packages/core/src/lib/predefined_bootstrap_nodes.ts#L45) or [run a node](/guides/nodes-and-sdks#run-a-waku-node) per their preference.

View File

@ -18,11 +18,11 @@ const sidebars = {
{ {
type: "category", type: "category",
label: "Concepts", label: "Concepts",
collapsed: false,
items: [ items: [
"overview/concepts/protocols", "overview/concepts/protocols",
"overview/concepts/content-topics", "overview/concepts/content-topics",
"overview/concepts/network-domains", "overview/concepts/network-domains",
"overview/concepts/transports",
{ {
type: "category", type: "category",
label: "Peer Discovery", label: "Peer Discovery",
@ -37,7 +37,6 @@ const sidebars = {
"overview/concepts/peer-exchange", "overview/concepts/peer-exchange",
] ]
}, },
"overview/concepts/transports",
] ]
}, },
{ {