Learning Diary, connecting to EOS mainnet

in #eos3 years ago (edited)

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:

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


If got time I need to read through these haha

I've done it before, so I will try it again using the latest copy.
Thanks for sharing cheers.

Got to try man. Cheers to you keep in touch.

Your post has been manually curated by superoo7

You’ve been upvoted by TeamMalaysia Community :-

To support the growth of TeamMalaysia Follow our upvotes by using steemauto.com and follow trail of @myach

Vote TeamMalaysia witness bitrocker2020 using this link vote for witness

You just received a Tier 0 upvote! Looking for bigger rewards? Click here and learn how to get them or visit us on Discord
If you would like to opt out of receiving comments reply with STOP

Thanks for this guide, one thing to mention is when you run the cleos get info you won't get the same details as shown here. Some of the command might not work as well. The reason is your node will needs sometime to sync the data with the mainnet, once in sync the head_block_num will be the same with eostracker.io. all your other command will also work properly. I am now able to vote with cleos command line now.

anyone else getting this when using: nodeos --genesis-json genesis.json, even after editing config.ini?Screen Shot 2018-06-13 at 8.54.35 PM.png

i see you just kill your node with pkill

first time u start your node make surr genesis.json correct

then it will generate a config file

kill the first time with ctrl-c then edit the config file add plugin add node

then start again the node

if error, clean the block + state make sure u dont delete the config file

then start again the node

just follow the article