Build Dependencies

Before setting up your node, you need to prepare a machine that have installed dependencies.

Network settings

These following ports must be exposed to the public internet:

  • Port 22: for SSH

  • Port 5050: for TCP and UDP traffic

  • A custom port can be used with --port <port> flag when run your node.

Set up non-root user

If there is already a non-root user available, you can skip this step.

# SSH into your machine
(local)$ ssh root@{IP_ADDRESS}
# Update the system
$ sudo apt-get update && sudo apt-get upgrade -y
# Create a non-root user
$ USER={USERNAME}
$ sudo mkdir -p /home/$USER/.ssh
$ sudo touch /home/$USER/.ssh/authorized_keys
$ sudo useradd -d /home/$USER $USER
$ sudo usermod -aG sudo $USER
$ sudo chown -R $USER:$USER /home/$USER/
$ sudo chmod 700 /home/$USER/.ssh
$ sudo chmod 644 /home/$USER/.ssh/authorized_keys

Make sure to paste your public SSH key into the authorized_keys file of the newly created user in order to be able to log in via SSH.

# Enable sudo without password for the user
$ sudo vi /etc/sudoers

Add the following line to the end of the file:

{USERNAME} ALL=NOPASSWD: ALL

Now close the root SSH connection to the machine and log in as your newly created user:

# Close the root SSH connection
$ exit
# Log in as new user
(local)$ ssh {USERNAME}@{IP_ADDRESS}

Install required tools

First, install the required build tools:

# Install build-essential
$ sudo apt-get install -y build-essential

Then install Go:

# Install go
$ wget <https://go.dev/dl/go1.19.3.linux-amd64.tar.gz>
$ sudo tar -xvf go1.19.3.linux-amd64.tar.gz
$ sudo mv go /usr/local

Export the required Go paths:

# Export go paths
$ vi ~/.bash_aliases
# Append the following lines
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Finally, validate your Go installation by checking its version:

$ go version
go version go1.19.3 linux/amd64

Last updated