@@ -30,7 +30,7 @@ NET_CONFIG_PATH = CONFIG_PATH / "network_configs"
3030SCRIPT_NAME = "casper-node-util"
3131NODE_IP = "127.0.0.1"
3232# Below is automatically replaced. Modify set_version.py if changing
33- VERSION = "1.0.8 "
33+ VERSION = "1.0.9 "
3434
3535def get_value_in_section (lines , section_name , value_name ):
3636 """ A bit of a hack due to toml not being in std lib """
@@ -516,6 +516,47 @@ class NodeUtil:
516516 ip = str (args .ip ) if args .ip else None
517517 self ._config_from_example (args .protocol_version , ip , args .replace )
518518
519+ def stage_single_protocol (self ):
520+ """Stage a single protocol without checking if available"""
521+ parser = argparse .ArgumentParser (description = self .stage_protocols .__doc__ ,
522+ usage = (f"{ SCRIPT_NAME } stage_single_protocol [-h] config protocol_version "
523+ "[--ip IP] [--replace toml_file]" ))
524+ parser .add_argument ("config" , type = str , help = f"name of config file to use from { NET_CONFIG_PATH } " )
525+ parser .add_argument ("protocol_version" , type = str , help = f"protocol version to pull (x_y_z)" )
526+ parser .add_argument ("--ip" ,
527+ type = ip_address ,
528+ help = f"optional ip to use for config.toml instead of detected ip." ,
529+ required = False )
530+ parser .add_argument ("--replace" ,
531+ type = str ,
532+ help = ("optional toml file that holds replacements to make to config.toml "
533+ "from config-example.toml" ),
534+ required = False )
535+ args = parser .parse_args (sys .argv [2 :])
536+ self ._load_config_values (args .config )
537+
538+ verify_casper_user ()
539+ exit_code = 0
540+ pv = args .protocol_version
541+ status = self ._check_staged_version (pv )
542+ if status == StagedStatus .STAGED :
543+ print (f"{ pv } : { status } " )
544+ elif status in (StagedStatus .BIN_ONLY , StagedStatus .CONFIG_ONLY ):
545+ print (f"{ pv } : { status } - Not automatically recoverable." )
546+ exit_code = 1
547+ if status == StagedStatus .UNSTAGED :
548+ print (f"Pulling protocol for { pv } ." )
549+ if not self ._pull_protocol_version (pv ):
550+ exit_code = 1
551+ if status in (StagedStatus .UNSTAGED , StagedStatus .NO_CONFIG ):
552+ print (f"Creating config for { pv } ." )
553+ ip = str (args .ip ) if args .ip else None
554+ if not self ._config_from_example (pv , ip , args .replace ):
555+ exit_code = 1
556+ exit (exit_code )
557+
558+
559+
519560 def stage_protocols (self ):
520561 """Stage available protocols if needed (use 'sudo -u casper')"""
521562 parser = argparse .ArgumentParser (description = self .stage_protocols .__doc__ ,
0 commit comments