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?

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.
# SSH into your machine
(local)$ ssh [email protected]{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

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:
# Install build-essential
$ sudo apt-get install -y build-essential

Install Go

# Install go
$ wget https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
$ sudo tar -xvf go1.17.8.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

Validate your Go installation

Run your read node

You can run your read node using go-opera 1.1.1-rc.2 (either snap or full sync mode). Note that https and ws must not be enabled on a server that stores wallet account.
# Install Opera
(validator)$ git clone https://github.com/Fantom-foundation/go-opera.git
(validator)$ cd go-opera/
(validator)$ git checkout release/1.1.1-rc.2
(validator)$ make
Validate your Opera installation:
$./build/opera help
VERSION:
1.1.1-rc.2
Download a genesis file from this list of genesis files.
# Start opera node
(validator)$ cd build/
(validator)$ wget https://download.fantom.network/mainnet-109331-pruned-mpt.g
(validator)$ nohup ./opera --genesis mainnet-109331-pruned-mpt.g --nousb &
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.