func (v *ValidatorApp) Run() error {
	blockchainRPC := pb.NewBlockchainRPCClient(v.config.BeaconConn)

	shardRPC := pb.NewShardRPCClient(v.config.ShardConn)

	keystore := validator.NewRootKeyStore(v.config.RootKey)

	logger.Info("Checking validator public keys...")

	for _, val := range v.config.ValidatorIndices {
		validatorProto, err := blockchainRPC.GetValidatorInformation(v.ctx, &pb.GetValidatorRequest{ID: uint32(val)})
		if err != nil {
			return err
		}

		v, err := primitives.ValidatorFromProto(validatorProto)
		if err != nil {
			return err
		}

		expectedPublicKey := keystore.GetPublicKeyForValidator(val).Serialize()

		if !bytes.Equal(expectedPublicKey[:], v.Pubkey[:]) {
			return fmt.Errorf("validator %d public key did not match current validator set", val)
		}
	}

	logger.Info("Validators successfully verified!")

	vm, err := validator.NewManager(v.ctx, blockchainRPC, shardRPC, v.config.ValidatorIndices, keystore, v.config.NetworkConfig)
	if err != nil {
		return err
	}

	return vm.Start()
}
// Run starts the validator app.
Run starts the validator app.
// Run starts the validator app .
func (v *ValidatorApp) Run() error {
	blockchainRPC := pb.NewBlockchainRPCClient(v.config.BeaconConn)
	shardRPC := pb.NewShardRPCClient(v.config.ShardConn)
	keystore := validator.NewRootKeyStore(v.config.RootKey)
	logger.Info("Checking validator public keys...")
	for _, val := range v.config.ValidatorIndices {
		validatorProto, err := blockchainRPC.GetValidatorInformation(v.ctx, &pb.GetValidatorRequest{ID: uint32(val)})
		if err != nil {
			return err
		}
		v, err := primitives.ValidatorFromProto(validatorProto)
		if err != nil {
			return err
		}
		expectedPublicKey := keystore.GetPublicKeyForValidator(val).Serialize()
		if !bytes.Equal(expectedPublicKey[:], v.Pubkey[:]) {
			return fmt.Errorf("validator %d public key did not match current validator set", val)
		}
	}
	logger.Info("Validators successfully verified!")
	vm, err := validator.NewManager(v.ctx, blockchainRPC, shardRPC, v.config.ValidatorIndices, keystore, v.config.NetworkConfig)
	if err != nil {
		return err
	}
	return vm.Start()
}
func ( v * ValidatorApp ) Run ( ) error { blockchainRPC := pb . NewBlockchainRPCClient ( v . config . BeaconConn ) shardRPC := pb . NewShardRPCClient ( v . config . ShardConn ) keystore := validator . NewRootKeyStore ( v . config . RootKey ) logger . Info ( " " ) for _ , val := range v . config . ValidatorIndices { validatorProto , err := blockchainRPC . GetValidatorInformation ( v . ctx , & pb . GetValidatorRequest { ID : uint32 ( val ) } ) if err != nil { return err } v , err := primitives . ValidatorFromProto ( validatorProto ) if err != nil { return err } expectedPublicKey := keystore . GetPublicKeyForValidator ( val ) . Serialize ( ) if ! bytes . Equal ( expectedPublicKey [ : ] , v . Pubkey [ : ] ) { return fmt . Errorf ( " " , val ) } } logger . Info ( " " ) vm , err := validator . NewManager ( v . ctx , blockchainRPC , shardRPC , v . config . ValidatorIndices , keystore , v . config . NetworkConfig ) if err != nil { return err } return vm . Start ( ) }
Run starts the validator app.
Run starts the validator app .