Skip to main content

Setting Up Gear Node

Introduction

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

There are two ways to get started with the Gear node. First, you can download a pre-built binary file and run it, or second, you can compile the binary file and configure it by yourself. Using a ready-made build is a quick and convenient way to get started as you can skip the installation of Rust and all its dependencies and you can also skip the node compiling process. On the other hand, if you decide that you want to go through the process of creating your development node, it may take about twenty minutes or more depending on your hardware.

info

System requirements:

Gear node doesn't have any special hardware requirements excepting at least 64 Gbytes of free space on the SSD disk.

Install with pre-build binary

Depending on your OS you need to download nightly build of Gear node:

Terminal:

curl -O https://builds.gear.rs/gear-nightly-windows-x86_64.zip

or

Windows x64: gear-nightly-windows-x86_64.zip

Unzip the downloaded package then you can try to run the node:

❯ gear-node.exe --version
gear-node 0.1.0-hashcode-x86_64-windows

Compile Gear node by yourself

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

Prerequisites

Linux users should generally install GCC and Clang, according to their distribution’s documentation. Also, one should install binaryen toolset that contains required wasm-opt tool.

For example, on Ubuntu use:

sudo apt install -y clang build-essential binaryen

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

xcode-select --install
brew install binaryen

Install Rust:

If you already have Rust installed, you can skip this step.

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

And then you should reboot your terminal.

Install WASM Toolchains:

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

Clone Gear repo

git clone https://github.com/gear-tech/gear.git
cd gear

Compile

cargo build -p gear-node --release

or

make node-release
note

You can find the final build at the following location: gear/target/release/gear-node

Go to:

cd target/release

Run Gear Node

info

It doesn't matter if you downloaded the prebuild binary or built it yourself. Being in the directory where the gear node is installed to run it without special arguments to get a node connected to the testnet:

./gear-node

To run Gear node in dev mode use the following command:

./gear-node --dev --tmp

Command Flags and Options

gear-node [subcommand] [options]
  • --staging

    Connect the node to Gear testnet (default option).

  • --dev

    Run standalone node of Gear network.

  • --tmp

    Run node with a temporary storage. A temporary directory will be created to store the configuration and will be deleted at the end of the process.

  • purge-chain

    Remove storage of the selected chain type. Needs to specify the chain connection type --staging or --dev

  • help, --help

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

Special environment variables

To run Gear node with logs from contracts use:

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