Expand description
zcashd datadir and config-file bootstrap for zcashd-compat mode.
Spec:
- Zebra may create the supervised
zcashddatadir and a first-start config. - Zebra must never overwrite an operator-provided config file.
- The datadir prepared here must match the datadir zcashd will actually use after command-line overrides are applied.
- Existing configs are audited for known zcashd-compat startup issues, then left unchanged.
- Missing configs are bootstrapped so
zcashd -zebra-compatcan start without manual first-run setup.
ConstantsΒ§
- BOOTSTRAP_
ZCASH_ CONF - Minimal config that lets zcashd start in zcashd-compat mode on first use.
- DEFAULT_
ZCASHD_ πDATADIR - The default zcashd-compat datadir name under Zebraβs state cache directory.
- OVERRIDDEN_
P2P_ πBOOL_ OPTIONS - VALIDATION_
ERROR_ πOPTIONS - ZCASH_
CONF_ πFILENAME - The default zcashd config filename.
FunctionsΒ§
- audit_
zcash_ πconf - Audits existing configs without modifying them.
- effective_
zcashd_ datadir - Returns the effective datadir used by supervised
zcashd. - ensure_
zcashd_ datadir - Ensures the supervised
zcashddatadir and effective config file are ready. - find_
conf_ πarg - Extracts the last valid
-conf=<path>value from Zebraβs extra args. - find_
datadir_ πarg - Extracts the last valid
-datadir=<path>value from Zebraβs extra args. - find_
last_ πpath_ arg_ value - Extracts the last valid
-<name>=<path>value from Zebraβs extra args. - is_
truthy π - parse_
zcash_ πconf_ entries - record_
path_ πarg_ value - resolve_
zcashd_ πconf_ path - Resolves the last valid
-conf=<path>we can infer from extra args. - resolve_
zcashd_ datadir_ path - Applies the last valid
-datadir=<path>command-line override, like zcashd. - unique_
temp_ πconf_ path - write_
bootstrap_ πzcash_ conf - Writes the bootstrap config without clobbering an operator-created file.