2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2016-10-06 14:55:38 +04:00
|
|
|
(** Tezos - Versioned, block indexed (key x value) store *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** A block-indexed (key x value) store directory. *)
|
|
|
|
type index
|
|
|
|
|
|
|
|
(** A (key x value) store for a given block. *)
|
2017-02-24 20:17:53 +04:00
|
|
|
type t
|
|
|
|
type context = t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2016-10-06 14:55:38 +04:00
|
|
|
(** Open or initialize a versioned store at a given path. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
val init:
|
2017-02-24 20:17:53 +04:00
|
|
|
?patch_context:(context -> context Lwt.t) ->
|
2016-09-08 21:13:10 +04:00
|
|
|
root:string ->
|
|
|
|
index Lwt.t
|
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val commit_genesis:
|
|
|
|
index ->
|
|
|
|
id:Block_hash.t ->
|
|
|
|
time:Time.t ->
|
|
|
|
protocol:Protocol_hash.t ->
|
|
|
|
test_protocol:Protocol_hash.t ->
|
|
|
|
context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** {2 Generic interface} ****************************************************)
|
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
include Persist.STORE with type t := context
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** {2 Accessing and Updating Versions} **************************************)
|
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
exception Preexistent_context of Block_hash.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val exists: index -> Block_hash.t -> bool Lwt.t
|
2017-02-24 20:17:53 +04:00
|
|
|
val checkout: index -> Block_hash.t -> context option Lwt.t
|
|
|
|
val checkout_exn: index -> Block_hash.t -> context Lwt.t
|
2017-03-03 16:05:20 +04:00
|
|
|
val commit: Block_hash.t -> context -> unit Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** {2 Predefined Fields} ****************************************************)
|
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val get_protocol: context -> Protocol_hash.t Lwt.t
|
|
|
|
val set_protocol: context -> Protocol_hash.t -> context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val get_test_protocol: context -> Protocol_hash.t Lwt.t
|
|
|
|
val set_test_protocol: context -> Protocol_hash.t -> context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-03-31 15:04:05 +04:00
|
|
|
val get_test_network: context -> Net_id.t option Lwt.t
|
|
|
|
val set_test_network: context -> Net_id.t -> context Lwt.t
|
2017-02-24 20:17:53 +04:00
|
|
|
val del_test_network: context -> context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val get_test_network_expiration: context -> Time.t option Lwt.t
|
|
|
|
val set_test_network_expiration: context -> Time.t -> context Lwt.t
|
|
|
|
val del_test_network_expiration: context -> context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val read_and_reset_fork_test_network: context -> (bool * context) Lwt.t
|
|
|
|
val fork_test_network: context -> context Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-25 21:01:27 +04:00
|
|
|
val set_fitness: context -> Fitness.fitness -> context Lwt.t
|
|
|
|
val get_fitness: context -> Fitness.fitness Lwt.t
|
|
|
|
|
2017-03-03 16:05:20 +04:00
|
|
|
val set_timestamp: context -> Time.t -> context Lwt.t
|
|
|
|
val get_timestamp: context -> Time.t Lwt.t
|
|
|
|
|
|
|
|
val set_commit_message: context -> string -> context Lwt.t
|
|
|
|
|
2017-02-24 20:17:53 +04:00
|
|
|
val init_test_network:
|
|
|
|
context -> time:Time.t -> genesis:Block_hash.t -> context tzresult Lwt.t
|