Skip to content

🗜️ Compile from Source Code ​

Install compilation dependencies ​

Rust ​

witnet-rust is being developed using the Rust programming language. You need to install Rust on your system to be able to compile the source code. Follow installation instructions for your operating system provided on rustup.rs

Compilation dependencies ​

bash
  apt install -y clang git libssl-dev protobuf-compiler librocksdb-dev pkg-config

Clone source code from Witnet GitHub repository ​

bash
git clone https://github.com/witnet/witnet-rust.git
cd witnet-rust

Get the latest genesis_block.json ​

bash
  curl https://raw.githubusercontent.com/witnet/genesis_block/master/latest/genesis_block.json -o genesis_block.json

Compile and run with cargo ​

By default, this line will run a Witnet node and connect to the Testnet using the default configuration:

bash
  cargo run node server

For more witnet-rust commands you can read the witnet-rust CLI documentation.

Building a release ​

This one-liner will build a releasable standalone binary compatible with the architecture of your computer's processor:

bash
  cargo build --release

The resulting binary will be located at ./target/release/witnet.