@@ -190,10 +190,22 @@ def quickstart():
190190 type = bool ,
191191 default = True ,
192192 )
193+ fork_observer_query_interval = 20
194+ if fork_observer :
195+ fork_observer_query_interval = click .prompt (
196+ click .style (
197+ "\n How often would you like fork-observer to query node status (seconds)?" ,
198+ fg = "blue" ,
199+ bold = True ,
200+ ),
201+ type = int ,
202+ default = 20 ,
203+ )
193204
194205 click .secho ("\n Creating project structure..." , fg = "yellow" , bold = True )
195206 project_path = Path (os .path .expanduser (proj_answers ["project_path" ]))
196207 create_warnet_project (project_path )
208+
197209 click .secho ("\n Generating custom network..." , fg = "yellow" , bold = True )
198210 custom_network_path = project_path / "networks" / answers ["network_name" ]
199211 custom_graph (
@@ -202,10 +214,17 @@ def quickstart():
202214 answers ["version" ],
203215 custom_network_path ,
204216 fork_observer ,
217+ fork_observer_query_interval ,
205218 )
206219 click .secho ("\n Setup completed successfully!" , fg = "green" , bold = True )
207- click .echo ("\n Run the following command to deploy this network:" )
220+
221+ click .echo (
222+ f"\n Edit the network files found in { custom_network_path } before deployment if you want to customise the network."
223+ )
224+
225+ click .echo ("\n When you're ready, run the following command to deploy this network:" )
208226 click .echo (f"warnet deploy { custom_network_path } " )
227+
209228 except Exception as e :
210229 click .echo (f"{ e } \n \n " )
211230 click .secho (f"An error occurred while running the quick start script:\n \n { e } \n \n " , fg = "red" )
@@ -368,7 +387,12 @@ def logs(pod_name: str, follow: bool):
368387
369388
370389def custom_graph (
371- num_nodes : int , num_connections : int , version : str , datadir : Path , fork_observer : bool
390+ num_nodes : int ,
391+ num_connections : int ,
392+ version : str ,
393+ datadir : Path ,
394+ fork_observer : bool ,
395+ fork_obs_query_interval : int ,
372396):
373397 datadir .mkdir (parents = False , exist_ok = False )
374398 # Generate network.yaml
@@ -400,7 +424,10 @@ def custom_graph(
400424 nodes .append (node )
401425
402426 network_yaml_data = {"nodes" : nodes }
403- network_yaml_data ["fork_observer" ] = fork_observer
427+ network_yaml_data ["fork_observer" ] = {
428+ "enabled" : fork_observer ,
429+ "configQueryInterval" : fork_obs_query_interval ,
430+ }
404431
405432 with open (os .path .join (datadir , "network.yaml" ), "w" ) as f :
406433 yaml .dump (network_yaml_data , f , default_flow_style = False )
0 commit comments