Skip to main content

Module terms

Module terms 

Source
Expand description

Operator-terms acceptance at registration (ADR 019 § Terms Acceptance).

The canonical operator terms ship embedded in the binary (TERMS_TEXT); their keccak256 is the exact preimage the on-chain currentTermsHash commits to. Before signing registerNode, the CLI shows the operator the terms and records an explicit affirmative acknowledgement — interactively on a terminal, or via --accept-terms for headless/automated provisioning.

Enforcement is deliberately split: decide is the pure policy (unit tested), and ensure_accepted is the thin IO wrapper that displays the terms and prompts.

Enums§

Decision
Outcome of the acceptance policy given the invocation context.

Constants§

TERMS_TEXT
The canonical operator terms, embedded from this crate’s TERMS.md so the displayed text is the exact preimage of the recorded hash — there is no external document to fetch or substitute (ADR 019 § Terms Acceptance).

Functions§

decide
Pure acceptance policy. local is terms_hash; chain is the network’s currentTermsHash. The staleness check takes precedence over everything — we never sign a hash the operator was not shown, even with --accept-terms.
ensure_accepted
Enforce operator-terms acceptance before registration signs registerNode.
ensure_accepted_async
Async wrapper over ensure_accepted. The interactive branch does blocking stdin/stderr IO, so run the whole gate on a blocking thread rather than parking a tokio runtime worker while it waits for the operator.
terms_hash
keccak256 of the embedded terms — the value the operator’s signature commits to and which must equal the network’s on-chain currentTermsHash.
terms_version
Human-readable version pulled from the **Version:** line of TERMS.md (display only — the hash is the authoritative identifier).