diff --git a/docs/guides/nwaku/build-source.md b/docs/guides/nwaku/build-source.md index 31f59db..728a104 100644 --- a/docs/guides/nwaku/build-source.md +++ b/docs/guides/nwaku/build-source.md @@ -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. :::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 @@ -96,7 +96,7 @@ Nwaku will create the `wakunode2` binary in the `./build/` directory. To learn more about running nwaku, please refer to: - [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) - [Node Configuration Methods](/guides/reference/node-config-methods) diff --git a/docs/guides/nwaku/configure-discovery.md b/docs/guides/nwaku/configure-discovery.md index 3ae68fb..0c81c7e 100644 --- a/docs/guides/nwaku/configure-discovery.md +++ b/docs/guides/nwaku/configure-discovery.md @@ -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: ```bash -wakunode2 \ +./build/wakunode2 \ --staticnode:[Libp2p MULTIADDR PEER 1] \ --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 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://@` where `` is the fully qualified domain name and `` 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. -``` -wakunode2 \ +```bash +./build/wakunode2 \ --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 -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 -wakunode2 \ +./build/wakunode2 \ --discv5-discovery:true \ --discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 1] \ --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 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. ::: \ No newline at end of file diff --git a/docs/guides/nwaku/run-docker-compose.md b/docs/guides/nwaku/run-docker-compose.md index aa72fc4..c79d548 100644 --- a/docs/guides/nwaku/run-docker-compose.md +++ b/docs/guides/nwaku/run-docker-compose.md @@ -21,7 +21,7 @@ cd nwaku-compose ## 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 diff --git a/docs/guides/nwaku/run-docker.md b/docs/guides/nwaku/run-docker.md index e447df6..3717000 100644 --- a/docs/guides/nwaku/run-docker.md +++ b/docs/guides/nwaku/run-docker.md @@ -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. @@ -33,6 +33,8 @@ cd nwaku # Build image using docker build docker build -t statusteam/nim-waku:latest . +# or + # Build image using make make docker-image ``` diff --git a/docs/guides/reference/node-config-methods.md b/docs/guides/reference/node-config-methods.md index c70e68c..3a36b5c 100644 --- a/docs/guides/reference/node-config-methods.md +++ b/docs/guides/reference/node-config-methods.md @@ -6,7 +6,7 @@ Waku nodes can be configured using a combination of the following methods: 1. Command line options and flags 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 :::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: ```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: @@ -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: ```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: @@ -44,54 +44,55 @@ docker run -e "WAKUNODE2_TCP_PORT=65000" statusteam/nim-waku ``` :::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: ```toml title="TOML Config File" showLineNumbers log-level = "DEBUG" 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: ```bash -wakunode2 --config-file=[TOML CONFIGURATION FILE] +./build/wakunode2 --config-file=[TOML CONFIGURATION FILE] ``` You can also specify the configuration file via environment variables: ```bash # Using environment variables -WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE] wakunode2 +WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE] ./build/wakunode2 # Using environment variables with Docker docker run -e "WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE]" statusteam/nim-waku ``` :::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 -$ 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]. - -<...> +./build/wakunode2 --help ``` :::tip diff --git a/docs/guides/run-nwaku-node.md b/docs/guides/run-nwaku-node.md index 3ef482f..62af264 100644 --- a/docs/guides/run-nwaku-node.md +++ b/docs/guides/run-nwaku-node.md @@ -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) | | 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) | :::tip @@ -28,7 +28,7 @@ Before running a `nwaku` node, it is necessary to build it. Nwaku provides multi ## 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 # Run with default configuration @@ -38,15 +38,6 @@ Once you have built the `nwaku` node, run it using the default configuration: ./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 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 | | - | - | - | | 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) | -| Discv5 | Enable `nwaku` to locate peers to connect to using the `Discv5` mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) | +| 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](/overview/concepts/discv5) mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) | :::tip 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) -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 diff --git a/docs/overview/concepts/static-peers.md b/docs/overview/concepts/static-peers.md index 7b3b841..16bcc15 100644 --- a/docs/overview/concepts/static-peers.md +++ b/docs/overview/concepts/static-peers.md @@ -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. diff --git a/sidebars.js b/sidebars.js index d81ada1..9ed5136 100644 --- a/sidebars.js +++ b/sidebars.js @@ -18,11 +18,11 @@ const sidebars = { { type: "category", label: "Concepts", - collapsed: false, items: [ "overview/concepts/protocols", "overview/concepts/content-topics", "overview/concepts/network-domains", + "overview/concepts/transports", { type: "category", label: "Peer Discovery", @@ -37,7 +37,6 @@ const sidebars = { "overview/concepts/peer-exchange", ] }, - "overview/concepts/transports", ] }, {