Module Mavryk_mockup.Persistence

include Persistence_intf.S

Returns a mockup environment for the default protocol (which is the first in the list of registered protocol, cf Registration module).

val init_mockup_context_by_protocol_hash : cctxt:Mavryk_client_base.Client_context.printer -> protocol_hash:Mavryk_base.TzPervasives.Protocol_hash.t -> constants_overrides_json:Mavryk_base.TzPervasives.Data_encoding.json option -> bootstrap_accounts_json:Mavryk_base.TzPervasives.Data_encoding.json option -> (Mavryk_mockup_registration.Registration.mockup_environment * Mavryk_mockup_registration.Registration.mockup_context) Mavryk_base.TzPervasives.tzresult Lwt.t

Returns a mockup environment for the specified protocol hash.

Load a mockup environment and initializes a protocol RPC context from a mockup base directory. If the protocol is specified, check that the loaded environment agrees with it.

val create_mockup : cctxt:Mavryk_client_base.Client_context.full -> protocol_hash:Mavryk_base.TzPervasives.Protocol_hash.t -> constants_overrides_json:Mavryk_base.TzPervasives.Data_encoding.json option -> bootstrap_accounts_json:Mavryk_base.TzPervasives.Data_encoding.json option -> asynchronous:bool -> unit Mavryk_base.TzPervasives.tzresult Lwt.t

Initializes an on-disk mockup environment in base_dir for the specified protocol.

val overwrite_mockup : protocol_hash:Mavryk_base.TzPervasives.Protocol_hash.t -> chain_id:Mavryk_base.TzPervasives.Chain_id.t -> rpc_context:Mavryk_protocol_environment.rpc_context -> protocol_data:bytes -> base_dir:string -> unit Mavryk_base.TzPervasives.tzresult Lwt.t

Overwrites an on-disk mockup environment.

Base directory states

type base_dir_class =
  1. | Base_dir_does_not_exist
  2. | Base_dir_is_file
  3. | Base_dir_is_mockup
  4. | Base_dir_is_nonempty
  5. | Base_dir_is_empty
val pp_base_dir_class : Stdlib.Format.formatter -> base_dir_class -> unit
val classify_base_dir : string -> base_dir_class Mavryk_base.TzPervasives.tzresult Lwt.t

Test whether base directory is a valid target for loading or creating a mockup environment.

module type S = Persistence_intf.S
module Internal_for_tests : sig ... end