Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timelord and crawler healthchecks #268

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docker-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ node_check=false
farmer_check=false
harvester_check=false
wallet_check=false
timelord_check=false
crawler_check=false

# Determine which services to healthcheck based on ${service}
# shellcheck disable=SC2154,SC2206
Expand All @@ -36,6 +38,8 @@ do
farmer_check=true
harvester_check=true
wallet_check=true
timelord_check=true
crawler_check=true
;;
node)
node_check=true
Expand All @@ -57,6 +61,18 @@ do
farmer-only)
farmer_check=true
;;
timelord)
timelord_check=true
;;
timelord-only)
timelord_check=true
;;
crawler)
crawler_check=true
;;
seeder)
crawler_check=true
;;
wallet)
wallet_check=true
;;
Expand Down Expand Up @@ -110,6 +126,32 @@ if [[ ${harvester_check} == "true" ]]; then
fi
fi

if [[ ${timelord_check} == "true" ]]; then
curl -X POST --fail \
--cert "${CHIA_ROOT}/config/ssl/timelord/private_timelord.crt" \
--key "${CHIA_ROOT}/config/ssl/timelord/private_timelord.key" \
-d '{}' -k -H "Content-Type: application/json" https://localhost:8557/healthz

# shellcheck disable=SC2181
if [[ "$?" -ne 0 ]]; then
logger "$(dt) Timelord healthcheck failed"
exit 1
fi
fi

if [[ ${crawler_check} == "true" ]]; then
curl -X POST --fail \
--cert "${CHIA_ROOT}/config/ssl/crawler/private_crawler.crt" \
--key "${CHIA_ROOT}/config/ssl/crawler/private_crawler.key" \
-d '{}' -k -H "Content-Type: application/json" https://localhost:8561/healthz

# shellcheck disable=SC2181
if [[ "$?" -ne 0 ]]; then
logger "$(dt) Crawler healthcheck failed"
exit 1
fi
fi

if [[ ${wallet_check} == "true" ]]; then
curl -X POST --fail \
--cert "${CHIA_ROOT}/config/ssl/wallet/private_wallet.crt" \
Expand Down