Skip to content

Commit 2783642

Browse files
authored
Merge pull request #268 from Chia-Network/healthchecks
2 parents 5432805 + b43fd79 commit 2783642

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docker-healthcheck.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ node_check=false
2424
farmer_check=false
2525
harvester_check=false
2626
wallet_check=false
27+
timelord_check=false
28+
crawler_check=false
2729

2830
# Determine which services to healthcheck based on ${service}
2931
# shellcheck disable=SC2154,SC2206
@@ -36,6 +38,8 @@ do
3638
farmer_check=true
3739
harvester_check=true
3840
wallet_check=true
41+
timelord_check=true
42+
crawler_check=true
3943
;;
4044
node)
4145
node_check=true
@@ -57,6 +61,18 @@ do
5761
farmer-only)
5862
farmer_check=true
5963
;;
64+
timelord)
65+
timelord_check=true
66+
;;
67+
timelord-only)
68+
timelord_check=true
69+
;;
70+
crawler)
71+
crawler_check=true
72+
;;
73+
seeder)
74+
crawler_check=true
75+
;;
6076
wallet)
6177
wallet_check=true
6278
;;
@@ -110,6 +126,32 @@ if [[ ${harvester_check} == "true" ]]; then
110126
fi
111127
fi
112128

129+
if [[ ${timelord_check} == "true" ]]; then
130+
curl -X POST --fail \
131+
--cert "${CHIA_ROOT}/config/ssl/timelord/private_timelord.crt" \
132+
--key "${CHIA_ROOT}/config/ssl/timelord/private_timelord.key" \
133+
-d '{}' -k -H "Content-Type: application/json" https://localhost:8557/healthz
134+
135+
# shellcheck disable=SC2181
136+
if [[ "$?" -ne 0 ]]; then
137+
logger "$(dt) Timelord healthcheck failed"
138+
exit 1
139+
fi
140+
fi
141+
142+
if [[ ${crawler_check} == "true" ]]; then
143+
curl -X POST --fail \
144+
--cert "${CHIA_ROOT}/config/ssl/crawler/private_crawler.crt" \
145+
--key "${CHIA_ROOT}/config/ssl/crawler/private_crawler.key" \
146+
-d '{}' -k -H "Content-Type: application/json" https://localhost:8561/healthz
147+
148+
# shellcheck disable=SC2181
149+
if [[ "$?" -ne 0 ]]; then
150+
logger "$(dt) Crawler healthcheck failed"
151+
exit 1
152+
fi
153+
fi
154+
113155
if [[ ${wallet_check} == "true" ]]; then
114156
curl -X POST --fail \
115157
--cert "${CHIA_ROOT}/config/ssl/wallet/private_wallet.crt" \

0 commit comments

Comments
 (0)