Tips For connecting EOS node to mainnet

in #eos6 years ago

I was struggling to connect an EOS node to mainnet, but now I believe that I got it working.
Below are some tips for those who might encounter the same issues:

  • There are two ways to deploy the node. Compile the repo from github (tutorial here https://eosbootcamp.com/lesson/docker/) and using docker (tutorial here https://www.eosdocs.io/dappdevelopment/software/docker/). Using docker is much faster because it saves you at least 3 hours of compilation, so I used it.

  • Make sure that you have set p2p-peer-address in config.ini, and that you are using the correct genesis.json.

  • Make sure that in the nodeos is using the correct config.ini and genesis.json. Use the command lines options --config and --genesis-json to specify exact path to the files.

  • Make sure that the server address is the same as the server address that is in the config.ini file. In my case I was following a tutorial for EOS with docker which recommended to put the server on port 7777. As a result, you need to change in config.ini so that http-server-address=0.0.0.0:7777.

  • Are you getting the error: "Not producing block because I don't have the private key for EOS7EarnUhcyYqmdnPon8rm7mBCTnBoot6o7fE2WzjvEX2TdggbL3"?
    This took me hours to figure out! Apparently, when starting a new node, it will take quite a significant time to sync, starting from the EOS creation at June 9, 2018. Let it sync for about half an hour and eventually you will see the "Received Block" messages.

  • The first time that you are running a node, you need to run with --delete-all-blocks --genesis-json. This will reset the chain, and it will start syncing from the first EOS block (June 9, 2018). You can safely stop nodeos with ctrl-C, and in the future continue from where it stopped by not using the --delete-all-blocks --genesis-json options in the nodeos command line.

  • When querying data from your node, these are all the same:

$ docker exec server /opt/eosio/bin/cleos -u http://127.0.0.1:7777 --wallet-url http://172.18.0.3:5555 get info
$ curl --request POST http://127.0.0.1:7777/v1/chain/get_info

or you can even use alias:

$ alias cleos='docker exec server /opt/eosio/bin/cleos -u http://127.0.0.1:7777 --wallet-url http://172.18.0.3:5555'
$ cleos get info

  • You can check where you are at in the syncing by calling cleos get info:

This image is after about 1 hour of syncing, and as you can see the sync has reached June 14,2018.
As a result, if I try to query an account that was created after that date, I got weird errors:

After the node synchronization reached the date the account was created, I was able to query the data.

Conclusion

It took me a lot of time to overcome some of the issues that I struggled with above, I hope that this will help others in the future.
There are probably some things that I forgot to mention, so if you are stuck and need help try to connect with me and I hope that I will be able to help (https://www.linkedin.com/in/hhezi/)

Good luck!

Sort:  

Congratulations @hhezi! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!