Read-Only Node

How to run a Read-Only Node

Read-Only Nodes

Read-Only Nodes are nodes that do not participate in the consensus process. Instead, they connect to full nodes or the network's APIs to retrieve information from the blockchain.

Read-only nodes can be used for various purposes, such as querying transaction history, checking account balances, and monitoring network activity.

They are "read-only" because they cannot write or create new transactions on the blockchain; they can only read and display data.

You must install a read-only node before you can upgrade to a validator node!

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 500 GB of disk space. AWS m6i.2xlarge, c6i.4xlarge can provide better performance.

We would recommend going with Ubuntu Server 22.04 LTS (64-bit).

Network Settings

  • Open port 22 for SSH

  • Open port 5050 for both TCP and UDP traffic.

  • Open port 3000

  • Open port 4000

A custom port can be used with --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 root@{VALIDATOR_IP_ADDRESS}
# Update the system
(validator)$ sudo apt-get update && sudo apt-get upgrade -y
# Create a non-root user
(validator)$ USER={USERNAME}
(validator)$ sudo mkdir -p /home/$USER/.ssh
(validator)$ sudo touch /home/$USER/.ssh/authorized_keys
(validator)$ sudo useradd -d /home/$USER $USER
(validator)$ sudo usermod -aG sudo $USER
(validator)$ sudo chown -R $USER:$USER /home/$USER/
(validator)$ sudo chmod 700 /home/$USER/.ssh
(validator)$ sudo chmod 644 /home/$USER/.ssh/authorized_keys
  • For (validator)$ USER={USERNAME} write your non-root username.

  • 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
(validator)$ sudo vi /etc/sudoers

Add the following line to the end of the file:

{USERNAME} ALL=NOPASSWD: ALL
  • If this doesn't work for you, try sudo passwd nonrootusername

  • Not required in 22.04

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

# Close the root SSH connection
(validator)$ exit
# Log in as new user
(local)$ ssh {USERNAME}@{VALIDATOR_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
(validator)$ sudo apt-get install -y build-essential

Install Go

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

If that didn't work, you could also try:

# Install go
(validator)$ sudo snap install go --classic

Export the required Go paths:

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

If the final line did not work for you, try (validator)$ . ~/.bash_aliases instead.

Validate your Go installation

go version

Install Opera

# Install Opera
(validator)$ git clone https://github.com/VinuChain/VinuChain
(validator)$ cd VinuChain/
(validator)$ make

Validate your Opera installation

$./build/opera version
VERSION:
1.1.2-rc.3

Download Genesis File

A genesis file is a configuration file that contains the initial settings and parameters for the VinuChain network when it is launched.

The genesis file is a crucial component of any blockchain network, as it defines the initial state of the network, including information about the initial block, accounts, validators, and other network-specific parameters.

Drive: Genesis Files

You can download a genesis file from the Drive above, or from the following commands:

Mainnet:

# Download Mainnet genesis file
(validator)$ curl https://vinu-blockchain-mainnet-genesis.s3.us-east-1.amazonaws.com/vitainu-genesis-mainnet-with-contracts.g
--output vitainu-genesis-mainnet-with-contracts.g

Testnet:

# Download Testnet genesis file
(validator)$ curl https://vinu-blockchain-genesis.s3.us-east-1.amazonaws.com/vitainu-genesis-testnet.g 
--output vitainu-genesis-testnet.g

Start Opera Read-Only Node

First, start the Opera read-only node to interact with it and to create a validator wallet:

Mainnet:

# Start opera node (Mainnet)
(validator)$ cd build/
(validator)$ nohup ./opera --port 3000 --nat any 
--genesis ./GENESIS_FILENAME.g
--bootnodes enode://105ecea3fafaa01a329b9ce988d69ad7d9af233b04ad2c3b637b2f42862623c38f358bd7a7cfead5ae61991681965629abe2749131168bdd9ce573f8085380ab@node-0.vinuchain-rpc.com:3000
> opera.log &

Testnet:

# Start opera node (Testnet)
(validator)$ cd build/
(validator)$ nohup ./opera --port 3000 --nat any 
--genesis ./GENESIS_FILENAME.g --genesis.allowExperimental 
--bootnodes enode://c7e3e7ab29d1ee7693a11d1a6d019db543f71c428b0f323f082e9d13d10cc2d6cc11cdb1dd27e21746afeb0c48435d0f55ad01c2b89162fdac0d0f7c2f4744d0@54.203.151.219:3000
> opera.log &
  • Replace GENESIS_FILENAME with the actual Genesis file's filename you are using.

There are different ways to Run your read-only node.

Note that https and ws must not be enabled on a server that stores wallet account.

Starting up your node will look something like this:

The node should start to sync the network data:

Once it's running you should wait until it's synced up to the latest block.

A Read-Only Node can be upgraded into a Validator.

Last updated