Build from Source
What You’ll Need
- A Linux Operating System: This guide is tailored for Linux users. If you’re using another operating system, you might run into issues.
- An Internet Connection: Ensure you can download files and communicate to other nodes on the target device.
- Firewall Access: Dusk’s networking protocol, Kadcast, uses UDP to communicate among nodes. If you want your node to connect to an external network, ensure that your firewall and router’s UDP ports are forwarded correctly. The default configuration targets port 9000.
- Software Prerequisites: You’ll need the following software installed to follow this guide:
curl
,zip
,libssl-dev
,rustc
,clang
,gcc
andgit
.
Step-by-Step Instructions
1. Setting up the Environment
1.1 Install the Rust Programming Language
The majority of Dusk software is written in Rust. To compile our code, we will first need to make sure it’s installed.
Open a terminal and run the following command to see if Rust is available:
If this returns a command not found
error, we’ll need to install and activate Rust.
Run the following command to download and install Rust:
1.2 Install Clang
Clang is necessary to compile the internal database of the node, RocksDB.
- For Ubuntu/Debian:
- For Arch:
- For CentOS/RHEL:
1.3 Install git
Git is a version control system. We will use it to download the Node code.
- For Ubuntu/Debian:
- For Arch:
- For CentOS/RHEL:
2. Compiling the Dusk node
2.1 Download the Node Software
Clone the Rusk repository:
Build the node:
2.2 Run a single-node cluster with example’s data
Create a new directory and copy the example consensus keys to it. In a production environment, you would put your own consensus keys here.
Create the Genesis state according to your local examples/genesis.toml
. See the examples.toml
for configuration options you can set in terms of stakes and balances on network initialization.
Run ephemeral node
Run persistent node
Delete any leftover in state/chain
Note that the password
used here is connected to the example consensus keys, which are also defined in the examples/genesis.toml
.
Troubleshooting Tips
- Installation Issues: Ensure your operating system is up-to-date, you have adequate permissions and all the necessary prerequisite software is installed.
- Network Errors: Check your internet connection and verify UDP ports are open if connecting to an external network.