Sigil documentation
ReferenceRust referencesigil-node

sigil-node · snapshot

Source declarations, signatures and documentation for snapshot.

Source: sigil/node/sigil-node/src/snapshot.rs. SHA-256: 597583224e0430ac01045fa4e9be21904462f2e39529bd55a93862753fab7cc6.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

snapshot::SnapshotManifest

Manifest committed next to every published snapshot.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SnapshotManifest {
/// Manifest schema version. Version 1 is the launch format.

pub schema_version: u32,
/// Chain ID this snapshot belongs to.

pub chain_id: String,
/// Finalized block height captured by the snapshot.

pub height: u64,
/// Hex-encoded state root at `height`.

pub state_root: String,
/// Optional canonical block hash at `height`.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub block_hash: Option<String>,
/// Optional archive payload URI, used by `latest.json` indirection.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub payload_uri: Option<String>,
/// Snapshot components present in the payload.

#[serde(default)]
pub components: Vec<String>
}

Source line: 31.

snapshot::SnapshotRestoreOutcome

Result returned after a successful restore.

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SnapshotRestoreOutcome {
/// Restored snapshot manifest.

pub manifest: SnapshotManifest,
/// Final data directory populated by the restore.

pub data_dir: PathBuf
}

Source line: 53.

snapshot::SnapshotManifest::validate_for_chain

Validate static manifest fields before trusting payload bytes.

pub fn validate_for_chain(&self, chain_id: &str) -> Result<(), NodeError>;

Source line: 62.

snapshot::restore_snapshot_from_uri

Restore a snapshot URI into data_dir and verify its committed state root.

pub async fn restore_snapshot_from_uri(
    uri: &str,
    data_dir: &Path,
    chain_id: &str,
    genesis: &GenesisConfig,
) -> Result<SnapshotRestoreOutcome, NodeError>;

Source line: 84.

snapshot::data_dir_empty_or_missing

Return true when startup may safely auto-restore into data_dir.

pub fn data_dir_empty_or_missing(data_dir: &Path) -> Result<bool, NodeError>;

Source line: 99.

On this page