Skip to main content

Setting Up Vara Node

Introduction

This guide covers the steps required to install and run the Vara node.

There are two ways to get started with the Vara node. First, download a pre-built binary file and run it. Second, compile the binary file and configure it manually. Using a ready-made build is a quick and convenient way to get started, as it skips the installation of Rust and all its dependencies and the node compiling process. Compiling the node from scratch may take about twenty minutes or more, depending on hardware.

System Requirements

Vara node requires at least 64 GB of free space on an SSD disk.

Install with Pre-built Binary

Depending on the operating system, download the latest release build of the node from https://get.gear.rs:

Terminal:

curl https://get.gear.rs/gear-v1.2.1-x86_64-unknown-linux-gnu.tar.xz | tar xJ

or

Linux x86-64: gear-v1.2.1-x86_64-unknown-linux-gnu.tar.xz

Run the node:

❯ ./gear --version
gear 1.2.1-a218853
info

Nightly builds are available if the latest features are needed: nightly builds.

Compile Node Manually

Compiling the build will take some time and requires the installation of some dependencies.

Note

Windows users may encounter some problems related to the installation of Rust components and dependencies. It is highly recommended to use Linux or macOS for compiling Vara node and programs.

Prerequisites

Linux users should generally install GCC and Clang, according to their distribution’s documentation. Additionally, the binaryen toolset, which contains the required wasm-opt tool, should be installed.

For example, on Ubuntu use:

sudo apt install -y clang build-essential binaryen cmake protobuf-compiler

On macOS, get a compiler toolset and binaryen by running:

xcode-select --install
brew install binaryen

Install Rust

If Rust is already installed, skip this step.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Reboot the terminal after installation.

Install Wasm Toolchains

rustup toolchain add nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

Clone Gear Repository

git clone https://github.com/gear-tech/gear.git
cd gear
# Checkout to the latest release tag
git checkout v1.2.1 -b release-1.2.1
info

To use the latest or experimental Gear Protocol's functions, compile the node from the master branch. It is the default branch after cloning, but switch back to the master branch using:

git checkout master

Compile

cargo build -p gear-cli --release

or

make node-release
note

The final build can be found at gear/target/release/gear.

Navigate to:

cd target/release

Run Vara Node

info

Regardless of whether the pre-built binary was downloaded or built manually, navigate to the directory where the node is installed and run it without special arguments to connect to the testnet:

./gear

To run the Vara node in dev mode:

./gear --dev

Command Flags and Options

gear [subcommand] [options]
  • --chain=testnet

    Connect the node to the test network (default option).

  • --chain=vara

    Connect the node to the Vara network.

  • --dev

    Run a local node in development mode for testing purposes. This node will not be connected to any external network and will store the state in temporary storage.

  • purge-chain

    Remove storage of the selected chain type. Specify the chain connection type --chain=testnet, --chain=vara, or --dev.

  • help, --help

    Print the available subcommands/options or the help of the given subcommand.

Special Environment Variables

To run the Vara node with logs from contracts:

RUST_LOG="gwasm=debug" gear [subcommand] [options]