Last active
January 31, 2022 23:00
-
-
Save inigoflores/4d929dc9efdf149319a6a7c07c9250af to your computer and use it in GitHub Desktop.
Pisces - Get the lost witness ratio due to network problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Checking the logs...\r\n" | |
total=$(grep -hE 'miner_onion_server:decrypt:{[0-9]+,[0-9]+} sending witness at RSSI' /home/pi/hnt/miner/log/console.log* |wc -l) | |
lost=$(cat /home/pi/hnt/miner/log/console.log* |grep "max retry" |wc -l) | |
delivered=$(grep -hE 'successfully sent witness to challenger' /home/pi/hnt/miner/log/console.log* | wc -l) | |
percentage=$(echo "print(round($lost/$total*100,2))" | python3) | |
echo "Witnesses\r"; | |
echo "---------------------------------------"; | |
echo "Total received = $total\r"; | |
echo "Total lost = $lost\r"; | |
echo "Total succesfuly delivered = $delivered\r\n"; | |
echo "You are losing $percentage % of your witnesses due to network issues.\r\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This can be due to blockchain p2p issues or an unstable Internet connection. Relayed hotspots acting as challengers normally fail to receive witnesses. Values under 10% are rather common. You should investigate the matter if the value goes above 15%.