💡 Witness Tips: Seeds Ping Script

To improve your witness latencies, it's important to have the best seed pings in your config.ini.
Usually, you can go to https://status.steemnodes.com/, ping all the online servers, select the ones with the lowest latencies, and add them to the witness config. It's tedious if you want to do that manually!

I wrote a little bash script to automate the pinging process. Here are the steps:

Go to https://status.steemnodes.com/ and click the "config.ini format" tab, this will give you the list of the online seeds.
Copy all the lines into a text file called seeds.txt, for example:
seed-node = node.mahdiyari.info:2001
seed-node = seed.roelandp.nl:2001
seed-node = 104.199.118.92:2001
seed-node = seed.followbtcnews.com:2001
seed-node = seed.thecryptodrive.com:2001
seed-node = steem-seed1.abit-more.com:2001
seed-node = seed.steemnodes.com:2001
Create a new file called "pings.sh" and paste the following into it:
#!/usr/bin/env bash
if [ -f seeds.txt ]; then
    let offlinecount=0
    let onlinecount=0
    rm results.txt
    while read seed; do
      host=`echo $seed | awk '{print $3}' | cut -d ':' -f 1`
      pinged=`ping -c 1 -W 1 $host |  tail -1 | awk '{print $4}' | cut -d '/' -f 2`
      echo "$seed $pinged"
      if [ ! -z $pinged ]; then
       echo "$pinged $seed">> results.txt
       let "onlinecount++"
      else
       let "offlinecount++"
      fi
    done <seeds.txt
    echo "$onlinecount seeds are online"
    echo "$offlinecount seeds are offline"
    sort -n results.txt > pings-sorted.txt
    cut -d " " -f2- pings-sorted.txt > pings-finalresults.txt
  else
    echo "Missing seeds.txt file"
fi
Give the pings.sh execute permissions:

chmod +x pings.sh

Run the script.

./pings.sh

Check the pings-sorted.txt for the lowest pings (e.g. <100ms), and copy/paste the corresponding lines from pings-finalresults.txt into your witness config.ini.

Note: Some of the seeds may be listed as being Online, but they can be down; @wackou can you check that please? Those seeds will be discarded by the script in the final results.

Restart your steemd or dockerized image.

ADDENDUM

As pointed out by @wackou, some servers may have their ICMP firewalled, so the pinging script would yield false negatives. I found paping, a cross-platform TCP port testing tool. It emulates the functionality of ping (port ping).
https://code.google.com/archive/p/paping/

Download paping
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/paping/paping_1.5.5_x86-64_linux.tar.gz

Decompress it
tar xzvf paping_1.5.5_x86-64_linux.tar.gz

And use this script instead of the previous one:

#!/usr/bin/env bash
if [ -f seeds.txt ]; then
    let offlinecount=0
    let onlinecount=0
    rm results.txt
    while read seed; do
      host=`echo $seed | awk '{print $3}' | cut -d ':' -f 1`
      port=`echo $seed | awk '{print $3}' | cut -d ':' -f 2`
      pinged=`./paping $host -p $port -c 1 --nocolor| grep 'Average' | cut -d '=' -f 4 | cut -d ' ' -f 2`
      echo "$host $pinged"
      if [ $pinged != '0.00ms' ]; then
       echo "$pinged $seed">> results.txt
       let "onlinecount++"
      else
       let "offlinecount++"
      fi
    done <seeds.txt
    echo "$onlinecount seeds are online"
    echo "$offlinecount seeds are offline"
    sort -n results.txt > pings-sorted.txt
    cut -d " " -f2- pings-sorted.txt > pings-finalresults.txt
  else
    echo "Missing seeds.txt file"
fi

Proud member and delegator of the @minnowsupport project.
Join us on https://discord.gg/GpHEEhV

MSPPAL


Follow
🗳 Please check my Steem witness application and consider voting for me. 🗳
Thank you for your support.

Vote

Alternatively, you can issue this command in cli_wallet (after unlocking it)

vote_for_witness "YOURACCOUNT" "drakos" true true

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center