Skip to content

Commit 3e13f4c

Browse files
authored
Add documentation and full_node ports endpoint (#68)
1 parent ca5fa40 commit 3e13f4c

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

internal/healthcheck/fullnode.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,10 @@ func (h *Healthcheck) fullNodeLiveness() func(http.ResponseWriter, *http.Request
8686
timeMetricHealthcheckHelper(h.lastHeightTime, w, r)
8787
}
8888
}
89+
90+
// Ports endpoint will be successful when the full node peer and RPC ports are listening on the host
91+
func (h *Healthcheck) fullNodePorts() func(http.ResponseWriter, *http.Request) {
92+
return func(w http.ResponseWriter, r *http.Request) {
93+
timeMetricHealthcheckHelper(h.lastFullNodeActivity, w, r)
94+
}
95+
}

internal/healthcheck/healthcheck.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func (h *Healthcheck) StartServer() error {
9494
http.HandleFunc("/full_node/startup", h.fullNodeStartup())
9595
http.HandleFunc("/full_node/readiness", h.fullNodeReadiness())
9696
http.HandleFunc("/full_node/liveness", h.fullNodeLiveness())
97+
http.HandleFunc("/full_node/ports", h.fullNodePorts())
9798
http.HandleFunc("/seeder", h.seederHealthcheck())
9899
http.HandleFunc("/seeder/readiness", h.seederReadiness())
99100
http.HandleFunc("/timelord", h.timelordHealthcheck())

readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,19 @@ To use a config file, create a new yaml file and place any configuration options
5959
```yaml
6060
healthcheck-port: 9950
6161
```
62+
63+
## Healthcheck Endpoints
64+
65+
This is the comprehensive list of endpoints currently available for Chia healthchecking purposes by this service.
66+
67+
* `/full_node` - Checks that the local full_node sync height is increasing.
68+
* `/full_node/startup` - Checks that the local full_node sync height is increasing.
69+
* `/full_node/liveness` - Checks that the local full_node sync height is increasing.
70+
* `/full_node/readiness` - Checks that the local full_node is synced to the full chain.
71+
* `/full_node/ports` - Checks that the full_node peer and RPC ports are bound.
72+
* `/seeder` - Checks the local seeder and ensures the resolver responds with at least one peer IP address.
73+
* `/seeder/readiness` - Checks the local seeder and ensures the resolver responds.
74+
* `/timelord` - Checks the local timelord and ensures it is finishing proofs of time.
75+
* `/timelord/readiness` - Checks the local timelord and ensures it is finishing proofs of time.
76+
77+
Other Chia components and endpoints may be added to this list over time.

0 commit comments

Comments
 (0)