package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Octez_smart_rollup_node.Snapshot_utilsSource

Snapshot archives creation and extraction

Sourcetype reader

The type of snapshot archive readers.

Sourcetype writer

The type of snapshot archive writers.

Sourceval stdlib_reader : reader

A reader for uncompressed files or snapshot archives.

Sourceval stdlib_writer : writer

A writer for uncompressed files or snapshot archives.

Sourceval gzip_reader : reader

A reader for compressed files or snapshot archives.

Sourceval gzip_writer : writer

A writer for compressed files or snapshot archives.

Sourcetype snapshot_version =
  1. | V0

Versioning of snapshot format. Only one version for now.

Sourcetype snapshot_metadata = {
  1. history_mode : Configuration.history_mode;
  2. address : Octez_smart_rollup.Address.t;
  3. head_level : int32;
  4. last_commitment : Octez_smart_rollup.Commitment.Hash.t;
}

Snapshot metadata for version 0. This information is written as a header of the archive snapshot file.

Sourceval create : reader -> writer -> snapshot_metadata -> dir:string -> include_file:(relative_path:string -> bool) -> dest:string -> unit

create reader writer metadata ~dir ~include_file ~dest creates a snapshot archive with the header metadata and the hierarchy of files in directory dir for which include_file returns true. The archive is produced in file dest.

Sourceval extract : reader -> writer -> (snapshot_metadata -> unit) -> snapshot_file:string -> dest:string -> unit

extract reader writer check_metadata ~snapshot_file ~dest extracts the snapshot archive snapshot_file in the directory dest. Existing files in dest with the same names are overwritten. The metadata header read from the snapshot is checked with check_metadata before beginning extraction.

Sourceval compress : snapshot_file:string -> string

compress ~snapshot_file compresses the snapshot archive snapshot_file of the form "path/to/snapshot.uncompressed" to a new file "path/to/snapshot" whose path is returned. snapshot_file is removed upon successful compression.