knots-startos/check-synced.sh
Chris Guida 33350fdb87
Integration/0.21.1.2 (#15)
* upgrade to 0.3.0 and fix LICENSE

* add config script

* address review comments and update Makefile

* address review comments

* update manifest and move config to assets

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* add rpc health check

* get bitcoin running

* address pr comments

* fix reindex action

* add synced health check

* allow pruning to be disabled; fix backups and health checks

* fix backups

* add indexes and testnet3 to .backupignore, and add change warning for disabling pruning

* Fix EMBASSY_IP env var references
Update submodule (even though we just re-download from bitcoincore.org. The submodule does nothing.)
Remove change-warning from pruning disabled variant until I can figure out how to properly add it

* add starting phase to health checks

* add progress pct to sync healthck

* update to new healthck spec; update change-warning to warning; redirect gbci call stderr to stdout

* fix case where verification progress contains an exponent

* remove redirect from gbci; add tini to see if that fixes the 137s

* bump max dbcache to 8192

* convert synced hck to inject, remove severity

* add sigterm-timeout, lower max dbcache, and add more info about dbcache

* attempt to fix blank error messages (#29)

* attempt to fix blank error messages

* address pr comments, remove exit 0 since that happens anyway

* Bugfix/blank hck msgs (#33)

* attempt to fix blank error messages

* address pr comments, remove exit 0 since that happens anyway

* don't crash on auto-reindex

* also redirect stdout to fix running arm; add reindex.sh to Makefile

* actually stop after autoreindex (#35)

* cap dbcache at 1024 until a dynamic cap can be implemented

* remove softfork info from properties after active for 3 months (#40)

* Linux Sparrow Guide

* Wallets.md update

* Added note to instructions about default archival mode

* change -geinfo call to getrpcinfo, returns way faster

* add txindex

* reverse lan config

* enable ssl on rpc interface

* update sdk verify command in makefile

* Update Makefile to remove unnecessary build step

* update language for untested wallets

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
Co-authored-by: kn0wmad <kn0wmad@protonmail.com>
Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com>
2022-02-11 15:52:07 -07:00

28 lines
975 B
Bash
Executable File

#!/bin/bash
set -e
username=$(yq e '.rpc.username' /root/.bitcoin/start9/config.yaml)
password=$(yq e '.rpc.password' /root/.bitcoin/start9/config.yaml)
gbci_result=$(curl -s --user $username:$password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://bitcoind.embassy:8332/ )
error_code=$?
if [ $error_code -ne 0 ]; then
echo $gbci_result >&2
exit $error_code
fi
res=$(echo "$gbci_result" | yq e '.result' -)
err=$(echo "$gbci_result" | yq e '.error' -)
if [ "$res" = "null" ]; then
# Starting
exit 60
elif [ $(echo "$res" | yq e '.initialblockdownload' -) = "true" ]; then
progress=$(echo "$res" | yq e '.verificationprogress' -)
if [[ "$progress" = *"e"* ]]; then
progress="0"
fi
progress_pct=$( bc -l <<<"100*$progress" )
echo "Syncing blockchain. This may take several days. Progress: $(printf "%.2f" $progress_pct)%" >&2
exit 61
fi