11from modules .module import MtcModule
22from mypylib import color_print , print_table
3- from mytoncore import b642hex
3+ from mytoncore import b642hex , signed_int_to_hex64
44from mytonctrl .utils import pop_arg_from_args
55
66
@@ -44,7 +44,11 @@ def setup_collator(self, args: list):
4444 shards_need_to_add = [shard for shard in shards if shard not in node_args ['--add-shard' ]]
4545 if shards_need_to_add :
4646 set_node_argument (self .local , ['--add-shard' , ' ' .join (node_args ['--add-shard' ] + shards_need_to_add )])
47- self .local .add_log (f'Collator enabled for shards { shards } \n ' )
47+ commands_text = [f'`add_collator { s } { adnl_addr } `' for s in shards ]
48+ self .local .add_log (f'Collator enabled for shards { shards } \n '
49+ f'To add this collator to validator use command:\n '
50+ + '\n ' .join (commands_text ))
51+ color_print ("setup_collator - {green}OK{endc}" )
4852
4953 def get_collators (self ):
5054 return self .ton .GetValidatorConfig ()['collators' ]
@@ -57,7 +61,7 @@ def print_collators(self, args: list = None):
5761 print ("Collators list:" )
5862 table = [['ADNL Address' , 'Shard' ]]
5963 for c in collators :
60- table .append ([b642hex (c ['adnl_id' ]).upper (), f"{ c ['shard' ]['workchain' ]} :{ c ['shard' ]['shard' ]} " ])
64+ table .append ([b642hex (c ['adnl_id' ]).upper (), f"{ c ['shard' ]['workchain' ]} :{ signed_int_to_hex64 ( int ( c ['shard' ]['shard' ])) } " ])
6165 print_table (table )
6266
6367
0 commit comments