i made a script that checks the RTTs (round trip times) for your stakepool node.
You can set it up to check all OUTgoing connections from your node to other stakepools,
you can also set it up to show connections that are coming IN to your specified node.
The scripts reads out the whole network data of established peers from netstat, after that it generates
an automated ping report. In this case it uses ping, and if ping is not successful it changes to a tcp/syn check using tcptraceroute to the open port. The script is filtering out duplicated ip’s, so it makes only one ping to a dedicated peer ip.
You can check how “good” your in/out connections are in the ranges:
- 0 - 50ms
- 50 - 100ms
- 100 - 200ms
- above 200ms
The summary presents a user friendly output of your current stats, you have different options to show
a Top list, also you can hide the ip addresses. This is useful to share some screenshots with other
operators. It’s a useful tool to see if your connections are “ok”, or if you should change your internet connection or move to a vps or similar. It’s a small little helper.
You can download it here from my stakepool website:
After the download, make it executable like:
chmod +x pingNodes.sh
Or a oneliner for Ubuntu/Debian:
wget https://at-ada.net/pingNodes.sh && chmod +x pingNodes.sh
Edit the script with your favorit editor like:
and set the few parameters (LISTENPORT) at the beginning of the script to meet your needs
Run the script simply like:
If you’re having troubles and getting errors, try running it with higher priviledges like:
Sometimes netstat doesn’t show up all the processes of the user with PIDs.
You can also set the wanted LISTENPORT and DIRECTION via the cli (Ver 1.2 and above) like:
./pingNodes.sh 3001 out
./pingNodes.sh 3001 in
to override the settings in the script.
If you get no found peers, please check that your language for netstat is set correct in the script.
Example for outgoing connections to other stakepool nodes:
You can see, that almost 60% of all outgoing connections are to nodes with less than 50ms RTT.
Example for incoming peers:
Here you can see, that around 55% of all incoming connections, that also includes
blocks from the chain, are in the 0-50ms window.
It’s important for your node to:
- Be well informed with the latest Block
- Send out your fresh made Block fast to the Blockchain
I hope this is a useful tool for the community, please give me some feedbacks or share
some screenshots how your peer distribution looks like.
Martin Lang - ATADA StakePool Austria