Skip to content

Instantly share code, notes, and snippets.

@gadost
Created March 18, 2022 14:59
Show Gist options
  • Save gadost/f0c12522f371b8b5b0fbebae2752d381 to your computer and use it in GitHub Desktop.
Save gadost/f0c12522f371b8b5b0fbebae2752d381 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl -s http://localhost:26657/dump_consensus_state | jq '.result.round_state.votes[0].prevotes' | awk '{print $1}' | grep -i "\"V" | cut -f 2 -d':' | sort > votedadresses
while read line; do curl -s http://localhost:26657/dump_consensus_state -s | grep $line -A4 | grep "\"value\"" |head -n1 | awk '{print $2}' >> votestkeys; done < votedadresses
curl -s http://localhost:26657/dump_consensus_state | grep "value" | awk '{print $2}' | sort |uniq > allvotes
while read line; do sed -i -e "s#$line##g" allvotes;done < votestkeys
cat allvotes | sort > filterednovotes
sed -i -e '/^[[:space:]]*$/d' filterednovotes
sed -i -e 's/"//g' filterednovotes
while read line; do gravity query staking validators --limit 1000 | grep $line -A11 | grep moniker; done < filterednovotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment