/// Computes the manifest (chunk hashes, file hashes and root hash) of the
/// checkpoint rooted at `path`.
Computes the manifest (chunk hashes, file hashes and root hash) of the
checkpoint rooted at `path`.
Computes the manifest ( chunk hashes file hashes and root hash ) of the checkpoint rooted at ` path ` .
pub fn do_compute_manifest(path: PathBuf) -> Result<(), String> {
    let cp_layout = CheckpointLayout::<ReadOnly>::new(path, Height::new(0))
        .map_err(|e| format!("Failed to create checkpoint layout: {}", e))?;
    let metadata = cp_layout.system_metadata().deserialize().map_err(|e| {
        format!(
            "Failed to deserialize system metadata to determine the manifest version: {}",
            e
        )
    })?;
    let mut thread_pool =
        scoped_threadpool::Pool::new(ic_state_manager::NUMBER_OF_CHECKPOINT_THREADS);
    let metrics_registry = MetricsRegistry::new();
    let manifest_metrics = ManifestMetrics::new(&metrics_registry);
    let manifest = compute_manifest(
        &mut thread_pool,
        &manifest_metrics,
        &no_op_logger(),
        metadata.state_sync_version,
        cp_layout.raw_path(),
        DEFAULT_CHUNK_SIZE,
        None,
    )
    .map_err(|e| {
        format!(
            "Failed to compute manifest of checkpoint at {}: {}",
            cp_layout.raw_path().display(),
            e
        )
    })?;
    println!("{}", manifest);
    println!();
    println!("ROOT HASH: {}", hex::encode(manifest_hash(&manifest)));
    Ok(())
}
pub fn do_compute_manifest ( path : PathBuf ) -> Result < ( ) , String > { let cp_layout = CheckpointLayout :: < ReadOnly > :: new ( path , Height :: new ( 0 ) ) . map_err ( | e | format ! ( " " e ) ) ? ; let metadata = cp_layout . system_metadata ( ) . deserialize ( ) . map_err ( | e | { format ! ( " " e ) } ) ? ; let mut thread_pool = scoped_threadpool :: Pool :: new ( ic_state_manager :: NUMBER_OF_CHECKPOINT_THREADS ) ; let metrics_registry = MetricsRegistry :: new ( ) ; let manifest_metrics = ManifestMetrics :: new ( & metrics_registry ) ; let manifest = compute_manifest ( & mut thread_pool , & manifest_metrics , & no_op_logger ( ) , metadata . state_sync_version , cp_layout . raw_path ( ) , DEFAULT_CHUNK_SIZE , None , ) . map_err ( | e | { format ! ( " " cp_layout raw_path ( ) display ( ) e ) } ) ? ; println ! ( " " manifest ) ; println ! ( ) ; println ! ( " " hex encode ( manifest_hash ( manifest ) ) ) ; Ok ( ( ) ) }
Computes the manifest (chunk hashes, file hashes and root hash) of the
checkpoint rooted at `path`.
Computes the manifest ( chunk hashes file hashes and root hash ) of the checkpoint rooted at ` path ` .
path
PathBuf