@@ -63,6 +63,7 @@ func NewCommand() *cobra.Command {
63
63
newTransformElasticSubnetsCommand (),
64
64
newAddPermissionlessValidatorCommand (),
65
65
newAddPermissionlessDelegatorCommand (),
66
+ newAddSubnetValidatorsCommand (),
66
67
newRemoveSubnetValidatorCommand (),
67
68
newHealthCommand (),
68
69
newWaitForHealthyCommand (),
@@ -444,6 +445,16 @@ func newAddPermissionlessValidatorCommand() *cobra.Command {
444
445
return cmd
445
446
}
446
447
448
+ func newAddSubnetValidatorsCommand () * cobra.Command {
449
+ cmd := & cobra.Command {
450
+ Use : "add-subnet-validators validatorsSpec [options]" ,
451
+ Short : "Adds subnet validators" ,
452
+ RunE : addSubnetValidatorsFunc ,
453
+ Args : cobra .ExactArgs (1 ),
454
+ }
455
+ return cmd
456
+ }
457
+
447
458
func newRemoveSubnetValidatorCommand () * cobra.Command {
448
459
cmd := & cobra.Command {
449
460
Use : "remove-subnet-validator removeValidatorSpec [options]" ,
@@ -538,6 +549,34 @@ func addPermissionlessValidatorFunc(_ *cobra.Command, args []string) error {
538
549
return nil
539
550
}
540
551
552
+ func addSubnetValidatorsFunc (_ * cobra.Command , args []string ) error {
553
+ cli , err := newClient ()
554
+ if err != nil {
555
+ return err
556
+ }
557
+ defer cli .Close ()
558
+
559
+ validatorSpecsStr := args [0 ]
560
+
561
+ validatorSpecs := []* rpcpb.SubnetValidatorsSpec {}
562
+ if err := json .Unmarshal ([]byte (validatorSpecsStr ), & validatorSpecs ); err != nil {
563
+ return err
564
+ }
565
+
566
+ ctx := getAsyncContext ()
567
+
568
+ info , err := cli .AddSubnetValidators (
569
+ ctx ,
570
+ validatorSpecs ,
571
+ )
572
+ if err != nil {
573
+ return err
574
+ }
575
+
576
+ ux .Print (log , logging .Green .Wrap ("add-subnet-validators response: %+v" ), info )
577
+ return nil
578
+ }
579
+
541
580
func removeSubnetValidatorFunc (_ * cobra.Command , args []string ) error {
542
581
cli , err := newClient ()
543
582
if err != nil {
0 commit comments