Skip to main content

Crate witness_archiver

Crate witness_archiver 

Source
Expand description

Archiver of signed XRPL validations.

Subscribes to the node’s validation stream through its local admin port and writes the originals (raw signed validations) into archive segments. It exposes nothing to the outside.

Resilience:

  • the journal is flushed to disk once a second, so a crash loses at most that much;
  • on disconnect it reconnects with a growing pause of up to 5 s: the node is local, an attempt costs nothing, and every extra second of waiting is validations that cannot be recovered. After a successful connection the pause starts from one second again;
  • if the connection is up but no validations arrive for longer than --stall-secs, that also counts as a disconnect: the node may have hung while leaving the socket open;
  • every disconnect and recovery is written to gaps.jsonl as one line, with the last and first ledger around it, so gaps are visible instead of guessed. Failed reconnect attempts only go to the process log. Shutdown is logged too, so downtime during a restart can be explained from the journal.

Metrics are served on --metrics-addr, see the metrics module. Validator manifests: see the manifests module.

ModulesΒ§

manifests πŸ”’
Validator manifests: the link between a signing key and a master key.
metrics πŸ”’
Archiver metrics in Prometheus format, for any Prometheus-compatible scraper.
nunl πŸ”’
Negative UNL per flag ledger.

StructsΒ§

Args πŸ”’
Parsed πŸ”’
A validation from the stream: the archive record and the signer’s key, for counting validators. The key may be missing; the record is just as good.
Side πŸ”’
Supporting evidence the archiver requests from the node over the same connection: validator manifests and the Negative UNL.
Stats πŸ”’

EnumsΒ§

SessionEnd πŸ”’
How a single connection session ended.

ConstantsΒ§

MAX_BACKOFF πŸ”’

FunctionsΒ§

log_gap πŸ”’
lost πŸ”’
main πŸ”’
missing_count πŸ”’
parse_validation_value πŸ”’
run πŸ”’
session πŸ”’
shutdown_signal πŸ”’
start_metrics πŸ”’
Initial metrics state, from what is already on disk, plus the server.