mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-02 21:03:13 +00:00
* Split website in 4: - build - run node - learn - research * only show pages of section in sidebar * home button on each sidebar * index.md for homepages * Add video tutorials * delete old getting-started * rename to "Waku node" * fix nwaku compose * add to dict * script revert research changes * fix broken links * move research index content * move research folder under learn * move research folder under learn: side bar and buttons * remove pointless links
102 lines
3.4 KiB
Markdown
102 lines
3.4 KiB
Markdown
---
|
|
title: Node Configuration Methods
|
|
hide_table_of_contents: true
|
|
displayed_sidebar: runNode
|
|
---
|
|
|
|
Waku nodes can be configured using a combination of the following methods:
|
|
|
|
1. Command line options and flags
|
|
2. Environment variables
|
|
3. TOML configuration files (currently the only supported format)
|
|
4. Default values
|
|
|
|
:::info
|
|
Take note of the precedence order: Each configuration method overrides the one below it (e.g., command line options override environment variables and configuration files).
|
|
:::
|
|
|
|
## Command line options
|
|
|
|
Node configuration is primarily done using command line options, which override other methods. Specify [configuration options](/run-node/config-options) by providing them in this format after the binary name:
|
|
|
|
```shell
|
|
./build/wakunode2 --tcp-port=65000
|
|
```
|
|
|
|
When running your node with Docker, provide the command line options after the image name in this format:
|
|
|
|
```shell
|
|
docker run wakuorg/nwaku --tcp-port=65000
|
|
```
|
|
|
|
## Environment variables
|
|
|
|
Nodes can be configured using environment variables by prefixing the variable name with `WAKUNODE2_` and using the configuration option in [SCREAMING_SNAKE_CASE](https://en.wiktionary.org/wiki/screaming_snake_case) format.
|
|
|
|
To set the `tcp-port` configuration, the `wakunode2` binary should be called in this format:
|
|
|
|
```shell
|
|
WAKUNODE2_TCP_PORT=65000 ./build/wakunode2
|
|
```
|
|
|
|
When running your node with Docker, start the node using the `-e` command option:
|
|
|
|
```shell
|
|
docker run -e "WAKUNODE2_TCP_PORT=65000" wakuorg/nwaku
|
|
```
|
|
|
|
:::info
|
|
This is the second configuration method in order of precedence. [Command Line Options](#command-line-options) override environment variables.
|
|
:::
|
|
|
|
## 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](/run-node/config-options) lets you specify the configuration file path:
|
|
|
|
```shell
|
|
./build/wakunode2 --config-file=[TOML CONFIGURATION FILE]
|
|
```
|
|
|
|
You can also specify the configuration file via environment variables:
|
|
|
|
```shell
|
|
# Using environment variables
|
|
WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE] ./build/wakunode2
|
|
|
|
# Using environment variables with Docker
|
|
docker run -e "WAKUNODE2_CONFIG_FILE=[TOML CONFIGURATION FILE]" wakuorg/nwaku
|
|
```
|
|
|
|
:::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.
|
|
:::
|
|
|
|
## Default configuration values
|
|
|
|
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`).
|
|
- 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](/run-node/config-options), run `wakunode2 --help`:
|
|
|
|
```shell
|
|
./build/wakunode2 --help
|
|
```
|
|
|
|
:::tip
|
|
To explore the available node configuration options, have a look at the [Node Configuration Options](/run-node/config-options) guide.
|
|
:::
|