use of tech.pegasys.teku.core.signatures.SlashingProtector in project teku by ConsenSys.
the class ValidatorClientService method createValidatorLoader.
private static ValidatorLoader createValidatorLoader(final ValidatorClientConfiguration config, final AsyncRunner asyncRunner, final ServiceConfig services) {
final Path slashingProtectionPath = getSlashingProtectionPath(services.getDataDirLayout());
final SlashingProtector slashingProtector = new LocalSlashingProtector(SyncDataAccessor.create(slashingProtectionPath), slashingProtectionPath);
final SlashingProtectionLogger slashingProtectionLogger = new SlashingProtectionLogger(slashingProtector, config.getSpec(), asyncRunner, ValidatorLogger.VALIDATOR_LOGGER);
return ValidatorLoader.create(config.getSpec(), config.getValidatorConfig(), config.getInteropConfig(), slashingProtector, slashingProtectionLogger, new PublicKeyLoader(), asyncRunner, services.getMetricsSystem(), config.getValidatorRestApiConfig().isRestApiEnabled() ? Optional.of(services.getDataDirLayout()) : Optional.empty());
}
Aggregations