This implements a set of libp2p protocols aimed at private communication.
- Nim implementation of these specs.
- C library that exposes the implemented protocols.
- CLI application that allows you to run a logos-delivery node.
- Examples.
- Tests for all of the above.
For more details see the source code
These instructions are generic. For more detailed instructions, see the source code above.
Recommended and tested toolchain versions (these are installed when you follow the build instructions below):
- Nim 2.2.6: installed by Nimble from the
nimentry innimble.lock - Nimble:
make nimbleinstalls the pin fromlogos_delivery.nimble. Check it withnimble --version.
make runs the pinned Nimble itself. To use it in a shell:
export PATH="$(make print-nimble-path):$PATH"- The standard developer tools: a C/C++ compiler, GNU Make, Bash and Git.
- CMake.
- Rust (
rustcandcargo).
Some distributions (Fedora, for example) don't ship the
whichutility by default. The Makefile relies on it, so install it separately.
# The first `make` invocation will initialize the local dependency state.
make logosdeliverynode
# Build with custom compilation flags. Do not use NIM_PARAMS unless you know what you are doing.
# Replace with your own flags
make logosdeliverynode NIMFLAGS="-d:chronicles_colors:none -d:disableMarchNative"
# Run with DNS bootstrapping
./build/logosdeliverynode --dns-discovery-url=DNS_BOOTSTRAP_NODE_URL
# See available command line options
./build/logosdeliverynode --helpTo join the network, you need to know the address of at least one bootstrap node. Please refer to the Waku README for more information.
For more on running a node, refer to the guides below. They were written for nwaku and still use the old wakunode2 binary name:
If you encounter difficulties building the project on WSL, consider placing the project within WSL's filesystem, avoiding the /mnt/ directory.
- Git Bash Terminal: Download and install from https://git-scm.com/download/win
- MSYS2:
a. Download installer from https://www.msys2.org
b. Install at "C:" (default location). Remove/rename the msys folder in case of previous installation. c. Use the mingw64 terminal from msys64 directory for package installation.
Open MSYS2 mingw64 terminal and run the following one-by-one :
pacman -Syu --noconfirm
pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain
pacman -S --noconfirm --needed base-devel make cmake
pacman -S --noconfirm --needed mingw-w64-x86_64-cmake
pacman -S --noconfirm --needed mingw-w64-x86_64-rust
pacman -S --noconfirm --needed mingw-w64-x86_64-postgresql
pacman -S --noconfirm --needed mingw-w64-x86_64-zlib
pacman -S --noconfirm --needed mingw-w64-x86_64-openssl
pacman -S --noconfirm --needed mingw-w64-x86_64-python
pacman -S --noconfirm --needed mingw-w64-x86_64-nasmOn Windows, make installs the pinned Nimble from its prebuilt release and lets Nimble install Nim during dependency setup, so no Nim needs to be on PATH.
Verify before building:
which gcc g++ make cmake cargo rustc python nasm- Open Git Bash as administrator
- clone the repository and cd into it
- Execute:
./scripts/build_windows.sh - Pass a target to build only one, for example
./scripts/build_windows.sh liblogosdelivery. CI runs this same script.
If logosdeliverynode.exe or liblogosdelivery isn't generated:
- Missing Dependencies: Verify with:
which make cmake gcc g++ rustc cargo python nasm
If missing, revisit Step 2 or ensure MSYS2 is atC:\ - Installation Conflicts: Remove existing MinGW/MSYS2/Git Bash installations and perform fresh install
The first make run installs Nim into ~/.nim/nim-<version> (linked from ~/.nimble/bin) unless the right version is already on PATH, and installs the project dependencies into nimbledeps/pkgs2.
# Run all the tests
make test
# Run a specific test file
make test <test_file_path>
# e.g. : make test tests/app/test_all.nim
# Run a specific test name from a specific test file
make test <test_file_path> <test_name>
# e.g. : make test tests/app/test_all.nim "node setup is successful with default configuration"make test <file> builds the file to build/<file>.bin and runs it. To re-run it without rebuilding, run the binary directly:
make test tests/common/test_enr_builder.nim
./build/tests/common/test_enr_builder.nim.binRefer to logos-delivery-js repo for instructions.
Nim files are expected to be formatted using nph. make build-nph installs one if it is not already on your PATH.
To format a single file, run make nph/<path to the .nim file>.
For example:
make nph/logos_delivery/waku/waku_core.nim
A pre-commit hook is provided to format staged files at commit time. Run the following command to install it:
make install-nphExamples can be found in the examples folder.
The chat apps (chat2, chat2mix, chat2bridge) live in apps.
Tools such as wakucanary, networkmonitor and liteprotocoltester live in the apps folder, each with its own README. tools/rln_keystore_generator holds the RLN keystore generator.
For an inquiry, or if you would like to propose new features, feel free to open a general issue.
For bug reports, please tag your issue with the bug label.
If you believe the reported issue requires critical attention, please use the critical label to assist with triaging.
To get help, or participate in the conversation, join the Logos Discord server.