Module Mavkit_node_config.Data_version

type Mavryk_base.TzPervasives.error +=
  1. | Invalid_data_dir of {
    1. data_dir : string;
    2. msg : string option;
    }

Errors related to checks related to the data dir.

type Mavryk_base.TzPervasives.error +=
  1. | Could_not_read_data_dir_version of string

Default file names to store the information about the node's network identity, peers and configuration.

val default_identity_file_name : string
val default_config_file_name : string
val default_peers_file_name : string
type ensure_mode =
  1. | Exists
  2. | Is_bare
  3. | Is_compatible

Defines the properties that must be satisfied by the call to ensure_data_dir.

Depending of the given mode, it will:

  • Exists: ensures that the directory exists, if not, creates a fresh directory by creating it and writing a version file.
  • Is_bare: ensures that, if the directory exists, it contains no other file than:
  • the version file;
  • the identity file;
  • the configuration file;
  • the peer list file; Otherwise, creates an fresh directory.
  • Is_compatible: similar to Exists but, additionally, will check the version compatibility.
val ensure_data_dir : ?mode:ensure_mode -> Mavryk_base.Genesis.t -> string -> unit Mavryk_base.TzPervasives.tzresult Lwt.t

ensure_data_dir ~mode genesis data_dir ensures that a directory is valid with regards to the given mode. See ensure_mode for the mode's properties. By default, the mode is set to Is_compatible.

val upgrade_data_dir : data_dir:string -> Mavryk_base.Genesis.t -> chain_name:Mavryk_base.Distributed_db_version.Name.t -> sandbox_parameters: (string * Mavryk_base.TzPervasives.Data_encoding.json) option -> unit Mavryk_base.TzPervasives.tzresult Lwt.t

Upgrade data directory from an older version.

upgrade_data_dir dir genesis ~chain_name ~sandbox_parameters checks if an upgrade of the given data directory dir is available. If the data directory is upgradable then the upgrade is performed. Otherwise, nothing is done.

val store_dir : string -> string

store_dir dir is a directory within dir that the node uses for its store. In order for store_dir dir to be valid, dir must be a valid directory name.

val context_dir : string -> string

context_dir dir is a directory within dir that the node uses for its context. In order for context_dir dir to be valid, dir must be a valid directory name.

val protocol_dir : string -> string

protocol_dir dir is a directory within dir that the node uses for its protocol. In order for protocol_dir dir to be valid, dir must be a valid directory name.

val lock_file : string -> string

lock_file dir is a file within dir that the node uses for its lock. In order for lock_file dir to be valid, dir must be a valid directory name.

val upgrade_status : string -> unit Mavryk_base.TzPervasives.tzresult Lwt.t