package tezos-store

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

Source file snapshots_events.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2019 Dynamic Ledger Solutions, Inc. <contact@tezos.com>     *)
(* Copyright (c) 2019-2021 Nomadic Labs. <nomadic@tezcore.com>               *)
(*                                                                           *)
(* Permission is hereby granted, free of charge, to any person obtaining a   *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense,  *)
(* and/or sell copies of the Software, and to permit persons to whom the     *)
(* Software is furnished to do so, subject to the following conditions:      *)
(*                                                                           *)
(* The above copyright notice and this permission notice shall be included   *)
(* in all copies or substantial portions of the Software.                    *)
(*                                                                           *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL   *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING   *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER       *)
(* DEALINGS IN THE SOFTWARE.                                                 *)
(*                                                                           *)
(*****************************************************************************)

open Store_types

module Event = struct
  include Internal_event.Simple

  let section = ["node"; "snapshots"]

  (* Notice *)
  let export_info =
    declare_3
      ~section
      ~level:Notice
      ~name:"export_info"
      ~msg:
        "exporting a snapshot (v{version}) in {history_mode} mode, targeting \
         block hash {block}"
      ~pp1:Format.pp_print_int
      ("version", Data_encoding.int31)
      ~pp2:History_mode.pp_short
      ("history_mode", History_mode.encoding)
      ~pp3:pp_block_descriptor
      ("block", block_descriptor_encoding)

  let export_success =
    declare_1
      ~section
      ~level:Notice
      ~name:"export_success"
      ~msg:"successful export: {filename}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let cleaning_tmp_export_directory =
    declare_1
      ~section
      ~level:Notice
      ~name:"cleaning_tmp_export_directory"
      ~msg:"cleaning leftover export directory '{filename}'"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let import_info =
    declare_2
      ~section
      ~level:Notice
      ~name:"import_info"
      ~msg:"importing data from snapshot {filename}: {header}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)
      ~pp2:Format.pp_print_string
      ("header", Data_encoding.(string))

  let import_unspecified_hash =
    declare_0
      ~section
      ~level:Notice
      ~name:"import_unspecified_hash"
      ~msg:
        "you may consider using the --block <block_hash> argument to ensure \
         that the block imported is the one you expected"
      ()

  let import_loading =
    declare_0
      ~section
      ~level:Notice
      ~name:"import_loading"
      ~msg:
        "retrieving and validating data. This can take a while, please bear \
         with us"
      ()

  let import_success =
    declare_1
      ~section
      ~level:Notice
      ~name:"import_succes"
      ~msg:"successful import from file {filename}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let cleaning_after_failure =
    declare_0
      ~section
      ~level:Notice
      ~name:"cleaning_after_failure"
      ~msg:"cleaning up artifacts after failure"
      ()

  let suggest_no_check =
    declare_0
      ~section
      ~level:Notice
      ~name:"suggest_no_check"
      ~msg:
        "Note: the import of a snapshot can be sped up using the '--no-check' \
         option. Only use this option if you fully trust the snapshot source."
      ()

  (* Info *)
  let validate_protocol_sources =
    declare_1
      ~section
      ~level:Notice
      ~name:"validate_protocol_sources"
      ~msg:"validating protocol {hash} against sources"
      ~pp1:Protocol_hash.pp
      ("hash", Protocol_hash.encoding)

  (* Warning *)
  let warn_no_check =
    declare_0
      ~section
      ~level:Warning
      ~name:"warn_no_check"
      ~msg:
        "Warning: to speed up the import, the consistency of the imported data \
         will not be fully checked. It is not recommended to use this option \
         with a snapshot downloaded from an untrusted source"
      ()
end
OCaml

Innovation. Community. Security.