πŸ—œ
Compile witnet-rust 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

GNU/Linux (apt)
Mac OS
1
apt install -y clang git libssl-dev protobuf-compiler librocksdb-dev pkg-config
Copied!
1
xcode-select --install
2
​
3
brew install git openssl protobuf rocksdb
Copied!

Clone source code from Witnet GitHub repository

HTTPS
SSH
GitHub CLI
1
git clone https://github.com/witnet/witnet-rust.git
2
cd witnet-rust
Copied!
1
git clone [email protected]:witnet/witnet-rust.git
2
cd witnet-rust
Copied!
1
gh repo clone witnet/witnet-rust
2
cd witnet-rust
Copied!

Get the latest genesis_block.json

cURL
wget
1
curl https://raw.githubusercontent.com/witnet/genesis_block/master/latest/genesis_block.json -o genesis_block.json
Copied!
1
wget https://raw.githubusercontent.com/witnet/genesis_block/master/latest/genesis_block.json
Copied!

Compile and run with cargo

By default, this line will run a Witnet node and connect to the Testnet using the default configuration:
1
cargo run node server
Copied!
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:
1
cargo build --release
Copied!
The resulting binary will be located at ./target/release/witnet.
Last modified 2mo ago