LogoLogo
WebsiteDiscordTelegramTwitter
  • 🏠Witnet Oracle Docs
  • Introduction
    • ❓What is Witnet?
      • ⚙️Oracle Architecture
      • 🪙The Witnet Coin (Wit)
      • 👛Wallets
      • 🤔Frequently Asked Questions
      • 😎Awesome Witnet
    • 🚀Quick Tutorials
      • 📈Price Feeds
      • 🎲Randomness
      • 🌐APIs and HTTP GET/POST
      • ⛏️Mining Wit
  • Smart contracts developers
    • ⛓️Supported chains
    • 🔮Wit/Oracle
      • HTTP GET Requests in Solidity
      • HTTP POST Requests in Solidity
      • Query GraphQL APIs in Solidity
      • Dynamic Requests in Solidity
      • UsingWitnet Inheritance
      • API Reference
        • Solidity API
          • Solidity Contracts
            • WitnetRequestBoard
        • Javascript API
        • RADON API
          • RADON Type System
          • RADON Errors
      • Multi-chain Addresses
    • 💹Wit/Price Feeds
      • How To Use Witnet Price Feeds
      • Update Conditions
      • Code Examples
      • API Reference
      • Multi-chain Addresses
        • Arbitrum Price Feeds
        • Avalanche Price Feeds
        • Base Price Feeds
        • Boba Price Feeds
        • Celo Price Feeds
        • Conflux Price Feeds
        • Cronos Price Feeds
        • Dogechain Price Feeds
        • Elastos Price Feeds
        • Ethereum Price Feeds
        • Gnosis Chain Price Feeds
        • Kaia Price Feeds
        • Kava Price Feeds
        • KCC Price Feeds
        • Mantle Price Feeds
        • Meter Price Feeds
        • Metis Price Feeds
        • Moonbeam Price Feeds
        • OKX Price Feeds
        • Optimism Price Feeds
        • Polygon Price Feeds
        • Reef Price Feeds
        • Scroll Price Feeds
        • Syscoin Price Feeds
        • Ultron Price Feeds
        • Request new price feed or chain support
    • 🎲Wit/Randomness
      • Generating Randomness
      • WitnetRandomness Contract
      • Low-level Requests
      • Code Examples
      • API Reference
      • Multi-chain Addresses
    • 🏗️Guides
      • 📖Solidity Contracts
        • Appliances
          • 📃WitnetPriceFeeds
          • 📃WitnetRandomness
        • Core
          • 📃WitnetOracle
          • 📃WitnetRadonRegistry
          • 📃WitnetRequest
          • 📃WitnetRequestFactory
          • 📃WitnetRequestTemplate
        • Mockups
          • 📃UsingWitnet
          • 📃UsingWitnetRandomness
          • 📃UsingWitnetRequest
          • 📃UsingWitnetRequestTemplate
          • 📃WitnetRandomnessRequestConsumer
          • 📃WitnetRequestConsumer
          • 📃WitnetRequestTemplateConsumer
      • 🧙Solidity Wizard
    • 🎓Tutorials
      • Building a Satoshi/Wei custom price feed
  • Witnet SDK
    • 👋Introduction
    • 🚀Getting Started
    • 🏗️How-to Guides
      • Connect to a Wit/RPC provider
      • Query stake entries in Witnet
      • Manage Witnet wallets
      • Manage Witnet UTXOs
      • Manage Witnet transactions
    • 🎓Tutorials
    • 📚Reference Material
      • 🔌APIs
        • Wit/Node JSON-RPC API
  • Witnet Validators
    • 💻Node Requirements
    • 🚀Getting Started (Docker)
    • 🔎Next steps
    • 🤓Advanced Setups
      • Run node as a systemd service
      • Run node with docker compose
      • Paranoid mode (Witnet over proxies and Tor)
      • Configuration file
    • ⌨️CLI Reference
  • 🗜️Compile from Source Code
Powered by GitBook
On this page
  • Install compilation dependencies
  • Rust
  • Compilation dependencies
  • Clone source code from Witnet GitHub repository
  • Get the latest genesis_block.json
  • Compile and run with cargo
  • Building a release

Was this helpful?

Edit on GitHub

Compile from Source Code

PreviousCLI Reference

Last updated 2 months ago

Was this helpful?

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

Compilation dependencies

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

brew install git openssl protobuf rocksdb

Clone source code from Witnet GitHub repository

git clone https://github.com/witnet/witnet-rust.git
cd witnet-rust
git clone [email protected]:witnet/witnet-rust.git
cd witnet-rust
gh repo clone witnet/witnet-rust
cd witnet-rust

Get the latest genesis_block.json

  curl https://raw.githubusercontent.com/witnet/genesis_block/master/latest/genesis_block.json -o genesis_block.json
  wget https://raw.githubusercontent.com/witnet/genesis_block/master/latest/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:

  cargo run node server

Building a release

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

  cargo build --release

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

For more witnet-rust commands you can read the .

🗜️
rustup.rs
witnet-rust CLI documentation