add run docker guide

This commit is contained in:
LordGhostX 2023-06-14 13:08:58 +01:00
parent 749c3349fe
commit e6a40d17a3
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7
6 changed files with 73 additions and 10 deletions

View File

@ -42,7 +42,8 @@
"wakunode", "wakunode",
"autoplay", "autoplay",
"classwide", "classwide",
"devel" "devel",
"statusteam"
], ],
"flagWords": [], "flagWords": [],
"ignorePaths": [ "ignorePaths": [

View File

@ -2,7 +2,7 @@
title: Build Nwaku from Source title: Build Nwaku from Source
--- ---
Nwaku offers the option of building a node from the source when you want to access the latest development version or a specific commit of nwaku. If you prefer a more stable version, [download a pre-compiled binary](https://github.com/waku-org/nwaku/tags) instead. This guide provides detailed steps to build a nwaku node from the source to access the latest development version or a specific commit of nwaku. If you prefer a more stable version, [download a pre-compiled binary](https://github.com/waku-org/nwaku/tags) instead.
:::info :::info
Nwaku can be built and run on Linux and macOS, while Windows support is currently experimental. Nwaku can be built and run on Linux and macOS, while Windows support is currently experimental.
@ -16,6 +16,8 @@ Nwaku can be built and run on Linux and macOS, while Windows support is currentl
## Install Dependencies ## Install Dependencies
To clone and build nwaku, you will need the standard developer tools, including a C compiler, Make, Bash, and Git.
#### Linux #### Linux
To install the dependencies on common Linux distributions, run the following: To install the dependencies on common Linux distributions, run the following:
@ -44,7 +46,7 @@ dnf install @development-tools
```bash ```bash
# using your favorite AUR helper # using your favorite AUR helper
yourAURhelper -S base-devel [AUR HELPER] -S base-devel
``` ```
</TabItem> </TabItem>
@ -66,7 +68,8 @@ Get the source code from the GitHub repository. The default branch is `master`,
git clone https://github.com/waku-org/nwaku git clone https://github.com/waku-org/nwaku
cd nwaku cd nwaku
``` ```
:::info
:::tip
You can use `git tag -l` to check specific version tags. You can use `git tag -l` to check specific version tags.
::: :::
@ -78,7 +81,7 @@ To build the nwaku binary, run the following:
make wakunode2 make wakunode2
``` ```
The first `make` invocation updates all Git submodules. After each `git pull`, run `make update` to keep the submodules updated in the future. The first `make` invocation updates to all Git submodules. After each `git pull`, run `make update` to keep the submodules updated in the future.
```bash ```bash
make update wakunode2 make update wakunode2
@ -95,7 +98,7 @@ Nwaku will create the `wakunode2` binary in the `./build/` directory.
To learn more about running nwaku, please refer to: To learn more about running nwaku, please refer to:
- [Run a Nwaku Node](/guides/run-nwaku-node#run-the-node) - [Run a Nwaku Node](/guides/run-nwaku-node#run-the-node)
- [Run Nwaku in Docker Container](https://github.com/waku-org/nwaku/blob/master/docs/operators/docker-quickstart.md) - [Run Nwaku in Docker Container](/guides/nwaku/run-docker)
- [Run Nwaku on DigitalOcean Droplet](https://github.com/waku-org/nwaku/blob/master/docs/operators/droplet-quickstart.md) - [Run Nwaku on DigitalOcean Droplet](https://github.com/waku-org/nwaku/blob/master/docs/operators/droplet-quickstart.md)
## Run Test Suite ## Run Test Suite

View File

@ -0,0 +1,58 @@
---
title: Run Nwaku in Docker Container
---
This guide provides detailed steps to build and run a nwaku node in a Docker container.
## Prerequisites
Ensure [Docker](https://www.docker.com/) is installed on your system using the appropriate instructions provided in the [Docker documentation](https://docs.docker.com/engine/install/). For example, you can use Docker's convenience script for installation:
```bash
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
```
## Get Docker Image
The Nwaku Docker images are available on the Docker Hub public registry under the [statusteam/nim-waku](https://hub.docker.com/r/statusteam/nim-waku) repository. Please visit [statusteam/nim-waku/tags](https://hub.docker.com/r/statusteam/nim-waku/tags) for images of specific releases.
To pull the latest image, run the following:
```bash
docker pull statusteam/nim-waku
```
You can also build the Docker image locally using:
```bash
git clone --recurse-submodules https://github.com/waku-org/nwaku
cd nwaku
docker build -t statusteam/nim-waku:latest .
```
## Run Docker Container
To run nwaku in a new Docker container, run the following:
```bash
docker run [OPTIONS] [IMAGE] [ARG...]
```
- `OPTIONS` are your selected [Docker options](https://docs.docker.com/engine/reference/commandline/run/#options)
- `IMAGE` is the image and tag you pulled from the registry or built locally
- `ARG...` is the list of nwaku arguments for your [chosen nwaku configuration](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure.md)
:::tip
We recommend using explicit port mappings (`-p`) when exposing ports accessible from outside the host (libp2p listening ports, discovery, HTTP server).
:::
To run nwaku in a Docker container using the [default configuration](/guides/run-nwaku-node#run-the-node), run the following:
```bash
docker run -i -t -p 60000:60000 -p 8545:8545 statusteam/nim-waku
```
:::tip
The `docker run` command automatically pulls the specified image from Docker Hub if it is not already available locally.
:::

View File

@ -15,7 +15,7 @@ Before running a nwaku node, it is necessary to build it. Nwaku provides multipl
| Source Code | Build a `nwaku` node directly from the source code | [Build Nwaku from Source](/guides/nwaku/build-from-source) | | Source Code | Build a `nwaku` node directly from the source code | [Build Nwaku from Source](/guides/nwaku/build-from-source) |
| Precompiled Binary | Download a precompiled binary of the `nwaku` node | [Download Nwaku Binary](https://github.com/waku-org/nwaku/tags) | | Precompiled Binary | Download a precompiled binary of the `nwaku` node | [Download Nwaku Binary](https://github.com/waku-org/nwaku/tags) |
| Nightly Release | Try out the latest `nwaku` updates without compiling the binaries | [Download Nightly Release](https://github.com/waku-org/nwaku/releases/tag/nightly) | | Nightly Release | Try out the latest `nwaku` updates without compiling the binaries | [Download Nightly Release](https://github.com/waku-org/nwaku/releases/tag/nightly) |
| Docker Container | Build and run a `nwaku` node in a Docker Container | [Run Nwaku in Docker Container](https://github.com/waku-org/nwaku/blob/master/docs/operators/docker-quickstart.md) | | Docker Container | Build and run a `nwaku` node in a Docker Container | [Run Nwaku in Docker Container](/guides/nwaku/run-docker) |
| DigitalOcean Droplet | Build and run a `nwaku` node on a DigitalOcean Droplet | [Run Nwaku on DigitalOcean Droplet](https://github.com/waku-org/nwaku/blob/master/docs/operators/droplet-quickstart.md) | | DigitalOcean Droplet | Build and run a `nwaku` node on a DigitalOcean Droplet | [Run Nwaku on DigitalOcean Droplet](https://github.com/waku-org/nwaku/blob/master/docs/operators/droplet-quickstart.md) |
:::info :::info
@ -43,7 +43,7 @@ By default, a `nwaku` node is configured to do the following:
- Enable the `Relay` protocol for relaying messages. - 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. - Enable the `Store` protocol as a client, allowing it to query peers for historical messages but not store any message itself.
:::info :::tip
For more advanced configurations like enabling other protocols or maintaining a consistent `PeerID`, please refer to the [Configuration Methods](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure.md) guide. For more advanced configurations like enabling other protocols or maintaining a consistent `PeerID`, please refer to the [Configuration Methods](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure.md) guide.
::: :::
@ -57,7 +57,7 @@ To join the Waku Network, nodes must connect with peers. Nwaku provides multiple
| 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) | | 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) |
| 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) | | 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) |
:::info :::tip
You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously. You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously.
::: :::

View File

@ -20,7 +20,7 @@ For instance, if your dApp is called `SuperCrypto` and it allows users to receiv
- `/supercrypto/1/notification/proto` - `/supercrypto/1/notification/proto`
- `/supercrypto/1/private-message/proto` - `/supercrypto/1/private-message/proto`
:::info :::tip
While you can choose any encoding format for your `Content Topic`, we highly recommend using Protocol Buffers (`proto`) because of its efficiency. Choosing a lightweight format ensures optimal performance of your dApp. While you can choose any encoding format for your `Content Topic`, we highly recommend using Protocol Buffers (`proto`) because of its efficiency. Choosing a lightweight format ensures optimal performance of your dApp.
::: :::

View File

@ -62,6 +62,7 @@ const sidebars = {
}, },
items: [ items: [
"guides/nwaku/build-from-source", "guides/nwaku/build-from-source",
"guides/nwaku/run-docker",
] ]
}, },
], ],