waku.guide/docs/guides/nwaku/build-from-source.md
2023-06-14 04:34:58 +01:00

107 lines
2.4 KiB
Markdown

---
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
```