mirror of https://github.com/status-im/go-waku.git
parent
6d65d4921c
commit
03d6614b70
|
@ -0,0 +1,28 @@
|
|||
# The go-waku guide for operators
|
||||
|
||||
*If you're eager to get started, check out our [quickstart guide](./quickstart.md).*
|
||||
|
||||
go-waku is a client implementation in Go of the [Waku v2 family of protocols](https://rfc.vac.dev/spec/10/) for peer-to-peer communication.
|
||||
The protocols are designed to be secure, privacy-preserving, censorship-resistant and able to run in resource restricted environments.
|
||||
Moreover, we've taken a modular approach so that node operators can choose which protocols they want to support
|
||||
based on their own motivations and availability of resources.
|
||||
We call this concept ["adaptive nodes"](https://rfc.vac.dev/spec/30/),
|
||||
implying that a Waku v2 network can consist of heterogeneous nodes contributing at different levels to the network.
|
||||
|
||||
This guide provides step-by-step tutorials covering how to build and configure your own go-waku node,
|
||||
connect to an existing Waku v2 network
|
||||
and use existing tools for monitoring and maintaining a running node.
|
||||
|
||||
## Helpful resources
|
||||
|
||||
<!-- TODO -->
|
||||
|
||||
## Getting in touch or reporting an issue
|
||||
|
||||
For an inquiry, or if you would like to propose new features, feel free to [open a general issue](https://github.com/status-im/go-waku/issues/new/).
|
||||
|
||||
For bug reports, please [tag your issue with the `bug` label](https://github.com/status-im/go-waku/issues/new/).
|
||||
|
||||
If you believe the reported issue requires critical attention, please [use the `critical` label](https://github.com/status-im/go-waku/issues/new?labels=critical,bug) to assist with triaging.
|
||||
|
||||
To get help, or participate in the conversation, join the [Vac Discord](https://discord.gg/KNj3ctuZvZ) server.
|
|
@ -0,0 +1,57 @@
|
|||
# Build go-waku
|
||||
|
||||
Go-waku can be built on Linux, macOS and Windows
|
||||
|
||||
## Installing dependencies
|
||||
|
||||
Cloning and building go-waku requires Go +1.17, a C compiler, Make, Bash and Git.
|
||||
|
||||
Go can be installed by following [these instructions](https://go.dev/doc/install)
|
||||
|
||||
### Linux
|
||||
|
||||
On common Linux distributions the dependencies can be installed with
|
||||
|
||||
```sh
|
||||
# Debian and Ubuntu
|
||||
sudo apt-get install build-essential git
|
||||
|
||||
# Fedora
|
||||
dnf install @development-tools
|
||||
|
||||
# Archlinux, using an AUR manager
|
||||
yourAURmanager -S base-devel
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
Assuming you use [Homebrew](https://brew.sh/) to manage packages
|
||||
|
||||
```sh
|
||||
brew install cmake
|
||||
```
|
||||
|
||||
## Building nwaku
|
||||
|
||||
### 1. Clone the nwaku repository
|
||||
|
||||
```sh
|
||||
git clone https://github.com/status-im/go-waku
|
||||
cd nwaku
|
||||
```
|
||||
|
||||
### 2. Build waku
|
||||
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
This will create a `waku` binary in the `./build/` directory.
|
||||
|
||||
> **Note:** Building `waku` requires 2GB of RAM.
|
||||
The build will fail on systems not fulfilling this requirement.
|
||||
|
||||
> Setting up `waku` on the smallest [digital ocean](https://docs.digitalocean.com/products/droplets/how-to/) droplet, you can either
|
||||
> * compile on a stronger droplet featuring the same CPU architecture and downgrade after compiling, or
|
||||
> * activate swap on the smallest droplet, or
|
||||
> * use Docker.
|
|
@ -0,0 +1,30 @@
|
|||
# Use DNS discovery to connect to existing nodes
|
||||
|
||||
> **Note:** This page describes using DNS to discover other peers
|
||||
and is unrelated to the [domain name configuration](./configure-domain.md) for your go-waku node.
|
||||
|
||||
A node can discover other nodes to connect to using [DNS-based discovery](../../tutorial/dns-disc.md).
|
||||
The following command line options are available:
|
||||
|
||||
```
|
||||
--dns-discovery Enable DNS Discovery
|
||||
--dns-discovery-url URL for DNS node list in format 'enrtree://<key>@<fqdn>'
|
||||
--dns-discovery-name-server DNS name server IPs to query. Argument may be repeated.
|
||||
```
|
||||
|
||||
- `--dns-discovery` is used to enable DNS discovery on the node.
|
||||
Waku DNS discovery is disabled by default.
|
||||
- `--dns-discovery-url` is mandatory if DNS discovery is enabled.
|
||||
It contains the URL for the node list.
|
||||
The URL must be 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` is optional and contains the IP(s) of the DNS name servers to query.
|
||||
If left unspecified, the Cloudflare servers `1.1.1.1` and `1.0.0.1` will be used by default.
|
||||
|
||||
A node will attempt connection to all discovered nodes.
|
||||
|
||||
This can be used, for example, to connect to one of the existing fleets.
|
||||
Current URLs for the published fleet lists:
|
||||
- production fleet: `enrtree://ANTL4SLG2COUILKAPE7EF2BYNL2SHSHVCHLRD5J7ZJLN5R3PRJD2Y@prod.waku.nodes.status.im`
|
||||
- test fleet: `enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.waku.nodes.status.im`
|
||||
|
||||
See the [separate tutorial](../../tutorial/dns-disc.md) for a complete guide to DNS discovery.
|
|
@ -0,0 +1,16 @@
|
|||
# Configure a domain name
|
||||
|
||||
> **Note:** This page describes configuring a domain name that resolves to your node's IP
|
||||
and is unrelated to [DNS discovery](./configure-dns-disc.md),
|
||||
by which a node may discover the listening addresses of other peers using DNS.
|
||||
|
||||
It is possible to configure an IPv4 DNS domain name that resolves to the node's public IPv4 address.
|
||||
|
||||
```shell
|
||||
waku --dns4-domain-name=mynode.example.com
|
||||
```
|
||||
|
||||
This allows for the node's publically announced `multiaddrs` to use the `/dns4` scheme.
|
||||
In addition, nodes with domain name and [secure websocket configured](./configure-websocket.md),
|
||||
will generate a discoverable ENR containing the `/wss` multiaddr with `/dns4` domain name.
|
||||
This is necessary to verify domain certificates when connecting to this node over secure websocket.
|
|
@ -0,0 +1,67 @@
|
|||
# Generate and configure a node key
|
||||
|
||||
By default a node will generate a new, random key pair each time it boots,
|
||||
resulting in a different public libp2p `multiaddrs` after each restart.
|
||||
|
||||
To maintain consistent addressing across restarts, there are different options:
|
||||
|
||||
### Using a previously generated key
|
||||
It is possible to configure the node with a previously generated private key using the `--nodekey`.
|
||||
|
||||
```shell
|
||||
wakunode2 --nodekey=<64_char_hex>
|
||||
```
|
||||
|
||||
This option takes a [Secp256k1](https://en.bitcoin.it/wiki/Secp256k1) private key in 64 char hexstring format.
|
||||
|
||||
To generate such a key on Linux systems,
|
||||
use the openssl `rand` command to generate a pseudo-random 32 byte hexstring.
|
||||
|
||||
```sh
|
||||
openssl rand -hex 32
|
||||
```
|
||||
|
||||
Example output:
|
||||
|
||||
```sh
|
||||
$ openssl rand -hex 32
|
||||
6a29e767c96a2a380bb66b9a6ffcd6eb54049e14d796a1d866307b8beb7aee58
|
||||
```
|
||||
|
||||
where the key `6a29e767c96a2a380bb66b9a6ffcd6eb54049e14d796a1d866307b8beb7aee58` can be used as `nodekey`.
|
||||
|
||||
To create a reusable keyfile on Linux using `openssl`,
|
||||
use the `ecparam` command coupled with some standard utilities
|
||||
whenever you want to extract the 32 byte private key in hex format.
|
||||
|
||||
```sh
|
||||
# Generate keyfile
|
||||
openssl ecparam -genkey -name secp256k1 -out my_private_key.pem
|
||||
# Extract 32 byte private key
|
||||
openssl ec -in my_private_key.pem -outform DER | tail -c +8 | head -c 32| xxd -p -c 32
|
||||
```
|
||||
|
||||
Example output:
|
||||
|
||||
```sh
|
||||
read EC key
|
||||
writing EC key
|
||||
0c687bb8a7984c770b566eae08520c67f53d302f24b8d4e5e47cc479a1e1ce23
|
||||
```
|
||||
|
||||
where the key `0c687bb8a7984c770b566eae08520c67f53d302f24b8d4e5e47cc479a1e1ce23` can be used as `nodekey`.
|
||||
|
||||
```sh
|
||||
waku --nodekey=0c687bb8a7984c770b566eae08520c67f53d302f24b8d4e5e47cc479a1e1ce23
|
||||
```
|
||||
|
||||
### generating a keyfile
|
||||
go-waku can generate an encrypted keyfile containing a random private key:
|
||||
```sh
|
||||
waku --generate-key
|
||||
```
|
||||
This will create a private key file at path specified in `--key-file` with the password defined by `--key-password`. By default the path is `./nodekey`, and the password for the keyfile is `secret`. This command will not overwrite an existing key file. For that, the `--overwrite` flag can be used.
|
||||
|
||||
### using a keyfile
|
||||
go-waku will attempt to read any file existing at the path specified in the `--key-file` flag. If such file exists, go-waku will attempt to decrypt it using the `--key-password`, and read the private key.
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
# Configure store protocol
|
||||
|
||||
Store protocol is enabled by default on a go-waku node.
|
||||
This is controlled by the `--store` CLI option.
|
||||
|
||||
```sh
|
||||
# Disable store protocol on startup
|
||||
./build/waku --store=false
|
||||
```
|
||||
|
||||
Note that this only mounts the `store` protocol,
|
||||
meaning your node will indicate to other peers that it supports `store`.
|
||||
It does not yet allow your node to either retrieve historical messages as a client
|
||||
or store and serve historical messages itself.
|
||||
|
||||
## Configuring a store client
|
||||
|
||||
Ensure that `store` is enabled (this is `true` by default) and provide at least one store service node address with the `--storenode` CLI option.
|
||||
|
||||
See the following example, using the peer at `/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/30303/p2p/16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm` as store service node.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--store=true \
|
||||
--storenode=/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/30303/p2p/16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm
|
||||
```
|
||||
|
||||
Your node can now send queries to retrieve historical messages
|
||||
from the configured store service node.
|
||||
One way to trigger such queries is asking your node for historical messages using the [Waku v2 JSON RPC API](https://rfc.vac.dev/spec/16/).
|
||||
|
||||
## Configuring a store service node
|
||||
|
||||
To store historical messages on your node which can be served to store clients the `--persist-messages` CLI option must be enabled.
|
||||
By default a node would store up to the latest `50 000` messages received in the last `2 592 000` seconds (30 days)
|
||||
This is configurable using the `--store-capacity` and `store-seconds` options.
|
||||
A node that has a `--db-path` set will backup historical messages to a local database at the DB path
|
||||
and persist these messages even after a restart.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--store=true \
|
||||
--persist-messages=true \
|
||||
--db-path=/mnt/go-waku/data/db1/ \
|
||||
--store-capacity=150000
|
||||
--store-seconds=5000000
|
||||
```
|
|
@ -0,0 +1,35 @@
|
|||
# Configure websocket transport
|
||||
|
||||
Websocket is currently the only Waku transport supported by browser nodes using [js-waku](https://github.com/status-im/js-waku).
|
||||
Setting up websocket enables your node to directly serve browser peers.
|
||||
|
||||
A valid certificate is necessary to serve browser nodes,
|
||||
you can use [`letsencrypt`](https://letsencrypt.org/):
|
||||
|
||||
```shell
|
||||
sudo letsencrypt -d <your.domain.name>
|
||||
```
|
||||
|
||||
You will need the `privkey.pem` and `fullchain.pem` files.
|
||||
|
||||
To enable secure websocket, pass the generated files to `waku`:
|
||||
Note, the default port for websocket is 8000.
|
||||
|
||||
```shell
|
||||
waku --websocket-secure-support=true --websocket-secure-key-path="<letsencrypt cert dir>/privkey.pem" --websocket-secure-cert-path="<letsencrypt cert dir>/fullchain.pem"
|
||||
```
|
||||
|
||||
## Self-signed certificates
|
||||
|
||||
Self-signed certificates are not recommended for production setups because:
|
||||
|
||||
- Browsers do not accept self-signed certificates
|
||||
- Browsers do not display an error when rejecting a certificate for websocket.
|
||||
|
||||
However, they can be used for local testing purposes:
|
||||
|
||||
```shell
|
||||
mkdir -p ./ssl_dir/
|
||||
openssl req -x509 -newkey rsa:4096 -keyout ./ssl_dir/key.pem -out ./ssl_dir/cert.pem -sha256 -nodes
|
||||
waku --websocket-secure-support=true --websocket-secure-key-path="./ssl_dir/key.pem" --websocket-secure-cert-path="./ssl_dir/cert.pem"
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
# Configure a go-waku node
|
||||
|
||||
go-waku can be configured to serve the adaptive needs of different operators.
|
||||
This page serves as an index of tutorials explaining how to configure your go-waku node for different use cases.
|
||||
|
||||
1. [Connect to other peers](./connect.md)
|
||||
1. [Configure a domain name](./configure-domain.md)
|
||||
1. [Use DNS discovery to connect to existing nodes](./configure-dns-disc.md)
|
||||
1. [Configure store protocol](./configure-store.md)
|
||||
1. [Generate and configure a node key](./configure-key.md)
|
||||
1. [Configure websocket transport](./configure-websocket.md)
|
|
@ -0,0 +1,60 @@
|
|||
# Connect to other peers
|
||||
|
||||
*Note that this tutorial describes how to **configure** a node to connect to other peers before runnning the node.
|
||||
For connecting a running node to existing peers,
|
||||
see the [JSON-RPC API](https://rfc.vac.dev/spec/16/).*
|
||||
|
||||
There are currently three options.
|
||||
Note that each of these options can be used in combination with any of the other two.
|
||||
In other words, it is possible to configure a node to connect
|
||||
to a static list of peers and
|
||||
to discover such peer lists using DNS discovery and
|
||||
discover and connect to random peers using discovery v5 with a bootstrap node.
|
||||
|
||||
## Option 1: Configure peers statically
|
||||
|
||||
Static peers can be provided to a go-waku node on startup using the `--staticnode` CLI parameter.
|
||||
The `--staticnode` option can be repeated for each peer you want to connect to on startup.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--staticnode=<libp2p-multiaddr-peer1> \
|
||||
--staticnode=<libp2p-multiaddr-peer2>
|
||||
```
|
||||
|
||||
As an example, consider a go-waku node that connects to two known peers
|
||||
on the same local host (with IP `0.0.0.0`)
|
||||
with TCP ports `60002` and `60003`,
|
||||
and peer IDs `16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H` and `16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ` respectively.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--staticnode=/ip4/0.0.0.0/tcp/60002/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H \
|
||||
--staticnode=/ip4/0.0.0.0/tcp/60003/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ
|
||||
```
|
||||
|
||||
## Option 2: Discover peers using DNS discovery
|
||||
|
||||
A node can discover other nodes to connect to using DNS-based discovery.
|
||||
For a quickstart guide on how to configure DNS discovery,
|
||||
see [this tutorial](./configure-dns-disc.md).
|
||||
There is also a [more comprehensive tutorial](../../tutorial/dns-disc.md) for advanced users.
|
||||
|
||||
## Option 3: Discover peers using Waku Discovery v5
|
||||
|
||||
<!-- TODO: add link to a separate discv5 config tutorial here -->
|
||||
|
||||
Enable Discovery v5 using the `--discv5-discovery` option.
|
||||
|
||||
It is possible to configure bootstrap entries for the Discovery v5 routing table
|
||||
using the `--discv5-bootstrap-node` option repeatedly.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--discv5-discovery=true \
|
||||
--discv5-bootstrap-node=<discv5-enr-bootstrap-entry1> \
|
||||
--discv5-bootstrap-node=<discv5-enr-bootstrap-entry2>
|
||||
```
|
||||
|
||||
Note that if Discovery v5 is enabled and used in conjunction with DNS-based discovery,
|
||||
the go-waku node will attempt to bootstrap the Discovery v5 routing table with ENRs extracted from the peers discovered via DNS.
|
|
@ -0,0 +1,184 @@
|
|||
# Running go-waku
|
||||
|
||||
```sh
|
||||
# Run with default configuration
|
||||
./build/waku
|
||||
|
||||
# See available command line options
|
||||
./build/waku --help
|
||||
```
|
||||
|
||||
## Default configuration
|
||||
|
||||
By default a go-waku node will:
|
||||
- generate a new private key and libp2p identities after every restart.
|
||||
See [this tutorial](./configure-key.md) if you want to generate and configure a persistent private key.
|
||||
- listen for incoming libp2p connections on the default TCP port (`60000`)
|
||||
- enable `relay` protocol
|
||||
- subscribe to the default pubsub topic, namely `/waku/2/default-waku/proto`
|
||||
- enable `store` protocol, but only as a client.
|
||||
This implies that the nwaku node will not persist any historical messages itself,
|
||||
but can query `store` service peers who do so.
|
||||
To configure `store` as a service node,
|
||||
see [this tutorial](./configure-store.md).
|
||||
|
||||
> **Note:** The `filter` and `lightpush` protocols are _not_ enabled by default.
|
||||
Consult the [configuration guide](./configure.md) on how to configure your nwaku node to run these protocols.
|
||||
|
||||
Some typical non-default configurations are explained below.
|
||||
For more advanced configuration, see the [configuration guide](./configure.md).
|
||||
Different ways to connect to other nodes are expanded upon in our [connection guide](./connect.md).
|
||||
|
||||
## Finding your listening address(es)
|
||||
|
||||
Find the log entry beginning with `Listening on`.
|
||||
It should be printed at INFO level when you start your node
|
||||
and contains a list of all publically announced listening addresses for the nwaku node.
|
||||
|
||||
For example
|
||||
|
||||
```
|
||||
2022-07-25T07:26:01.150-0400 INFO gowaku.node2 listening {"node": "16Uiu2HAkxFXYTRHWTnT1oT2BA8foKopFSXNfvXzbfvcuF6e88qf4", "multiaddr": ["/ip4/127.0.0.1/tcp/60000/p2p/16Uiu2HAkxFXYTRHWTnT1oT2BA8foKopFSXNfvXzbfvcuF6e88qf4", "/ip4/127.0.0.1/tcp/60001/ws/p2p/16Uiu2HAkxFXYTRHWTnT1oT2BA8foKopFSXNfvXzbfvcuF6e88qf4"]}
|
||||
```
|
||||
|
||||
indicates that your node is listening on the TCP transport addresses
|
||||
|
||||
```
|
||||
/ip4/127.0.0.1/tcp/60000/p2p/16Uiu2HAkxFXYTRHWTnT1oT2BA8foKopFSXNfvXzbfvcuF6e88qf4
|
||||
```
|
||||
|
||||
and websocket address
|
||||
|
||||
```
|
||||
/ip4/127.0.0.1/tcp/60001/ws/p2p/16Uiu2HAkxFXYTRHWTnT1oT2BA8foKopFSXNfvXzbfvcuF6e88qf4
|
||||
```
|
||||
|
||||
You can also query a running node for its listening addresses
|
||||
using a [`get_waku_v2_debug_v1_info` JSON-RPC API](https://rfc.vac.dev/spec/16/#get_waku_v2_debug_v1_info) call.
|
||||
|
||||
For example
|
||||
|
||||
```sh
|
||||
curl -d '{"jsonrpc":"2.0","id":"id","method":"get_waku_v2_debug_v1_info", "params":[]}' --header "Content-Type: application/json" http://localhost:8545
|
||||
```
|
||||
|
||||
returns a response similar to
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"enrUri": "enr:-Iu4QJecqtDmg5JBwhEGCifJE-nfBUPvJpV1_Q7CtbJqX85pc8TV5xNIJKohJHnOtbQjycQV0OSzJeCsUB2a7hnfEP0BgmlkgnY0gmlwhMCoAG2Jc2VjcDI1NmsxoQJyDYLm_cOh10d-9TP34svDeh_AsrfmoDqrlpDeoNOmg4N0Y3CC6mCFd2FrdTIB",
|
||||
"listenAddresses": [
|
||||
"/ip4/192.168.0.109/tcp/60000/p2p/16Uiu2HAm36tQZYF9ijH9PzgZKcJDxyKz93iue4RjpBLkvcbo6mhU",
|
||||
"/ip4/127.0.0.1/tcp/60000/p2p/16Uiu2HAm36tQZYF9ijH9PzgZKcJDxyKz93iue4RjpBLkvcbo6mhU"
|
||||
]
|
||||
},
|
||||
"error": null,
|
||||
"id": "id"
|
||||
}
|
||||
```
|
||||
|
||||
## Finding your discoverable ENR address(es)
|
||||
|
||||
A nwaku node can encode its addressing information in an [Ethereum Node Record (ENR)](https://eips.ethereum.org/EIPS/eip-778) according to [`31/WAKU2-ENR`](https://rfc.vac.dev/spec/31/).
|
||||
These ENR are most often used for discovery purposes.
|
||||
|
||||
### ENR for DNS discovery and DiscV5
|
||||
|
||||
Find the log entry containing the text `enr record`.
|
||||
|
||||
For example
|
||||
|
||||
```
|
||||
2022-07-25T07:27:15.007-0400 INFO gowaku.node2 enr record {"node": "16Uiu2HAmSBY66Awj56ssci4tJ3bEmcG8oRpufZwqe4Ueb46i7bWg", "enr": "enr:-KO4QJmGMGthIh_kCubluVD9jZLPDcqNgLgDYJxruIULs2elNcZxnIYqEZD-f9f-zsY2QMqEVosMxShxwTG8BkzkWQ8BgmlkgnY0gmlwhMCoAG2KbXVsdGlhZGRyc4wACgTAqABtBuph3QOJc2VjcDI1NmsxoQPI-z2SDgsKlci7pAYysALdIFv9ySJlRpynQbZdlJoU4YN0Y3CC6mCFd2FrdTIB"}
|
||||
```
|
||||
|
||||
indicates that your node addresses are encoded in the ENR
|
||||
|
||||
```
|
||||
enr:-KO4QJmGMGthIh_kCubluVD9jZLPDcqNgLgDYJxruIULs2elNcZxnIYqEZD-f9f-zsY2QMqEVosMxShxwTG8BkzkWQ8BgmlkgnY0gmlwhMCoAG2KbXVsdGlhZGRyc4wACgTAqABtBuph3QOJc2VjcDI1NmsxoQPI-z2SDgsKlci7pAYysALdIFv9ySJlRpynQbZdlJoU4YN0Y3CC6mCFd2FrdTIB
|
||||
```
|
||||
|
||||
## Typical configuration (relay node)
|
||||
|
||||
The typical configuration for a go-waku node is to run the `relay` protocol,
|
||||
subscribed to the default pubsub topic `/waku/2/default-waku/proto`,
|
||||
and connecting to one or more existing peers.
|
||||
We assume below that running nodes also participate in Discovery v5
|
||||
to continually discover and connect to random peers for a more robust mesh.
|
||||
|
||||
### Connecting to known peer(s)
|
||||
|
||||
A typical run configuration for a go-waku node is to connect to existing peers with known listening addresses using the `--staticnode` option.
|
||||
The `--staticnode` option can be repeated for each peer you want to connect to on startup.
|
||||
This is also useful if you want to run several nwaku instances locally
|
||||
and therefore know the listening addresses of all peers.
|
||||
|
||||
As an example, consider a nwaku node that connects to two known peers
|
||||
on the same local host (with IP `0.0.0.0`)
|
||||
with TCP ports `60002` and `60003`,
|
||||
and peer IDs `16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H` and `16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ` respectively.
|
||||
The Discovery v5 routing table can similarly be bootstrapped using a static ENR.
|
||||
We include an example below.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--staticnode=/ip4/0.0.0.0/tcp/60002/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H \
|
||||
--staticnode=/ip4/0.0.0.0/tcp/60003/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ \
|
||||
--discv5-discovery=true \
|
||||
--discv5-bootstrap-node=enr:-JK4QM2ylZVUhVPqXrqhWWi38V46bF2XZXPSHh_D7f2PmUHbIw-4DidCBnBnm-IbxtjXOFbdMMgpHUv4dYVH6TgnkucBgmlkgnY0gmowhCJ6_HaJc2VjcDI1NmsxoQM06FsT6EJ57mzR_wiLu2Bz1dER2nUFSCpaFzCccQtnhYN0Y3CCdl-DdWRwgiMohXdha3UyDw
|
||||
```
|
||||
|
||||
|
||||
### Connecting to the `wakuv2.prod` network
|
||||
|
||||
You can use DNS discovery to bootstrap connection to the existing production network.
|
||||
Discovery v5 will attempt to extract the ENRs of the discovered nodes as bootstrap entries to the routing table.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--dns-discovery=true \
|
||||
--dns-discovery-url=enrtree://ANTL4SLG2COUILKAPE7EF2BYNL2SHSHVCHLRD5J7ZJLN5R3PRJD2Y@prod.waku.nodes.status.im \
|
||||
--discv5-discovery=true
|
||||
```
|
||||
|
||||
### Connecting to the `wakuv2.test` network
|
||||
|
||||
You can use DNS discovery to bootstrap connection to the existing test network.
|
||||
Discovery v5 will attempt to extract the ENRs of the discovered nodes as bootstrap entries to the routing table.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--dns-discovery=true \
|
||||
--dns-discovery-url=enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.waku.nodes.status.im \
|
||||
--discv5-discovery=true
|
||||
```
|
||||
|
||||
## Typical configuration (relay and store service node)
|
||||
|
||||
Often go-waku nodes choose to also store historical messages
|
||||
from where it can be queried by other peers who may have been temporarily offline.
|
||||
For example, a typical configuration for such a store service node,
|
||||
[connecting to the `wakuv2.test`](#connecting-to-the-wakuv2test-fleet) fleet on startup,
|
||||
appears below.
|
||||
|
||||
```sh
|
||||
./build/waku \
|
||||
--store=true \
|
||||
--persist-messages=true \
|
||||
--db-path=/mnt/go-waku/data/db1/ \
|
||||
--store-capacity=150000 \
|
||||
--dns-discovery=true \
|
||||
--dns-discovery-url=enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.waku.nodes.status.im \
|
||||
--discv5-discovery=true
|
||||
```
|
||||
|
||||
See our [store configuration tutorial](./configure-store.md) for more.
|
||||
|
||||
## Interact with a running go-waku node
|
||||
|
||||
A running go-waku node can be interacted with using the [Waku v2 JSON RPC API](https://rfc.vac.dev/spec/16/).
|
||||
|
||||
> **Note:** Private and Admin API functionality are disabled by default.
|
||||
To configure a nwaku node with these enabled,
|
||||
use the `--rpc-admin:true` and `--rpc-private:true` CLI options.
|
|
@ -0,0 +1,27 @@
|
|||
# Quickstart: running a go-waku node
|
||||
|
||||
This guide explains how to build and run a go-waku node
|
||||
for the most common use cases.
|
||||
For a more advanced configuration see our [configuration guides](./how-to/configure.md)
|
||||
|
||||
## 1. Build
|
||||
|
||||
[Build the go-waku node](./how-to/build.md)
|
||||
or download a precompiled binary from our [releases page](https://github.com/status-im/go-waku/releases).
|
||||
<!-- Docker images are published to [statusteam/go-waku](https://hub.docker.com/r/statusteam/go-waku/tags) on DockerHub. -->
|
||||
<!-- TODO: more advanced explanation on finding and using docker images -->
|
||||
|
||||
## 2. Run
|
||||
|
||||
[Run the go-waku node](./how-to/run.md) using a default or common configuration
|
||||
or [configure](./how-to/configure.md) the node for more advanced use cases.
|
||||
|
||||
[Connect](./how-to/connect.md) the nwaku node to other peers to start communicating.
|
||||
|
||||
## 3. Interact
|
||||
|
||||
A running go-waku node can be interacted with using the [Waku v2 JSON RPC API](https://rfc.vac.dev/spec/16/).
|
||||
|
||||
> **Note:** Private and Admin API functionality are disabled by default.
|
||||
To configure a go-waku node with these enabled,
|
||||
use the `--rpc-admin:true` and `--rpc-private:true` CLI options.
|
Loading…
Reference in New Issue