Skip to content

Commit

Permalink
node check and remove duplicate gentxs (#614)
Browse files Browse the repository at this point in the history
* remove duplicates

* add validator check

* typo
  • Loading branch information
jhernandezb authored Jul 13, 2021
1 parent 1e394ac commit 2909e66
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ else
fi
echo "Lockup period is $LOCKUP"

rm ~/.starsd/config/genesis.json
rm -f ~/.starsd/config/gentx
rm -f ~/.starsd/config/genesis.json
rm -f ~/.starsd/config/gentx/*

echo "Processing airdrop snapshot..."
if ! [ -f genesis.json ]; then
Expand Down
15 changes: 15 additions & 0 deletions check-validator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
CHAIN_ID=cygnusx-1
for i in $CHAIN_ID/gentx/*.json; do
pubkeybase64=$(jq -r '.body.messages[0].pubkey.key' $i)
pubkey=$(starsd debug pubkey $pubkeybase64 | grep Consensus | rev | cut -d " " -f1 | rev)
local_pub_key=$(starsd tendermint show-validator)
echo "Checking file $i"
if [ "$pubkey" == "$local_pub_key" ]; then
echo "This is a validator node"
echo "Your gentx is $i"
exit 0;
fi
done
echo "This is not a validator node"
exit 1;

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2909e66

Please sign in to comment.