mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
`lux dev start` could not bring up a node built from the current tree, for
three reasons that share a shape with the chain-segment rename: the CLI
spelled out an address the node had already left behind, and nothing failed
to compile.
The health service moved onto typed ops. /v1/health is gone, so every probe
written against it read a healthy node as unhealthy and every printed
endpoint sent a reader to a 404. route.Health, route.Liveness and
route.Readiness compose the three addresses the node answers on, next to
route.Chain and off the same base, and the ten call sites that had it
written out now ask for the one they mean: a probe polls readiness, a
report reads the full checks, a printed endpoint offers the report.
Two luxd flags no longer exist, and passing an unknown flag is fatal, so
the node refused the config before it read any of it:
--api-keystore-enabled the keystore API is gone
--automine-interval block cadence is the C-Chain's own
enable-automining, read by the block builder from
the chain config dir, not a node flag
The --automine duration flag went with the second: it named a knob that
does not exist.
`lux dev stop` looked only in the default data-dir, and otherwise pkill'd
anything whose command line carried a quorum size of one — a pattern that
fits every dev node on the machine, not just the one this command started.
It takes the same --data-dir as start now, resolved by the same function,
and reads the PID from there; no PID file is an answer rather than a reason
to guess.
Health gets composition but not the guard that pins chain addresses:
pkg/ssh still asks for health as a JSON-RPC method, and the whole
JSON-RPC-over-SSH family it belongs to is owed the same move onto typed
ops. A guard added before that migration would need an exemption for it,
and an exemption is how a guard rots.
Measured against luxd 1.36.181 (constants v1.6.4): start reaches ready,
prints /v1/chain/C/rpc and /v1/health/ops/health, both answer 200, and
stop interrupts the node it started and reports plainly when there is
none.
Co-authored-by: Hanzo Dev <[email protected]>
29 lines
1.1 KiB
Go
29 lines
1.1 KiB
Go
// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package route
|
|
|
|
// health is where the node's health service answers, and ops is the endpoint
|
|
// its typed operations hang from. Every service on the node is reachable the
|
|
// same way — /v1/info/ops, /v1/chain/P/ops — so the two are named once here
|
|
// and composed below.
|
|
const (
|
|
health = base + "/health"
|
|
ops = "/ops"
|
|
)
|
|
|
|
// Health is the node's full health report: every registered check, and the
|
|
// verdict over all of them. What to read when the answer matters more than
|
|
// the status code.
|
|
//
|
|
// uri is a node's base URL, or empty for the path alone.
|
|
func Health(uri string) string { return uri + health + ops + "/health" }
|
|
|
|
// Liveness is the probe that answers whether the process is up. Cheapest of
|
|
// the three, and the one to poll in a loop.
|
|
func Liveness(uri string) string { return uri + health + ops + "/liveness" }
|
|
|
|
// Readiness is the probe that answers whether the node will serve — up, and
|
|
// past bootstrap. What to wait on before calling a node started.
|
|
func Readiness(uri string) string { return uri + health + ops + "/readiness" }
|