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 SSD.

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

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.

For example, on Ubuntu use:

sudo apt install -y clang build-essential

On macOS, you can get a C compiler by running:

$ xcode-select --install

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 in directory /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 [flags] [options]

--staging

Connect the node to Gear testnet.

--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

For more information

Special environment variables

To run Gear node with logs from contracts use:

RUST_LOG="gwasm=debug" gear-node [flags]