Install Rusk from source
Rusk contains the software needed to run a Dusk node. Users can set specific compilation flags to configure their node for different roles, allowing it to perform tasks like participating in consensus, validating transactions, and storing historical data.
Rusk supports different feature setups:
- Provisioner: to stake and participates in consensus.
- Archive node: to store and serve historical data.
- Prover: to compute Zero-Knowledge Proofs.
The node software has been tested on x86-64/AMD64 and ARM architectures. The above node types have different hardware requirements, which can be found on their respective pages.
To install Rusk, you can either:
- Use the node installer (recommended)
- Build from source
- Use docker (not recommended for production environment)
Requirements
This page is tailored for Linux servers, if you are using another operating system you may encounter compatibility issues.
Build from source
The majority of Dusk software is written in Rust. To compile our code, we will first need to make sure it’s installed. Refer to Rustup on how to install Rust.
Other Software Requirements: To follow the next steps, you need to have the following software installed:: curl
, zip
, libssl-dev
, rustc
, clang
, gcc
and git
. These will be installed by the dev-setup script which is shown below
First to compile and run the Dusk node from source, run the following commands
Clone the Rusk repository. Make sure you modify the command to suit the branch you want to get. The command below will not necessarily fetch a branch compatible with the latest network release and specifications.
Make sure you follow these commands in sequence.
Run the setup script in the scripts folder of rusk, which can take care of dependencies.
Generate the keys used by the circuits:
Compile all the genesis contracts:
Then we compile the rusk binary, depending on the type of node you want, you will have to run a different command:
As provisioner
Or as archival
Or as prover only
After you compile your binary follow the setup below to complete the setup of your node
Setting up your node
After compiling we need to setup some configuration file and state for the particular network you are running the node for, for this example we’ll configure the node to run on dusk mainnet.
Now before building the node we need the following:
- The location of the rusk.toml configuration file
- The location of the database path
DUSK_CONSENSUS_KEYS_PASS
which is the password for your consensus keys- Base state of the mainnet
RUSK_STATE_PATH
path of our state
Let start by creating a ~/.dusk/rusk
at your home directory. This is where we’ll setup our node:
We’re now in our profile folder. Then we’ll copy the rusk binary we compiled into this folder
We’ll create a genesis.toml
file to specify our base state URL
this URL below is for mainnet
We’ll generate our state using our rusk binary we moved, make sure you add the --force
flag to override any existing state
We place our state in the mainnet_state
folder to keep it seperate
Lastly, we’ll setup our rusk.toml
file. In the toml file we’ll mention the consensus.keys file location and other parameters
The node installer sets up the rusk.toml file for you. An example for the file is located here in the node installer
We will copy that and add some entires which the node installer adds for you
We’ll set up the file for mainnet
To determine your public and listen address you can run this script used by the node installer https://github.com/dusk-network/node-installer/blob/main/bin/detect_ips.sh
Now we just need DUSK_CONSENSUS_KEYS_PASS
set:
After this we should be good, we run our node using the following command, make sure to specify your state URL
You should see the following in the terminal
This means you probably haven’t port forwarded yet, checkout below on how to do that
Networking
As Dusk uses an ultra-efficient P2P UDP network protocol called Kadcast, the network requirements are minimal but should maintain symmetrical, stable, low-latency connections.
For external network connectivity, ensure that your firewall and router’s ports are forwarded correctly:
- 9000/udp: Required for Kadcast consensus messages.
- 8080/tcp: Optional HTTPS API for querying the node.
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.