StructsΒ§
- Supervisor
Config - The full configuration used by the zcashd-compat supervisor task.
EnumsΒ§
- Child
Outcome π
ConstantsΒ§
- PEER_
SELECTION_ πOPTIONS - zcashd options that add P2P peers and accumulate across the command line,
so the supervisorβs own
-connectcannot override them. - SUPERVISOR_
ACTIVE_ πMETRIC - SUPERVISOR_
DISABLED_ πMETRIC - SUPERVISOR_
EXHAUSTED_ πMETRIC
StaticsΒ§
- SUPERVISED_
ZCASHD_ πPID - The pid of the currently running supervised zcashd child, or
0when none.
FunctionsΒ§
- is_
command_ resolvable - Returns
trueif the given command path is resolvable as an executable. - is_
executable π - Returns
truewhenpathpoints to an executable regular file. - reject_
peer_ selection_ extra_ args - Rejects
zcashd_extra_argsentries that would change which peers the supervised zcashd talks to. - restart_
backoff_ πdelay - Calculates capped exponential restart backoff from the base delay and consecutive exit count.
- run
- Runs the zcashd-compat zcashd supervisor until shutdown.
- sanitize_
child_ πlog_ line - Returns a sanitized log line with ANSI escape/control noise removed.
- set_
supervision_ πactive_ metrics - set_
supervision_ config_ disabled_ metrics - Sets metrics for zcashd-compat mode when zcashd supervision is intentionally disabled.
- set_
supervision_ πinactive_ metrics - set_
supervision_ unexpectedly_ disabled_ metrics - Sets metrics for zcashd-compat mode when supervision has unexpectedly stopped.
- should_
reset_ πrestart_ count - Returns
truewhen a child ran long enough to make previous failures stale. - spawn_
log_ πtask - Forwards a child output stream into Zebra logs under
zcashd_compat.zcashd. - spawn_
zcashd π - Spawns
zcashdwith zcashd-compat arguments and connects child output streams. - terminate_
abandoned_ zcashd - Terminates a supervised zcashd child that the supervisor task never got to shut down, blocking the calling thread.
- terminate_
child π - Attempts graceful termination of the zcashd-compat child process.
- wait_
for_ πchild_ or_ shutdown - Waits until either a shutdown request arrives or the child exits.
- wait_
for_ πdelay_ or_ shutdown - Waits for
delayto elapse, returningtrueif shutdown is requested first.