Run a Read-only node

Read-only node parameters

  • Minimum hardware requirements: AWS EC2 m5.xlarge with 4 vCPUs (3.1 GHz) and at least 4.5 TB of Amazon EBS General Purpose SSD (gp2) storage (or equivalent or better).

What are we going to do?

  1. 1.
    ​Launch Cloud Instance​
  2. 2.
    ​Set up Non-Root User​
  3. 3.
    ​Install Required Tools​

Launch Cloud Instance

You can either run a node on your own hardware or use a cloud provider. We would recommend choosing one of the big cloud providers, e.g. Amazon AWS.

Node Specifications

We recommend the following or better: m5.xlarge General Purpose Instance with 4 vCPUs (3.1 GHz), 16GB of memory, up to 10 Gbps network bandwidth, and at least 4.5 TB of disk space.
We would recommend going with Ubuntu Server 20.04 LTS (64-bit). Storage 4.5 TB is needed if you're running with a full size datadir. Alternatively, 1.5TB is sufficient if you're running using a pruned datadir. Available snapshots for download: link.

Network Settings

Open up port 22 for SSH, as well as port 5050 for both TCP and UDP traffic. A custom port can be used with "--port <port>" flag when run your opera node.

Set up Non-Root User

If there is already a non-root user available, you can skip this step.
1
# SSH into your machine
2
(local)$ ssh [email protected]{IP_ADDRESS}
3
# Update the system
4
$ sudo apt-get update && sudo apt-get upgrade -y
5
# Create a non-root user
6
$ USER={USERNAME}
7
$ sudo mkdir -p /home/$USER/.ssh
8
$ sudo touch /home/$USER/.ssh/authorized_keys
9
$ sudo useradd -d /home/$USER $USER
10
$ sudo usermod -aG sudo $USER
11
$ sudo chown -R $USER:$USER /home/$USER/
12
$ sudo chmod 700 /home/$USER/.ssh
13
$ sudo chmod 644 /home/$USER/.ssh/authorized_keys
Copied!
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.
1
# Enable sudo without password for the user
2
$ sudo vi /etc/sudoers
Copied!
Add the following line to the end of the file:
1
{USERNAME} ALL=NOPASSWD: ALL
Copied!
Now close the root SSH connection to the machine and log in as your newly created user:
1
# Close the root SSH connection
2
$ exit
3
# Log in as new user
4
(local)$ ssh {USERNAME}@{IP_ADDRESS}
Copied!

Install Required Tools

You are still logged in as the new user via SSH. Now we are going to install Go and Opera.
First, install the required build tools:
1
# Install build-essential
2
$ sudo apt-get install -y build-essential
Copied!

Install Go

1
# Install go
2
$ wget https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
3
$ sudo tar -xvf go1.17.8.linux-amd64.tar.gz
4
$ sudo mv go /usr/local
Copied!
Export the required Go paths:
1
# Export go paths
2
$ vi ~/.bash_aliases
3
# Append the following lines
4
export GOROOT=/usr/local/go
5
export GOPATH=$HOME/go
6
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
Copied!

Validate your Go installation

Run your read node

You can run your read node using go-opera 1.1.0-rc.4 (full sync mode), or using go-opera 1.1.1-rc.1 (either snap or full sync mode).

First approach

1
# Install Opera
2
$ git clone https://github.com/Fantom-foundation/go-opera.git
3
$ cd go-opera/
4
$ git checkout release/1.1.0-rc.4
5
$ make
Copied!
Validate your Opera installation:
1
$./build/opera help
2
​
3
VERSION:
4
1.1.0-rc.4
Copied!
If you are running a read node or API node or a validator node, you can use go-opera version release/1.1.0-rc.4.
Start the Opera read-only node using old genesis file 'mainnet.g'.
1
# Start opera node
2
(validator)$ cd build/
3
(validator)$ wget https://download.fantom.network/mainnet.g
4
(validator)$ nohup ./opera --genesis mainnet.g --nousb &
Copied!

Second approach

1
# Install Opera
2
(validator)$ git clone https://github.com/Fantom-foundation/go-opera.git
3
(validator)$ cd go-opera/
4
(validator)$ git checkout release/1.1.1-rc.1
5
(validator)$ make
Copied!
Validate your Opera installation:
1
$./build/opera help
2
​
3
VERSION:
4
1.1.1-rc.1
Copied!
Download a genesis file from this list of genesis files.
1
# Start opera node
2
(validator)$ cd build/
3
(validator)$ wget https://download.fantom.network/mainnet-109331-pruned-mpt.g
4
(validator)$ nohup ./opera --genesis mainnet-109331-pruned-mpt.g --nousb &
Copied!
You can start a node with a syncmode flag. There are two possible options:
  • "--syncmode snap", and
  • "--syncmode full" (by default).
For archive node and validator node, you should use full syncmode.
​