Block Producer Guide on starting EOS Producer Node

in #eos7 years ago

The material posted here used in technical training sessions for BPs :

1. Compile latest EOS source code and install.

You should use following repo to clone: git clone https://github.com/EOS-Mainnet/eos

2. Create node folder and place genesis.json into the folder.

Here is the copy of Mainnet genesis but please verify it with multiple sources:
{
"initial_timestamp": "2018-06-08T08:08:08.888",
"initial_key": "EOS7EarnUhcyYqmdnPon8rm7mBCTnBoot6o7fE2WzjvEX2TdggbL3",
"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": 1000,
"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
}
}

3. Create producer config.ini file using following template:

You can try using <ip-address> instead of 0.0.0.0 for http-server-address and p2p-listen-endpoint settings below. However if you are running on a cloud instance and get network error - use 0.0.0.0

get-transactions-time-limit = 3
block-log-dir = "blocks”

http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9856
p2p-server-address = :9856

allowed-connection = any

log-level-net-plugin = info
max-clients = 100
connection-cleanup-period = 30
network-version-match = 0
sync-fetch-span = 2000
enable-stale-production = false
required-participation = 33

plugin = eosio::chain_api_plugin
plugin = eosio::history_plugin
plugin = eosio::history_api_plugin

peer-private-key = ["<EOS...public key>","<private-key>"]
signature-provider = <public--key>=KEY:<private-key>
producer-name = <12 chars name>
plugin = eosio::producer_plugin

p2p-peer-address = 209.41.67.115:7115

Complete list of peers available here:

https://docs.google.com/spreadsheets/d/1HLAIZ242dc0R8IcHnTRjVur4-wguQ6AjRxzXia-2esU/edit#gid=0

4. Create start script: vi start.sh

#!/bin/bash
NODEOS=/home/ubuntu/eos/build/programs/nodeos/nodeos
DATADIR=/home/ubuntu/node

$NODEOS --data-dir $DATADIR --config-dir $DATADIR "$@" > $DATADIR/stdout.txt 2> $DATADIR/stderr.txt & echo $! > $DATADIR/nodeos.pid

5. Create stop.sh :

#!/bin/bash
DIR=/home/ubuntu/node
if [ -f $DIR"/nodeos.pid" ]; then
pid=$(cat $DIR"/nodeos.pid")
echo $pid
kill $pid
rm -r $DIR"/nodeos.pid"
echo -ne "Stopping Nodeos"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
echo -ne "\rNodeos stopped. \n"
fi

6. Make scripts executable: chmod +x *.sh

7. Start your producer node for the first time passing genesis*:

./start.sh --genesis-json genesis.json
*) For any future node restarts just use: ./start.sh and do not pass genesis again!

8. Check if process running: pgrep nodeos

  • returns process id like: 1738

9. Tail and monitor your log for any errors: tail -f stderr.log

Screen Shot 2018-06-15 at 10.42.32 AM.png