EOSIO Node
We are going to use what's known as a SHIP node. This node will expose the state history web socket to monitor on chain activity and it will not produce blocks.
For nodeos's documentation head over to b1's dev docs here​
If you prefer Kubernetes, checkout our dapp dsp k8s repo: https://github.com/liquidapps-io/dapp-dsp-k8s​
Minimum requirements for nodeos:
Though you will want more than this to run a testnet nodeos instance, and significantly more to handle the EOS mainnet or other mainnets.
Chain resource analysis for Mainnet/Kylin: https://docs.dfuse.io/eosio/admin-guide/system-requirements/​
This may also provide some context for resource requirements: https://github.com/EOSChronicleProject/chronicle-tutorial/blob/master/01_nodeos_server_setup.md​
​

Prerequisites

  • jq
  • wget
  • curl

Get EOSIO binary

1
# nodeos versions 1.8+ and 2.0+ are supported
2
VERSION=2.0.13
Copied!

Ubuntu 18.04

1
FILENAME=eosio_$VERSION-1-ubuntu-18.04_amd64.deb
2
INSTALL_TOOL=apt
Copied!

Ubuntu 16.04

1
FILENAME=eosio_$VERSION-1-ubuntu-16.04_amd64.deb
2
INSTALL_TOOL=apt
Copied!

Fedora

1
FILENAME=eosio_$VERSION-1.fc27.x86_64.rpm
2
INSTALL_TOOL=yum
Copied!

Centos

1
FILENAME=eosio_$VERSION-1.el7.x86_64.rpm
2
INSTALL_TOOL=yum
Copied!

Install

1
wget https://github.com/EOSIO/eos/releases/download/v$VERSION/$FILENAME
2
sudo $INSTALL_TOOL install ./$FILENAME
Copied!

Prepare Directories

1
#cleanup
2
rm -rf $HOME/.local/share/eosio/nodeos || true
3
​
4
#create dirs
5
mkdir $HOME/.local/share/eosio/nodeos/data/blocks -p
6
mkdir $HOME/.local/share/eosio/nodeos/data/snapshots -p
7
mkdir $HOME/.local/share/eosio/nodeos/config -p
Copied!

Snapshots

If you would like an up to date snapshot, please visit: snapshots.eosnation.io and find the latest snapshot for the chain you are using. You will want to unpack the file and store it here with the following file name: $HOME/.local/share/eosio/nodeos/data/snapshots/boot.bin.

Kylin

1
URL="http://storage.googleapis.com/eos-kylin-snapshot/snapshot-2019-06-10-09(utc)-0312d3b9843e2efa6831806962d6c219d37200e0b897a0d9243bcab40b2b546b.bin"
2
P2P_FILE=https://raw.githubusercontent.com/cryptokylin/CryptoKylin-Testnet/master/fullnode/config/config.ini
3
GENESIS=https://raw.githubusercontent.com/cryptokylin/CryptoKylin-Testnet/master/genesis.json
4
CHAIN_STATE_SIZE=256000
5
wget $URL -O $HOME/.local/share/eosio/nodeos/data/snapshots/boot.bin
Copied!

Jungle

You can find more Jungle peers here: https://monitor.jungletestnet.io/#p2p​
1
export MONTH=01
2
export DAY=09
3
wget https://eosn.sfo2.digitaloceanspaces.com/snapshots/snapshot-2020-$MONTH-$DAY-15-jungle.bin.bz2
4
bzip2 -d ./snapshot-2020-01-09-15-jungle.bin.bz2
5
mv snapshot-2020-01-09-15-jungle.bin $HOME/.local/share/eosio/nodeos/data/snapshots/boot.bin
6
P2P_FILE=https://validate.eosnation.io/jungle/reports/config.txt
7
GENESIS=https://raw.githubusercontent.com/EOS-Jungle-Testnet/Node-Manual-Installation/master/genesis.json
8
CHAIN_STATE_SIZE=256000
Copied!

Mainnet

1
URL="https://s3.eu-central-1.wasabisys.com/eosnodetools/snapshots/snap_2019-12-15-13-00.tar.gz"
2
P2P_FILE=https://eosnodes.privex.io/?config=1
3
GENESIS=https://raw.githubusercontent.com/CryptoLions/EOS-MainNet/master/genesis.json
4
CHAIN_STATE_SIZE=16384
5
cd $HOME/.local/share/eosio/nodeos/data
6
wget $URL -O - | tar xvz
7
SNAPFILE=`ls snapshots/*.bin | head -n 1 | xargs -n 1 basename`
8
mv snapshots/$SNAPFILE snapshots/boot.bin
Copied!

Configuration

Please note that it is crucial that all of the following configuration flags are set. If any are missing, it will likely cause issues with running tht DSP software.
1
cd $HOME/.local/share/eosio/nodeos/config
2
​
3
# download genesis
4
wget $GENESIS
5
# config
6
cat <<EOF >> $HOME/.local/share/eosio/nodeos/config/config.ini
7
agent-name = "DSP"
8
http-server-address = 0.0.0.0:8888
9
p2p-listen-endpoint = 0.0.0.0:9876
10
blocks-dir = "blocks"
11
abi-serializer-max-time-ms = 3000
12
max-transaction-time = 150000
13
wasm-runtime = eos-vm
14
eos-vm-oc-enable = true
15
reversible-blocks-db-size-mb = 1024
16
contracts-console = true
17
p2p-max-nodes-per-host = 1
18
allowed-connection = any
19
max-clients = 100
20
sync-fetch-span = 500
21
connection-cleanup-period = 30
22
http-validate-host = false
23
access-control-allow-origin = *
24
access-control-allow-headers = *
25
access-control-allow-credentials = false
26
verbose-http-errors = true
27
http-threads=8
28
net-threads=8
29
chain-threads=8
30
eos-vm-oc-compile-threads=2
31
trace-history-debug-mode = true
32
trace-history = true
33
http-max-response-time-ms = 500
34
plugin = eosio::producer_plugin
35
plugin = eosio::chain_plugin
36
plugin = eosio::chain_api_plugin
37
plugin = eosio::net_plugin
38
plugin = eosio::state_history_plugin
39
state-history-endpoint = 0.0.0.0:8887
40
chain-state-db-size-mb = $CHAIN_STATE_SIZE
41
EOF
42
​
43
curl $P2P_FILE > p2p-config.ini
44
cat p2p-config.ini | grep "p2p-peer-address" >> $HOME/.local/share/eosio/nodeos/config/config.ini
Copied!
Please note the following about some config.ini settings:

Run

First run (from snapshot)
1
nodeos --disable-replay-opts --snapshot $HOME/.local/share/eosio/nodeos/data/snapshots/boot.bin --delete-all-blocks
Copied!
You will know that the node is fully synced once you see blocks being produced every half second at the head block. You can match the block number you are seeing in the nodeos logs to what bloks.io is indicating as the head block on the chain you are syncing (mainnet, Kylin etc). Once you have confirmed that it is synced press CTRL+C once, wait for the node to shutdown and proceed to the next step.

systemd

1
export NODEOS_EXEC=`which nodeos`
2
export NODEOS_USER=$USER
3
sudo -E su - -p
4
cat <<EOF > /lib/systemd/system/nodeos.service
5
[Unit]
6
Description=nodeos
7
After=network.target
8
[Service]
9
User=$NODEOS_USER
10
ExecStart=$NODEOS_EXEC --disable-replay-opts
11
[Install]
12
WantedBy=multi-user.target
13
EOF
14
​
15
systemctl start nodeos
16
systemctl enable nodeos
17
exit
18
sleep 3
19
systemctl status nodeos
Copied!

Optimizations