mithril_cardano_node_internal_database/
lib.rs

1#![warn(missing_docs)]
2//! This crate provides components to read the files of a Cardano node internal database, such as
3//! immutable files and ledger state snapshots, and compute digests from them.
4//! It includes observers, digesters and various helpers for file system operations.
5//!
6
7pub mod digesters;
8pub mod entities;
9mod immutable_file_observer;
10pub mod signable_builder;
11pub mod test;
12
13pub use immutable_file_observer::*;
14
15/// Directory name for the immutable files.
16pub const IMMUTABLE_DIR: &str = "immutable";
17/// Directory name for the ledger files.
18pub const LEDGER_DIR: &str = "ledger";
19/// Directory name for the volatile files.
20pub const VOLATILE_DIR: &str = "volatile";
21
22/// Returns the names of the files that compose an immutable trio.
23pub fn immutable_trio_names(
24    immutable_file_number: mithril_common::entities::ImmutableFileNumber,
25) -> Vec<String> {
26    vec![
27        format!("{:05}.chunk", immutable_file_number),
28        format!("{:05}.primary", immutable_file_number),
29        format!("{:05}.secondary", immutable_file_number),
30    ]
31}