Learning Diary, connecting to EOS mainnet

fundurian(69)
Published in
#eos
Words
301
Reading
2 min
Listen
Play
8y

Screen Shot 2018-06-11 at 1.26.21 AM.png

Hello Steemit friends, so EOS mainnet is finally up so finally I can connect to the mainnet

EOS block explorer:
http://eostracker.io

The only tutorial i can find is on https://eosnodes.privex.io/ where privex CEO is teaching people how to connect to the mainnet

If you follow my blog post yesterday, I installed EOS on Ubuntu 16.04 and then run a private node.
Due to I already run my private test node yesterday so i need to kill it first, I kill it using below command

rm -rf ~/.local/share/eosio

this will remove all the block, state of my node

also i do below command to make sure my previous node is 100% off

pkill -9 cleos
pkill -9 nodeos
pkill -9 keosd

then inside my folder ~/eos/build/genesis.json
I used below code

{
  "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
  }
}

so that when you start your node, you are using the mainnet genesis code

then i start my new node using below command

nodeos --genesis-json genesis.json

the first time you do this it will provide error, this is because the newly generated config.ini file is not complete,
the location of the file is on ~/.local/share/eosio/nodeos/config/config.ini

the error look something like below
Screen Shot 2018-06-10 at 11.43.52 PM.png

so you need to press CTRL-C to kill it then edit the config.ini file

inside config.ini file, first you put below code

plugin = eosio::chain_api_plugin
plugin = eosio::net_api_plugin

then you paste in the 25 IP address of the block producer(miner)
example as below, full list can get from https://eosnodes.privex.io/

p2p-peer-address = mainnet.bepal.io:8866
p2p-peer-address = mainnet.eos.ren:9376
p2p-peer-address = mainnet.eosarabia.org:3571
p2p-peer-address = mainnet.eoscalgary.io:5222
p2p-peer-address = mainnet.eoseco.com:10010
p2p-peer-address = mainnet.eosoasis.io:9876

then you can clean the block and state file using below command

rm ~/.local/share/eosio/nodeos/data/blocks/* -r
rm ~/.local/share/eosio/nodeos/data/state/* -r

then you can start again the new node that connecting to the mainnet

nodeos --genesis-json genesis.json

if everything working fine, you should get a screen as below

Screen Shot 2018-06-11 at 1.24.10 AM.png

then opening another screen, you can type below code to see the block info

cleos get info 

Screen Shot 2018-06-11 at 1.26.11 AM.png

as you can see the block number is similar to the block number you see on eostracker.io meaning this is the mainnet you are connecting to, so congratulation if you can reach here

thanks for reading

Learning Diary, connecting to EOS mainnet | Ecency