Skip to content

Commit 4e1cc33

Browse files
committed
add peer discovery guide
1 parent a6aae70 commit 4e1cc33

11 files changed

+80
-21
lines changed

.cspell.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"devel",
4646
"statusteam",
4747
"myaddr",
48-
"extip"
48+
"extip",
49+
"staticnode",
50+
"permissioned"
4951
],
5052
"flagWords": [],
5153
"ignorePaths": [
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```mermaid
22
sequenceDiagram
3-
Alice->>Bob: Connect to Bob (predefined node details)
4-
Alice->>Carol: Connect to Carol (predefined node details)
3+
Alice->>Bob: Connect to Bob (static peer details)
4+
Alice->>Carol: Connect to Carol (static peer details)
55
```
66

77
Alice establishes connections with Bob and Carol using their node details, which are predefined (hard-coded) into Alice's node.
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Configure Peer Discovery
3+
---
4+
5+
This guide provides detailed steps to configure a `nwaku` node to locate and connect with peers in the Waku Network.
6+
7+
:::tip
8+
You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously.
9+
:::
10+
11+
## Configure Static Peers
12+
13+
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:
14+
15+
```bash
16+
wakunode2 \
17+
--staticnode:[Libp2p MULTIADDR PEER 1] \
18+
--staticnode:[Libp2p MULTIADDR PEER 2]
19+
```
20+
21+
## Configure DNS Discovery
22+
23+
To enable [DNS Discovery](/overview/concepts/dns-discovery) in a `nwaku` node, use the following configuration options:
24+
25+
- `dns-discovery`: Enables DNS Discovery on the node (disabled by default).
26+
- `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.
27+
- `dns-discovery-name-server` (optional): DNS name server IPs to query. You can repeat this option to provide multiple DNS name servers.
28+
29+
```
30+
wakunode2 \
31+
--dns-discovery:true \
32+
--dns-discovery-url:[DNS NODE LIST]
33+
```
34+
35+
## Configure Discv5
36+
37+
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:
38+
39+
```bash
40+
wakunode2 \
41+
--discv5-discovery:true \
42+
--discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 1] \
43+
--discv5-bootstrap-node:[DISCV5 ENR BOOTSTRAP ENTRY 2]
44+
```
45+
46+
:::info
47+
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.
48+
:::

docs/guides/reference/node-config-methods.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ The following options are available:
9292
--tcp-port TCP listening port. [=60000].
9393

9494
<...>
95-
```
95+
```
96+
97+
:::tip
98+
To explore the available node configuration options, please refer to the [Node Configuration Options](/guides/reference/node-config-options) guide.
99+
:::

docs/guides/reference/node-config-options.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Node Configuration Options
33
---
44

5-
Here are the node configuration options and their descriptions:
5+
Here are the available node configuration options, along with their default values and descriptions:
66

77
## Application-Level Config
88

@@ -131,7 +131,7 @@ Here are the node configuration options and their descriptions:
131131
| `dns-discovery-url` | | URL for DNS node list in format 'enrtree://<key\>@<fqdn\>' |
132132
| `dns-discovery-name-server` | `@[1.1.1.1, 1.0.0.1]` | DNS name server IPs to query. Argument may be repeated |
133133

134-
## Discovery v5 Config
134+
## Discv5 Config
135135

136136
| Name | Default Value | Description |
137137
| - | - | - |
@@ -158,4 +158,8 @@ Here are the node configuration options and their descriptions:
158158
| `websocket-port` | `8000` | WebSocket listening port |
159159
| `websocket-secure-support` | `false` | Enable secure websocket: true\|false |
160160
| `websocket-secure-key-path` | | Secure websocket key path: '/path/to/key.txt' |
161-
| `websocket-secure-cert-path` | | Secure websocket Certificate path: '/path/to/cert.txt' |
161+
| `websocket-secure-cert-path` | | Secure websocket Certificate path: '/path/to/cert.txt' |
162+
163+
:::tip
164+
To configure your node using the provided configuration options, please refer to the [Node Configuration Methods](/guides/reference/node-config-methods) guide.
165+
:::

docs/guides/run-nwaku-node.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ To join the Waku Network, nodes must connect with peers. Nwaku provides multiple
5757

5858
| | Description | Documentation |
5959
| - | - | - |
60-
| Predefined Nodes | Configure the bootstrap nodes that `nwaku` should establish connections upon startup | [Configure Predefined Nodes](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/connect.md#option-1-configure-peers-statically) |
61-
| DNS Discovery | Enable `nwaku` to locate peers to connect to using the `DNS Discovery` mechanism | [Configure DNS Discovery](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure-dns-disc.md) |
62-
| Discv5 | Enable `nwaku` to locate peers to connect to using the `Discv5` mechanism | [Configure Discv5](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/connect.md#option-3-discover-peers-using-waku-discovery-v5) |
60+
| Static Peers | Configure the bootstrap nodes that `nwaku` should establish connections upon startup | [Configure Static Peers](/guides/nwaku/configure-discovery#configure-static-peers) |
61+
| 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) |
62+
| Discv5 | Enable `nwaku` to locate peers to connect to using the `Discv5` mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) |
6363

6464
:::tip
6565
You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously.

docs/overview/concepts/peer-discovery.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Once a connection is established, the node must actively seek out additional pee
1212

1313
Waku supports multiple peer discovery mechanisms, such as:
1414

15-
- [Configuring Predefined Nodes](/overview/concepts/predefined-nodes)
15+
- [Configuring Static Peers](/overview/concepts/static-peers)
1616
- [Peer Discovery via DNS](/overview/concepts/dns-discovery)
1717
- [Discv5 Ambient Peer Discovery](/overview/concepts/discv5)
1818
- [Peer Exchange](/overview/concepts/peer-exchange)

docs/overview/concepts/predefined-nodes.md docs/overview/concepts/static-peers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Predefined Nodes
2+
title: Static Peer
33
---
44

5-
Waku applications have the flexibility to embed bootstrap node addresses directly into their codebase. Developers can use either the [predefined nodes 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.
5+
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.
66

77
#### Pros
88

@@ -18,7 +18,7 @@ Waku applications have the flexibility to embed bootstrap node addresses directl
1818
## Overview
1919

2020
```mdx-code-block
21-
import PredefinedNodes from "@site/diagrams/_predefined-nodes.md";
21+
import StaticPeers from "@site/diagrams/_static-peers.md";
2222
23-
<PredefinedNodes />
23+
<StaticPeers />
2424
```

docs/powered-by-waku.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import { PoweredBy } from "@site/src/components/mdx";
1111
{
1212
name: "Status",
1313
description:
14-
"Status is a secure messaging app, crypto wallet, and Web3 browser built with state-of-the-art technology.",
14+
"Waku powers many of the Status super app's features, including its private messaging.",
1515
logoSrc: "/img/status-mark-black.svg",
1616
logoSrcDark: "/img/status-mark-white.svg",
1717
link: "https://status.im",
1818
},
1919
{
2020
name: "RAILGUN",
2121
description:
22-
"RAILGUN uses Waku to offer private gas payments to users, ensuring anonymity and privacy for their transactions.",
22+
"The privacy-focused DeFi protocol Railgun anonymizes Ethereum transactions with Waku.",
2323
logoSrc: "/img/railgun-mark-black.svg",
2424
logoSrcDark: "/img/railgun-mark-white.svg",
2525
link: "https://railgun.org",
@@ -35,7 +35,7 @@ import { PoweredBy } from "@site/src/components/mdx";
3535
{
3636
name: "XMTP",
3737
description:
38-
"XMTP uses the Waku network to enable secure Web3 messaging in their open protocol and network.",
38+
"Inter-blockchain account messaging protocol XMTP uses Waku to facilitate communication between nodes in its currently permissioned network.",
3939
logoSrc: "/img/xmtp-mark-black.svg",
4040
logoSrcDark: "/img/xmtp-mark-white.svg",
4141
link: "https://xmtp.org",

scripts/config-table-generator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def parse_table_heading(line: str) -> Tuple[str, bool]:
1717
word_replace_re = re.compile('|'.join([
1818
r'(Configuration)', r'(And)', r'(Lightpush)',
1919
r'(Json-Rpc)', r'(Rest Http)', r'(Dns)',
20-
r'(V5)', r'(Websocket)'
20+
r'(Discovery V5)', r'(Websocket)'
2121
]))
2222
word_replace_dict = {
2323
'Configuration': 'Config', 'And': 'and', 'Lightpush': 'Light Push',
2424
'Json-Rpc': 'JSON-RPC', 'Rest Http': 'REST HTTP', 'Dns': 'DNS',
25-
'V5': 'v5', 'Websocket': 'WebSocket'
25+
'Discovery V5': 'Discv5', 'Websocket': 'WebSocket'
2626
}
2727
table_heading = word_replace_re.sub(lambda match: word_replace_dict[match.group(0)], table_heading)
2828
return '## ' + table_heading, True

sidebars.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const sidebars = {
3131
id: "overview/concepts/peer-discovery",
3232
},
3333
items: [
34-
"overview/concepts/predefined-nodes",
34+
"overview/concepts/static-peers",
3535
"overview/concepts/dns-discovery",
3636
"overview/concepts/discv5",
3737
"overview/concepts/peer-exchange",
@@ -64,6 +64,7 @@ const sidebars = {
6464
"guides/nwaku/build-source",
6565
"guides/nwaku/run-docker",
6666
"guides/nwaku/run-docker-compose",
67+
"guides/nwaku/configure-discovery",
6768
]
6869
},
6970
{

0 commit comments

Comments
 (0)