Skip to content

Feature/ MainNet pre-genesis and docs #22

Feature/ MainNet pre-genesis and docs

Feature/ MainNet pre-genesis and docs #22

Workflow file for this run

name: Check new gentxs according to the criteria
on:
# push:
# paths:
# - 'sge-network-2/gentxs/**'
pull_request:
paths:
- 'sge-network-2/gentxs/**'
env:
MIN_STAKE: 10000000000
jobs:
check-gentxs-directory:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Check gentx amount
run: |
for file in sge-network-2/gentxs/*.json; do
NAME=$(echo $file | cut -f 1 -d '.')
STAKED=$(jq -r '.body.messages[0].value.amount' "$file")
if [[ $STAKED -ge $MIN_STAKE ]]; then
# If the validator meets the criteria, print a message
echo "$NAME has $STAKED tokens staked"
else
# If the validator does not meet the criteria, print a warning message
echo "WARNING: $NAME has $STAKED tokens staked, minimum ammount is $MIN_STAKE "
fi
done
#- name: Check gentx criteria
# run: |
## Loop through each validator and check if it meets the criteria
#for V in $(echo "$VALIDATORS" | jq -c '.validators[]'); do
# STAKED=$(echo "$V" | jq -r '.tokens')
# NAME=$(echo "$V" | jq -r '.description.moniker')
# COMMISSION_TIME=$(echo "$V" | jq -r '.commission.update_time')
# echo "$NAME has $STAKED tokens staked and last updated commission on $COMMISSION_TIME"
# COMMISSION_UNIX_TIME=$(date -d $COMMISSION_TIME +%s)
# TX_UNIX_TIME=$(date -d @$TX_TIME +%s)
# if [[ $STAKED -ge $MIN_STAKE ]] && [[ $COMMISSION_UNIX_TIME -ge $TX_UNIX_TIME ]]; then
# echo "Validator $NAME meets the criteria."
# else
# echo "Validator $NAME does not meet the criteria."
# exit 1
# fi
#done
#echo "All validators meet the criteria."