Module Tezos_layer2_store.Desync_snapshots

Module for handling incremental snapshots with desync.

type chunk_size = {
  1. min : int;
    (*

    The minimum chunk size.

    *)
  2. avg : int;
    (*

    The average chunk size.

    *)
  3. max : int;
    (*

    The maximum chunk size.

    *)
}

Defines the chunking strategy for the desync tool.

val default_chunk_size_arg : string
val export : ?desync_path:string -> ?chunk_size:chunk_size -> ?metadata:'a -> ?metadata_encoding:'a Tezos_base.TzPervasives.Data_encoding.t -> ?progress:bool -> target_store:string -> index_file:string -> backup_items:string list -> string -> unit Tezos_base.TzPervasives.tzresult Lwt.t

export ?desync_path ?chunk_size ?metadata ?metadata_encoding ?progress ~target_store ~index_file ~backup_items data_dir exports the given backup_items from the data_dir to a desync store at target_store and creates an index file at index_file.

  • parameter desync_path

    Path to the desync tool executable. If not provided, it will be looked for in the system's PATH.

  • parameter chunk_size

    Specifies the chunking strategy for the desync tool.

  • parameter metadata

    An optional value to be stored with the snapshot.

  • parameter metadata_encoding

    The encoding for the metadata.

  • parameter progress

    Displays a progress bar if true.

  • parameter target_store

    The path to the desync store.

  • parameter index_file

    The path where the index file will be created.

  • parameter backup_items

    A list of files and directories to be backed up.

  • parameter data_dir

    The directory where the items to backup are located.

val import : ?desync_path:string -> ?metadata_encoding:'a Tezos_base.TzPervasives.Data_encoding.t -> source_store:string -> index_file:string -> string -> 'a option Tezos_base.TzPervasives.tzresult Lwt.t

import ?desync_path ?metadata_encoding ~source_store ~index_file mount_point imports a snapshot from a desync store at source_store using the index file at index_file and restores it to the mount_point.

  • parameter desync_path

    Path to the desync tool executable. If not provided, it will be looked for in the system's PATH.

  • parameter metadata_encoding

    The encoding for the metadata. If provided, the function will return the decoded metadata if it is present.

  • parameter source_store

    The path to the desync store.

  • parameter index_file

    The path to the index file.

  • parameter mount_point

    The directory where the snapshot will be restored.

val read_metadata : ?desync_path:string -> source_store:string -> index_file:string -> 'a Tezos_base.TzPervasives.Data_encoding.t -> 'a Tezos_base.TzPervasives.tzresult Lwt.t

read_metadata ?desync_path ~source_store ~index_file encoding reads and decodes the metadata from the store without performing a full import.

  • parameter desync_path

    Path to the desync tool executable. If not provided, it will be looked for in the system's PATH.

  • parameter source_store

    The path to the desync store.

  • parameter index_file

    The path to the index file.

  • parameter encoding

    The data encoding for the metadata.

val info : ?desync_path:string -> string -> Ezjsonm.value Tezos_base.TzPervasives.tzresult Lwt.t

info ?desync_path index_file reads and returns information about a snapshot from its index file as a JSON object.

  • parameter desync_path

    Path to the desync tool executable. If not provided, it will be looked for in the system's PATH.

  • parameter index_file

    The path to the index file.