2022-05-20 12:48:34 +00:00
# Quickstart: running a nwaku node
2022-10-24 08:31:33 +00:00
This guide helps you run a nwaku node with typical configuration.
It connects your node to the `wakuv2.prod` fleet for bootstrapping
and enables discovery v5 for continuous peer discovery.
Only [`relay` ](https://rfc.vac.dev/spec/11/ ) protocol is enabled.
For a more comprehensive overview,
see our [step-by-step guide ](./overview.md ).
2022-05-20 12:48:34 +00:00
2022-10-24 08:31:33 +00:00
## Option 1: run nwaku binary
2022-09-13 10:41:36 +00:00
2022-10-24 08:31:33 +00:00
*Prerequisites are the usual developer tools,
such as a C compiler, Make, Bash and Git.*
2022-05-20 12:48:34 +00:00
2022-10-24 08:31:33 +00:00
```bash
2023-05-25 11:37:49 +00:00
git clone --recurse-submodules https://github.com/waku-org/nwaku
2022-10-24 08:31:33 +00:00
cd nwaku
make wakunode2
./build/wakunode2 \
--dns-discovery:true \
2023-09-26 10:47:52 +00:00
--dns-discovery-url:enrtree://ANEDLO25QVUGJOUTQFRYKWX6P4Z4GKVESBMHML7DZ6YK4LGS5FC5O@prod.wakuv2.nodes.status.im \
2022-10-24 08:31:33 +00:00
--discv5-discovery \
--nat=extip:[yourpublicip] # or, if you are behind a nat: --nat=any
```
2022-05-20 12:48:34 +00:00
2022-10-24 08:31:33 +00:00
## Option 2: run nwaku in a Docker container
2022-05-20 12:48:34 +00:00
2022-10-24 08:31:33 +00:00
*Prerequisite is a [Docker installation ](./docker-quickstart.md#prerequisites ).*
2022-06-28 10:22:59 +00:00
```bash
2022-10-24 08:31:33 +00:00
docker run -i -t -p 60000:60000 -p 9000:9000/udp \
2023-09-26 10:09:20 +00:00
wakuorg/nwaku:v0.20.0 \ # or, the image:tag of your choice
2022-10-24 08:31:33 +00:00
--dns-discovery:true \
2023-09-26 10:47:52 +00:00
--dns-discovery-url:enrtree://ANEDLO25QVUGJOUTQFRYKWX6P4Z4GKVESBMHML7DZ6YK4LGS5FC5O@prod.wakuv2.nodes.status.im \
2022-10-24 08:31:33 +00:00
--discv5-discovery \
--nat:extip:[yourpublicip] # or, if you are behind a nat: --nat=any
2022-06-28 10:22:59 +00:00
```
2022-12-05 15:25:37 +00:00
## Option 3: run nwaku with docker compose
*Prerequisites: `docker` and `docker-compose` *.
Allows to run `nwaku` with `prometheus` and `grafana` , with an already provisioned dashboard, in a few simple steps.
2023-08-09 11:10:31 +00:00
See [nwaku-compose ](https://github.com/waku-org/nwaku-compose ).
2022-12-05 15:25:37 +00:00
```bash
2023-08-09 11:10:31 +00:00
git clone https://github.com/waku-org/nwaku-compose
2022-12-05 15:25:37 +00:00
cd nwaku-compose
docker-compose up -d
```
Go to [http://localhost:3000/d/yns_4vFVk/nwaku-monitoring?orgId=1 ](http://localhost:3000/d/yns_4vFVk/nwaku-monitoring?orgId=1 ) and after some seconds, your node metrics will be live there.
As simple as that.
2022-10-24 08:31:33 +00:00
## Tips and tricks
2022-06-28 10:22:59 +00:00
2022-10-24 08:31:33 +00:00
To find the public IP of your host,
you can use
2022-06-28 10:22:59 +00:00
```bash
2022-10-24 08:31:33 +00:00
dig TXT +short o-o.myaddr.l.google.com @ns1 .google.com | awk -F'"' '{ print $2}'
2022-06-28 10:22:59 +00:00
```