@@ -47,13 +47,13 @@ def FirstNodeSettings(local):
4747 vconfig_path = local .buffer .vconfig_path
4848 vport = local .buffer .vport
4949
50- if os . getenv ( 'ARCHIVE_TTL' ) :
51- archive_ttl = int (os . getenv ( 'ARCHIVE_TTL' ) )
50+ if local . buffer . archive_ttl is not None :
51+ archive_ttl = int (local . buffer . archive_ttl )
5252 else :
5353 archive_ttl = 2592000 if local .buffer .mode == 'liteserver' else 86400
5454 state_ttl = None
55- if os . getenv ( 'STATE_TTL' ) :
56- state_ttl = int (os . getenv ( 'STATE_TTL' ) )
55+ if local . buffer . state_ttl is not None :
56+ state_ttl = int (local . buffer . state_ttl )
5757 archive_ttl -= state_ttl
5858 if archive_ttl == 0 :
5959 archive_ttl = 1 # todo: remove this when archive_ttl==0 will be allowed in node
@@ -93,16 +93,16 @@ def FirstNodeSettings(local):
9393 cmd = f"{ validatorAppPath } --threads { cpus } --daemonize --global-config { globalConfigPath } --db { ton_db_dir } --logname { tonLogPath } --verbosity 1"
9494 cmd += ttl_cmd
9595
96- if os . getenv ( 'ADD_SHARD' ) :
97- add_shard = os . getenv ( 'ADD_SHARD' )
96+ if local . buffer . add_shard is not None :
97+ add_shard = local . buffer . add_shard
9898 cmd += f' -M'
9999 for shard in add_shard .split ():
100100 cmd += f' --add-shard { shard } '
101101
102102 add2systemd (name = "validator" , user = vuser , start = cmd , pre = '/bin/sleep 2' ) # post="/usr/bin/python3 /usr/src/mytonctrl/mytoncore.py -e \"validator down\""
103103
104- if os . getenv ( 'PUBLIC_IP' ) :
105- ip = os . getenv ( 'PUBLIC_IP' )
104+ if local . buffer . public_ip is not None :
105+ ip = local . buffer . public_ip
106106 else :
107107 ip = get_own_ip ()
108108 addr = "{ip}:{vport}" .format (ip = ip , vport = vport )
@@ -204,13 +204,13 @@ def parse_block_value(local, block: str):
204204
205205
206206def download_archive_from_ts (local ):
207- archive_blocks = os .getenv ('ARCHIVE_BLOCKS' )
207+ if local .buffer .archive_blocks is None :
208+ return
209+ archive_blocks = local .buffer .archive_blocks
208210 downloads_path = '/var/ton-work/ts-downloads/'
209211 os .makedirs (downloads_path , exist_ok = True )
210212 subprocess .run (["chmod" , "o+wx" , downloads_path ])
211213
212- if archive_blocks is None :
213- return
214214 block_from , block_to = archive_blocks , None
215215 if len (archive_blocks .split ()) > 1 :
216216 block_from , block_to = archive_blocks .split ()
@@ -1189,7 +1189,7 @@ def SetInitialSync(local):
11891189def SetupCollator (local ):
11901190 if local .buffer .mode != "collator" :
11911191 return
1192- shards = os . getenv ( 'COLLATE_SHARD' , '' ) .split ()
1192+ shards = local . buffer . collate_shard .split ()
11931193 if not shards :
11941194 shards = ['0:8000000000000000' ]
11951195 local .add_log (f"Setting up collator for shards: { shards } " , "info" )
0 commit comments