InuX Dev
  • 🤝Introduction
  • Getting started
    • Blockchain Node
    • Prerequisites
  • Artela
    • Installation
    • State Sync
    • Useful Commands
  • 0g
    • Installation
    • Sync
    • Public
Powered by GitBook
On this page
  • Hardware Requirements
  • Software Requirements
  • Build Tools
  • Install Golang
  • Install Docker
  • Install Rust and Cargo
  • Install Node.js
  1. Getting started

Prerequisites

PreviousBlockchain NodeNextArtela

Last updated 1 year ago

Before you start the setup process, ensure that you have the following prerequisites:


Hardware Requirements

  • A dedicated server or VPS with sufficient resources (CPU, RAM, and storage) to run a Cosmos validator node.

  • Stable internet connection with adequate bandwidth.

Below are the hardware requirements for a Cosmos Hub validator

Node Type
RAM
Storage

Validator

32GB

500GB-2TB*

Full

16GB

2TB

Default

16GB

1TB


Software Requirements

At present, most of the validator software fully supports installation on Linux distributions. We recommend you to use Ubuntu 20.04.3 LTS or greater. Moreover, you need to install some additional software, depending on the requirements of the project you want to run the node. We will list some popular software below. All steps are listed below for a clean install.

Build Tools

sudo apt-get update

sudo apt install -y curl tar wget clang pkg-config libssl-dev jq build-essential git make lz4 unzip ncdu gcc

Install Golang

At the time of this writing, the latest release is 1.20.3. We're going to download the tarball, extract it to /usr/local, and export GOROOT to our $PATH

curl -OL https://go.dev/dl/go1.20.3.linux-amd64.tar.gz

sudo tar -C /usr/local -xvf https://go.dev/dl/go1.20.3.linux-amd64.tar.gz

export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/usr/local/go/bin

Install Docker

The Docker installation package available in the official Ubuntu repository may not be the latest version. To ensure we get the latest version, we’ll install Docker from the official Docker repository. To do that, we’ll add a new package source, add the GPG key from Docker to ensure the downloads are valid, and then install the package.

First, update your existing list of packages:

sudo apt update

Next, install a few prerequisite packages which let apt use packages over HTTPS:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then add the GPG key for the official Docker repository to your system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

This will also update our package database with the Docker packages from the newly added repo.

Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:

apt-cache policy docker-ce

You’ll see output like this, although the version number for Docker may be different:

Output of apt-cache policy docker-ce

docker-ce:
  Installed: (none)
  Candidate: 5:19.03.9~3-0~ubuntu-focal
  Version table:
     5:19.03.9~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 20.04 (focal).

Finally, install Docker:

sudo apt install docker-ce

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

â—Ź docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-05-19 17:00:41 UTC; 17s ago
TriggeredBy: â—Ź docker.socket
       Docs: https://docs.docker.com
   Main PID: 24321 (dockerd)
      Tasks: 8
     Memory: 46.4M
     CGroup: /system.slice/docker.service
             └─24321 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Install Rust and Cargo

On Linux and macOS systems, this is done as follows:

curl https://sh.rustup.rs -sSf | sh

It will download a script, and start the installation. If everything goes well, you’ll see this appear:

Rust is installed now. Great!

After this, you can use the rustup command to also install beta or nightly channels for Rust and Cargo.

Install Node.js

Option 1: Installing Node.js with Apt from the Default Repositories

Ubuntu 20.04 contains a version of Node.js in its default repositories that can be used to provide a consistent experience across multiple systems. At the time of writing, the version in the repositories is 10.19. This will not be the latest version, but it should be stable and sufficient for quick experimentation with the language.

Warning: the version of Node.js included with Ubuntu 20.04, version 10.19, is now unsupported and unmaintained. You should not use this version in production and should refer to one of the other sections in this tutorial to install a more recent version of Node.

To get this version, you can use the apt package manager. Refresh your local package index first:

sudo apt update

Then install Node.js:

sudo apt install nodejs

Check that the installation was successful by querying node for its version number:

node -v
v10.19.0

If the package in the repositories suits your needs, this is all you need to do to get set up with Node.js. In most cases, you’ll also want to also install npm, the Node.js package manager. You can do this by installing the npm package with apt:

sudo apt install npm

This allows you to install modules and packages to use with Node.js.

Option 2: Installing Node.js with Apt Using a NodeSource PPA

To install a different version of Node.js, you can use a PPA (personal package archive) maintained by NodeSource. These PPAs have more versions of Node.js available than the official Ubuntu repositories. Node.js v16 and v18 are available as of the time of writing.

First, install the PPA to get access to its packages. From your home directory, use curl to retrieve the installation script for your preferred version, making sure to replace 16.x with your preferred version string (if different):

cd ~
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
nano /tmp/nodesource_setup.sh

When you are satisfied that the script is safe to run, exit your editor. Then run the script with sudo:

sudo bash /tmp/nodesource_setup.sh

The PPA will be added to your configuration and your local package cache will be updated automatically. You can now install the Node.js package in the same way you did in the previous section:

sudo apt install nodejs

Verify that you’ve installed the new version by running node with the -v version flag:

node -v
v16.19.0

The NodeSource nodejs package contains both the node binary and npm, so you don’t need to install npm separately.

Option 3 — Installing Node Using the Node Version Manager

Another way of installing Node.js that is particularly flexible is to use nvm, the Node Version Manager. This piece of software allows you to install and maintain many different independent versions of Node.js, and their associated Node packages, at the same time.

Before piping the command through to bash, it is always a good idea to audit the script to make sure it isn’t doing anything you don’t agree with. You can do that by removing the | bash segment at the end of the curl command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh

Review the script and make sure you are comfortable with the changes it is making. When you are satisfied, run the command again with | bash appended at the end. The URL you use will change depending on the latest version of nvm, but as of right now, the script can be downloaded and executed with the following:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

This will install the nvm script to your user account. To use it, you must first source your .bashrc file:

source ~/.bashrc

Now, you can ask NVM which versions of Node are available:

nvm list-remote
Output. . .
        v18.0.0
        v18.1.0
        v18.2.0
        v18.3.0
        v18.4.0
        v18.5.0
        v18.6.0
        v18.7.0
        v18.8.0
        v18.9.0
        v18.9.1
       v18.10.0
       v18.11.0
       v18.12.0   (LTS: Hydrogen)
       v18.12.1   (LTS: Hydrogen)
       v18.13.0   (Latest LTS: Hydrogen)
        v19.0.0
        v19.0.1
        v19.1.0
        v19.2.0
        v19.3.0
        v19.4.0

It’s a very long list. You can install a version of Node by writing in any of the release versions listed. For instance, to get version v14.10.0, you can run:

nvm install v14.10.0

You can view the different versions you have installed by listing them:

nvm list
Output->     v14.10.0
       v14.21.2
default -> v14.10.0
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v14.21.2) (default)
stable -> 14.21 (-> v14.21.2) (default)
. . .

This shows the currently active version on the first line (-> v14.10.0), followed by some named aliases and the versions that those aliases point to.

Note: if you also have a version of Node.js installed through apt, you may receive a system entry here. You can always activate the system-installed version of Node using nvm use system.

Output
lts/* -> lts/hydrogen (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.2
lts/gallium -> v16.19.0 (-> N/A)
lts/hydrogen -> v18.13.0 (-> N/A)

You can install a release based on these aliases as well. For instance, to install the latest long-term support version, hydrogen, run the following:

nvm install lts/hydrogen
Output
Downloading and installing node v18.13.0...
. . .
Now using node v18.13.0 (npm v8.19.3)

You can switch between installed versions with nvm use:

nvm use v14.10.0

Copy

Output
Now using node v14.10.0 (npm v6.14.8)
```

You can verify that the install was successful using the same technique from the other sections:

```command
node -v
Output
v14.10.0

The correct version of Node is installed on your machine as expected. A compatible version of npm is also available.

We suggest the following two ways to install Go. Check out the and Go installer for the correct download for your operating system. Alternatively, you can install Go yourself from the command line. Detailed below are standard default installation locations, but feel free to customize.

Remember to add GOPATH to your $PATH environment variable. If you're not sure where that is, run go env GOPATH. This will allow us to run the gaiad binary in the next step. If you're not sure how to set your $PATH take a look at .

The easiest way to get Cargo is to install the current stable release of by using . Installing Rust using rustup will also install cargo.

For other installation options and information, visit the page of the Rust website.

Refer to the for more information on the available versions. Inspect the contents of the downloaded script with nano or your preferred text editor:

To install NVM on your Ubuntu 20.04 machine, visit . Copy the curl command from the README file that displays on the main page. This will get you the most recent version of the installation script.

Additionally, there are aliases for the various :

official docs
Go Binary Downloads
these instructions
Rust
rustup
install
NodeSource documentation
the project’s GitHub page
long-term support (or LTS) releases of Node
Update & install build tools
Go
Docker
Rust & Cargo
Node.js