Getting Started
Build from source code

Introduction

This guide will help you build the XELIS software from the source code.

The software is divided into three parts:

  • Daemon: the core part of the software that manages the blockchain and the network.
  • Wallet: the graphical interface that allows you to manage your accounts and transactions.
  • Miner: the part of the software that allows you to mine new blocks and earn rewards.

Building the software from the source code is useful for developers, testers, and users who want to have the latest version of the software or want to contribute to the project. It is also the most secure way to get the software as you can verify the source code before building it and remove the need to trust pre-built binaries.

This guide assumes that you have a basic understanding of the command-line interface (CLI) and that you have the necessary tools installed on your device.

How to build from sources

Install Git (if not already installed)

Official Git installation guide at https://git-scm.com/downloads (opens in a new tab).

This software allows you to clone the project directly on your device.

Install Rust and Cargo (if not already installed)

Official Rust installation guide at https://www.rust-lang.org/tools/install (opens in a new tab).

Rust is the programming language used by XELIS.

It is a compiled language that needs its toolchain to produce binaries from sources to work on your device.

Cargo is the package manager of Rust and allows for easier build, dependencies managements and much more.

Clone the blockchain repository

Open your operating system's command-line interface (CLI) and download the source code using Git.

git clone https://github.com/xelis-project/xelis-blockchain

This will create a local copy of the source code in a folder named xelis-blockchain.

Navigate to the repository

Navigate to the repository using the following command:

cd xelis-blockchain

Build the project with Cargo

You have two ways to build the project into binaries: with or without optimizations. Without optimizations will check for overflows, panics, and other issues that can be useful for debugging. It is designed to be used for development purposes only.

For production usage, it is recommended to build with optimizations enabled.

Build all binaries

To build all parts (daemon, wallet, miner) with optimizations enabled (highly recommended for production usage), use:

cargo build --release

For developers and testing purposes, you can build in debug mode by removing the --release option from above command.

After building the binaries, you can find them in ./target/release (or in ./target/debug if you built in debug mode).

Build a specific binary

To build a specific part of the project, you can use the following command:

cargo build --release --bin xelis_daemon

This will build only the daemon part of the project and can be replaced by xelis_wallet or xelis_miner to build the wallet or miner part.

Once the binary has been built, you can find it in ./target/release (or in ./target/debug if you built in debug mode).

Run from source code

You can also run directly from source code a specific package (xelis_daemon, xelis_wallet, xelis_miner) with following command:

cargo run --bin xelis_daemon --release

You can also run it in debug mode by removing the --release option from above command.

Run it

💡

for a production usage, it is recommended to build the software using --release option.

Now that you have successfully built the software, see Configuration.