add erigon, simple stupid alarming

This commit is contained in:
cventastic
2022-01-12 19:00:12 +01:00
parent 0a090cff09
commit 9141f62935
3 changed files with 34 additions and 6 deletions

26
util/sync_alert_nooby.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
TELEGRAM_AUTH_TOKEN=5077327159:AAELNjCtFZTrLz7h5PW9Td1RTl8beNFgMbo
TELEGRAM_CHAT_ID=-697908946
curl_w() {
curl \
retry-connrefused \
-sf "$@"
}
send_message() {
curl_w -X POST "https://api.telegram.org/bot${TELEGRAM_AUTH_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d "{\"chat_id\": \"${TELEGRAM_CHAT_ID}\", \"text\": \"${*}\", \"disable_notification\": false}"
}
chain_list="goerli ropsten rinkeby geth erigon harmony"
for i in $chain_list; do
output=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' https://bsc-1.stakesquid-db.ml/$i)
if [ $output != '{"jsonrpc":"2.0","id":1,"result":false}' ]; then
send_message "$i not in sync"
fi
done