You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnf'Send the number of seconds to keep the block data in the node database. Default is {default_archive_ttl} to keep archive blocks from {datetime.datetime.fromtimestamp(utime-datetime.timedelta(days=30).total_seconds())}\nOr send -1 to keep downloaded blocks always (recommended).'
28
+
29
+
30
+
defis_valid_date_format(date_str):
31
+
try:
32
+
datetime.datetime.strptime(date_str, '%Y-%m-%d')
33
+
returnTrue
34
+
exceptValueError:
35
+
returnFalse
36
+
37
+
38
+
defvalidate_archive_blocks(_, value):
39
+
ifnotvalue:
40
+
returnTrue
41
+
parts=value.split()
42
+
iflen(parts) >2:
43
+
returnFalse
44
+
45
+
forpartinparts:
46
+
ifpart.isdigit() andint(part) <0:
47
+
returnFalse
48
+
elifnotis_valid_date_format(part):
49
+
returnFalse
50
+
returnTrue
4
51
5
52
6
53
defrun_cli():
@@ -21,13 +68,6 @@ def run_cli():
21
68
ignore=lambdax: x["network"] !="Other", # do not ask this question if network is not 'Other'
22
69
validate=lambda_, x: x.startswith("http"),
23
70
),
24
-
inquirer.Text(
25
-
"archive-ttl",
26
-
message="Send the number of seconds to keep the block data in the node database. Default is 2592000 (30 days)",
27
-
ignore=lambdax: x["mode"] !="liteserver", # do not ask this question if mode is not liteserver
28
-
validate=lambda_, x: notxorx.isdigit(), # must be empty string or a number
29
-
# default=2592000
30
-
),
31
71
inquirer.List(
32
72
"validator-mode",
33
73
message="Select mode for validator usage. You can skip and set up this later",
@@ -36,9 +76,18 @@ def run_cli():
36
76
),
37
77
inquirer.Text(
38
78
"archive-blocks",
39
-
message="Do you want to download archive blocks via TON Storage? If yes, provide block seqno to start from or press Enter to skip.",
79
+
message="Do you want to download archive blocks via TON Storage? Press Enter to skip.\n"
80
+
"If yes, provide block seqno or date to start from and (optionally) block seqno or date to end with (send 0 to download all blocks and setup full archive node).\n"
0 commit comments