add nwaku build source guide

This commit is contained in:
LordGhostX 2023-06-14 04:34:58 +01:00
parent 98b4d6ec2e
commit 749c3349fe
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7
9 changed files with 131 additions and 13 deletions

View File

@ -41,7 +41,8 @@
"Thorén",
"wakunode",
"autoplay",
"classwide"
"classwide",
"devel"
],
"flagWords": [],
"ignorePaths": [

View File

@ -0,0 +1,107 @@
---
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.
:::info
Nwaku can be built and run on Linux and macOS, while Windows support is currently experimental.
:::
## Prerequisites
- 2GB of RAM
- [Git](https://git-scm.com/) or [GitHub Desktop](https://desktop.github.com/)
- [Nim](https://nim-lang.org/) installed on your system
## Install Dependencies
#### Linux
To install the dependencies on common Linux distributions, run the following:
```mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
```
<Tabs>
<TabItem value="debian" label="Debian and Ubuntu">
```bash
sudo apt-get install build-essential git
```
</TabItem>
<TabItem value="fedora" label="Fedora">
```bash
dnf install @development-tools
```
</TabItem>
<TabItem value="arch" label="Arch Linux">
```bash
# using your favorite AUR helper
yourAURhelper -S base-devel
```
</TabItem>
</Tabs>
#### macOS
If you use [Homebrew](https://brew.sh/) to manage packages, run the following:
```bash
brew install cmake
```
## Clone the Repository
Get the source code from the GitHub repository. The default branch is `master`, the release candidate for major updates.
```bash
git clone https://github.com/waku-org/nwaku
cd nwaku
```
:::info
You can use `git tag -l` to check specific version tags.
:::
## Build the Binary
To build the nwaku binary, run the following:
```bash
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.
```bash
make update wakunode2
```
## Run the Binary
Nwaku will create the `wakunode2` binary in the `./build/` directory.
```bash
./build/wakunode2
```
To learn more about running nwaku, please refer to:
- [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 on DigitalOcean Droplet](https://github.com/waku-org/nwaku/blob/master/docs/operators/droplet-quickstart.md)
## Run Test Suite
To run the tests for both `Waku v1` and `Waku v2`, run the following:
```bash
make test
```

View File

@ -8,11 +8,11 @@ This guide provides detailed steps to build, configure, and connect a `nwaku` no
## Build the Node
Before running a Nwaku node, it is necessary to build it. Nwaku provides multiple options for building a node:
Before running a nwaku node, it is necessary to build it. Nwaku provides multiple options for building a node:
| | Description | Documentation |
| - | - | - |
| Source Code | Build a `nwaku` node directly from the source code | [Build Nwaku from Source](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/build.md) |
| 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) |
| 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) |

View File

@ -4,12 +4,12 @@ title: Discv5
`Discv5` is a decentralized and efficient peer discovery mechanism for the Waku Network. It uses a [Distributed Hash Table (DHT)](https://en.wikipedia.org/wiki/Distributed_hash_table) for storing `ENR` records, providing resistance to censorship. `Discv5` offers a global view of participating nodes, enabling random sampling for load distribution. It uses bootstrap nodes as an entry point to the network, providing randomized sets of nodes for mesh expansion. Please refer to the [Discv5](https://rfc.vac.dev/spec/33/) specification to learn more.
## Pros
#### Pros
- Decentralized with random sampling from a global view.
- Continuously researched and improved.
## Cons
#### Cons
- Requires lots of connections and involves frequent churn.
- Relies on User Datagram Protocol (UDP), which is not supported in web browsers.

View File

@ -6,13 +6,13 @@ Built upon the foundation of [EIP-1459: Node Discovery via DNS](https://eips.eth
This bootstrapping method allows anyone to register and publish a domain name for the network, promoting increased decentralization.
## Pros
#### Pros
- Low latency, low resource requirements.
- Easy bootstrap list updates by modifying the domain name, eliminating the need for code changes.
- Ability to reference a larger list of nodes by including other domain names in the code or ENR tree.
## Cons
#### Cons
- Vulnerable to censorship: Domain names can be blocked or restricted.
- Limited scalability: The listed nodes are at risk of being overwhelmed by receiving all queries. Also, operators must provide their `ENR` to the domain owner for listing.

View File

@ -4,12 +4,12 @@ title: Peer Exchange
The primary objective of this protocol is to facilitate peer connectivity for resource-limited devices. The peer exchange protocol enables lightweight nodes to request peers from other nodes within the network. Light nodes can bootstrap and expand their mesh independently without relying on `Discv5`. Please refer to the [Peer Exchange](https://rfc.vac.dev/spec/34/) specification to learn more.
## Pros
#### Pros
- Low resource requirements.
- Decentralized with random sampling of nodes from a global view using `Discv5`.
## Cons
#### Cons
- Decreased anonymity.
- Imposes additional load on responder nodes.

View File

@ -4,12 +4,12 @@ title: Predefined Nodes
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.
## Pros
#### Pros
- Low latency.
- Low resource requirements.
## Cons
#### Cons
- Vulnerable to censorship: Node IPs can be blocked or restricted.
- Limited scalability: The number of nodes is fixed and cannot easily be expanded.

View File

@ -15,7 +15,7 @@ Waku protocols ensure that users communication remains censorship-resistant and
The Waku family of protocols is designed for diverse applications due to their properties, such as:
### Generalized Messaging
### Generalized
Waku aims to solve the problem of ephemeral messaging between subsystems and nodes through a flexible, secure, and private protocol. It supports human-to-human and machine-to-machine messaging scenarios but is not designed for data storage.

View File

@ -53,7 +53,17 @@ const sidebars = {
],
guides: [
"guides/nodes-and-sdks",
"guides/run-nwaku-node",
{
type: "category",
label: "Run a Nwaku Node",
link: {
type: "doc",
id: "guides/run-nwaku-node",
},
items: [
"guides/nwaku/build-from-source",
]
},
],
community: [
"powered-by-waku",