Proton Technical How To #1

Ross Dold
EOSphere Blog

--

Running EOSIO infrastructure to support the Proton Blockchain can be a bit daunting when first starting out. This series of articles aims to demystify the infrastructure and operational requirements required to run Rock Solid services for the Proton Blockchain.

Of course these articles are not just for Block Producers, they are also for Developers, Services Providers and DApps that may need a pointer on how to get started with the Proton Blockchain.

Be sure to connect with other Proton technical community members by joining the Proton Testnet Telegram → Here

Find out more about Proton and it’s goals to be the industry recognised Payment Blockchain → Here

Lets go! This First Edition will show you how to get started with building a Proton node on the Public Proton Testnet.

How to Set Up a Proton Testnet Node

The Proton Testnet has relatively low system requirements compared to the Mainnet, however it is fully functional with freely available Proton Tokens and therefore an ideal place to get familiar with the software and network itself.

Testnet Requirements

Hardware

  • 4 Core CPU / 4Ghz+ recommended if you would like to produce blocks
  • 128GB Disk / Preferably SSD or NVMe
  • 4GB RAM

Operating System (Linux Based Only)

  • Amazon Linux 2
  • CentOS 7
  • CentOS 7.x
  • CentOS 8
  • Ubuntu 16.04
  • Ubuntu 18.04 (Recommended)
  • Ubuntu 20.04 (Recommended)
  • MacOS 10.14 (Mojave)
  • MacOS 10.15 (Catalina)

Internet

  • Modern Broadband / Fibre Connection (1Mb/s and above)
  • Static Public IP Address (Either terminating on this node or forwarded with NAT)

Build the Software

The Proton Blockchain uses freely available opensource EOSIO software provided by block.one

Currently the accepted Proton Block Producer software build and version is v2.1.0

The latest build tag is always available on the EOSIO GitHub repository

Building Process
There are two suggested ways to install the required EOSIO software on your server, either build from source using an eosio script or install from a precompiled .deb file.

The example below uses Ubuntu Linux to build the eosio software from source via script following the process below:

> cd ~
> git clone https://github.com/EOSIO/eos.git
> cd eos
> git checkout v2.1.0
> git submodule update --init --recursive
> cd scripts
> ./eosio_build.sh -P
#Binaries are in ~/eos/build/programs#If you want to install
> ./eosio_install.sh

As the -P option is used on the above build script this may take some time to compile as it will build with pinned clang and libcxx

The example below uses Ubuntu Linux to install the eosio software from a precompiled .deb file.

> wget https://github.com/eosio/eos/releases/download/v2.1.0/eosio_2.1.0-1-ubuntu-20.04_amd64.deb> sudo apt install ./eosio_2.1.0-1-ubuntu-20.04_amd64.deb#To uninstall
> sudo apt remove eosio

Configuration

Now that a clean build of the eosio software has been compiled lets get into configuring the Proton node for operation.

To configure and start the Proton node nodeos will be used, nodeosis the core service daemon that runs on every Proton Blockchain node.

nodeos can be configured to process smart contracts, validate transactions, produce blocks containing valid transactions, and confirm blocks to record them on the blockchain. You can read more about it here.

The primary operational functions of nodeos are; running it as a Block Producer, Network API Endpoint, P2P Seed Node or State-History Node. Typically on a busy network such as the Proton Mainnet you would separate these functions across physically discrete servers.

In this Proton Testnet example you will make your node connect to other network peers, offer a P2P Seed Node service and make the node available as a Network API Endpoint. This node won’t be providing historical data query support.

nodeos requires two files to connect to peers and run on the Proton Testnet:

config.ini

Create a default config.ini by running nodeos without config as per the command below:

> mkdir ~/protondata
> nodeos --data-dir ~/protondata --config-dir ~/protondata

You will then be able to edit the newly created config.ini and see all the available parameters:

> cd ~/protondata
> nano config.ini

Now edit the config.iniand add the following configuration settings:

wasm-runtime = eos-vm-jitchain-state-db-size-mb = 16384
chain-state-db-guard-size-mb = 1024
enable-account-queries = truehttp-server-address = 0.0.0.0:8888
access-control-allow-origin = *
access-control-allow-headers = Origin, X-Requested-With, Content-Type, Accept
http-max-response-time-ms = 100
verbose-http-errors = true
http-validate-host = false
p2p-listen-endpoint = 0.0.0.0:9876p2p-peer-address = testnet.protonchain.com:9876
p2p-peer-address = peer1-proton-testnet.eosphere.io:9876
p2p-peer-address = peer.protontest.alohaeos.com:9876
p2p-peer-address = protontestnet.greymass.com:59876
p2p-peer-address = p2p-testnet-proton.eosarabia.net:9876
p2p-peer-address = testnet.proton.eosdetroit.io:1337
p2p-peer-address = proton-bp.dmail.co:7676
p2p-peer-address = test.proton.eosusa.news:19889
p2p-peer-address = protonp2p-testnet.eoscafeblock.com:9130
p2p-peer-address = proton-testnet.eosio.cr:9878
agent-name = "<yourname> Proton Testnet"max-clients = 100
sync-fetch-span = 500
plugin = eosio::http_plugin
plugin = eosio::history_api_plugin
plugin = eosio::history_plugin
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin

genesis.json

These are the initial state parameters required by every new starting node on the Proton Testnet. Create the file as below:

cd ~/protondata
nano genesis.json

Add the following parameters to the genesis.json file for the Proton Public Testnet:

{
"initial_timestamp": "2020-04-03T17:00:00",
"initial_key": "EOS55SwgLfr9jkwdr2UDncPESQVs3MdDidcLionvogHvCPJ3FDb48",
"initial_configuration": {
"max_block_net_usage": 1048576,
"target_block_net_usage_pct": 1000,
"max_transaction_net_usage": 524288,
"base_per_transaction_net_usage": 12,
"net_usage_leeway": 500,
"context_free_discount_net_usage_num": 20,
"context_free_discount_net_usage_den": 100,
"max_block_cpu_usage": 200000,
"target_block_cpu_usage_pct": 2000,
"max_transaction_cpu_usage": 150000,
"min_transaction_cpu_usage": 100,
"max_transaction_lifetime": 3600,
"deferred_trx_expiration_window": 600,
"max_transaction_delay": 3888000,
"max_inline_action_size": 4096,
"max_inline_action_depth": 4,
"max_authority_depth": 6,
"max_ram_size": 34359738368
}
}

Running Nodeos

Now that the config.ini has been configured and the initial Proton Testnet chain parameters genesis.json have been created, you can now join the network and sync up the node.

Use GNU Screen to keep your session live even when you disconnect, usage below:

# Create a new screen session
> screen -US proton
# Disconnect screen session
> ctrl-a+d
# Reconnect screen session
> screen -r proton

Run nodeos with pointers to the config, data directory and genesis file:

> nodeos --data-dir ~/protondata --config-dir ~/protondata --genesis-json ~/protondata/genesis.json

Your Proton Testnet node will now start syncing with the configured peers until it catches up and is current with the Proton Testnet Blockchain.

The Next Edition of Proton Technical How To .. will look at the role of state database snapshots and how they can expedite syncing a node.

Be sure to ask any questions in the EOSphere Telegram

EOSphere is a Block Producer on the Proton Mainnet Blockchain as well as many other EOSIO based networks.

If you find our work helpful, please vote us on the Proton Mainnet: eosphere

Connect with EOSphere via these channels:

TELEGRAM | MEDIUM |YOUTUBE | FACEBOOK | TWITTER | INSTAGRAM

--

--