Measuring seed-node ping times with python

in #witness-category7 years ago (edited)

Almost every tutorial for setting up a witness node mention that it is important to ping all seed-nodes and add the fastest nodes to the config.ini file. For improving this process, I wrote a small python script, which:

  • measure ping times
  • sort the seed nodes
  • exclude slow nodes
  • creates entries for the config.ini file

You can find the script here https://github.com/holgern/steem-witness-tools. Steps for running the script on your witness server:

  1. install python3 and pip3
  2. install ping3 by pip3 install ping3 --user
  3. cloning my git: git clone https://github.com/holgern/steem-witness-tools.git
  4. You may copy the newest seednodes.txt from https://github.com/steemit/steem/blob/master/doc/seednodes.txt
  5. Enter the sort_seed_nodes directory (cd sort_seed_nodes)
  6. Run the script by sudo python3 ping_seed_nodes.py as root
  7. Copy the result directly to your config.ini

Script arguments

image.png

It is possible to modify the maximum allowed ping time in milliseconds. Default is 100 ms, which means that all seed nodes are included with a ping time better than 100 ms. In the following example, the maximum time is set 50 milliseconds:

 sudo python3 ping_seed_nodes.py  --maxdelay 50

It also possible to use a different seed-node.txt file as source. It must follow the same structure as the seed-node.txt file.

seed-east.steemit.com:2001          # steemit
seed-url:port                       # owner

The inputparameter allows to use different files as source:

sudo python3 ping_seed_nodes.py --input my-seed-nodes.txt

Result

image.png

The results are also stored in sorted_seednodes_6_6_2018.txt, the name is adapted to the date.


If you like what I'm doing, please consider @holger80 as one of your witnesses. You can use steemconnect.com for approve your vote or go to https://steemit.com/~witnesses and enter my name into the vote field:


image.png

Sort:  

Well done! I will be giving it a shot on @ro-witness to see how it works. Thanks!