Created
April 24, 2026 17:09
-
-
Save Commoneffort/a011557c2ce0625b0583f3012ded176a to your computer and use it in GitHub Desktop.
X1 SHRED & REPAIR MONITOR (Live)
This file contains hidden or 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
| cat > shred-repair-monitor.sh << 'EOF' | |
| #!/bin/bash | |
| echo -e "\033[1;36m══════════════════════════════════════════════════════════════" | |
| echo -e " X1 SHRED & REPAIR MONITOR (Live)" | |
| echo -e "══════════════════════════════════════════════════════════════\033[0m" | |
| echo -e "High repairs = bad high-stake validator / network poisoning" | |
| echo | |
| journalctl -u solana-validator -f --no-pager | grep --line-buffered -E "slot_stats_tracking_complete|num_repaired|shred_fetch_repair|retransmit-stage|repair_service-repair_timing" | while read -r line; do | |
| timestamp=$(echo "$line" | grep -o '\[.*Z\]' | cut -d' ' -f1) | |
| slot=$(echo "$line" | grep -o 'slot=[0-9]*' | cut -d= -f2 || echo "N/A") | |
| if echo "$line" | grep -q "slot_stats_tracking_complete"; then | |
| repaired=$(echo "$line" | grep -o 'num_repaired=[0-9]*' | cut -d= -f2) | |
| recovered=$(echo "$line" | grep -o 'num_recovered=[0-9]*' | cut -d= -f2) | |
| if [[ $repaired -gt 300 ]]; then | |
| color="\033[1;31m" # Red = BAD (poisoning) | |
| elif [[ $repaired -gt 100 ]]; then | |
| color="\033[1;33m" # Yellow = Warning | |
| else | |
| color="\033[1;32m" # Green = Good | |
| fi | |
| echo -e "${color}[$timestamp] SLOT $slot → Repairs: $repaired | Recovered: $recovered\033[0m" | |
| fi | |
| if echo "$line" | grep -q "shred_fetch_repair"; then | |
| shred_count=$(echo "$line" | grep -o 'shred_count=[0-9]*' | cut -d= -f2) | |
| echo -e " └─ Shred fetch (repair) → $shred_count shreds" | |
| fi | |
| if echo "$line" | grep -q "retransmit-stage-slot-stats"; then | |
| layer1=$(echo "$line" | grep -o 'num_shreds_received_1st_layer=[0-9]*' | cut -d= -f2) | |
| layer2=$(echo "$line" | grep -o 'num_shreds_received_2nd_layer=[0-9]*' | cut -d= -f2) | |
| echo -e " └─ Turbine reception → 1st: $layer1 | 2nd: $layer2" | |
| fi | |
| done | |
| EOF | |
| chmod +x shred-repair-monitor.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment