July 2, 2022

How To Run an Oasis Emerald ParaTime Node

Prerequisites

ulimit -n 102400

Then as root, create a file in /etc/security/limits.d/99-oasis-node.conf with content similar to the following example:

*        soft    nofile    102400
*        hard    nofile    1048576

And we should create oasis user

adduser --system oasis --shell /usr/sbin/nologin

Install Oasis Node Binary

The easyest way is to download it from GitHub. Go to Oasis Mainnet Parameters and find last version of Oasis Core.

Download it and extract:

cd $HOME
wget -O oasis_core.tar.gz https://github.com/oasisprotocol/oasis-core/releases/download/v22.1.11/oasis_core_22.1.11_linux_amd64.tar.gz
tar -xvf oasis_core.tar.gz

After this we should make binary accessible:

mv $HOME/oasis_core_22.1.11_linux_amd64/oasis-node /usr/local/bin
oasis-node -v

Run a Non-validator Node

Create emerald directory for all, that works in emerald:

mkdir /home/oasis/emerald
cd /home/oasis/emerald

Create a Working Directory files:

mkdir -m700 -p /home/oasis/emerald/{etc,data}

Copy genesis file:

wget -O /home/oasis/emerald/etc/genesis.json https://github.com/oasisprotocol/mainnet-artifacts/releases/download/2022-04-11/genesis.json

Changes for Emerald Paratime Client Node

Create additional directories:

mkdir -m700 -p /home/oasis/emerald/{bin,runtimes}

Install Bubblewrap Sandbox:

sudo apt install bubblewrap

Download latest Bundle:

wget -O /home/oasis/emerald/runtimes/emerald-paratime-8.2.0.orc https://github.com/oasisprotocol/emerald-paratime/releases/download/v8.2.0/emerald-paratime.orc

Create config file:

touch /home/oasis/emerald/etc/config.yml
nano /home/oasis/emerald/etc/config.yml

Then you should write correct config file:

datadir: /home/oasis/emerald/data

log:
  level:
    default: info
    tendermint: info
    tendermint/context: error
  format: JSON
 
genesis:
  file: /home/oasis/emerald/etc/genesis.json
 
consensus:
  tendermint:
    p2p:
      # List of seed nodes to connect to.
      # NOTE: You can add additional seed nodes to this list if you want.
       seed:
         - "E27F6B7A350B4CC2B48A6CBE94B0A02B0DCB0BF3@35.199.49.168:26656"
 
runtime:
  mode: client
  paths:
      # Paths to ParaTime bundles for all of the supported ParaTimes.
      - /home/oasis/emerald/runtimes/emerald-paratime-8.2.0.orc

Starting the Oasis Node

Create service file:

cd $HOME
touch emerald.service
nano emerald.service

There you should write this content:

[Unit]
Description=Emerald Node

[Service]
User=oasis
ExecStart=/usr/local/bin/oasis-node --config /home/oasis/emerald/etc/config.yml --worker.registration.force_register --log.level debug
LimitNOFILE=102400

[Install]
WantedBy=multiuser.target

Move it to systemctl

mv emerald.service /etc/systemd/system/

Starting your node:

chown -R oasis /home/oasis
systemctl daemon-reload
systemctl enable emerald
systemctl restart emerald