Search in sources :

Example 1 with SlashingProtector

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());
}
Also used : Path(java.nio.file.Path) PublicKeyLoader(tech.pegasys.teku.validator.client.loader.PublicKeyLoader) SlashingProtectionLogger(tech.pegasys.teku.validator.client.loader.SlashingProtectionLogger) LocalSlashingProtector(tech.pegasys.teku.core.signatures.LocalSlashingProtector) SlashingProtector(tech.pegasys.teku.core.signatures.SlashingProtector) LocalSlashingProtector(tech.pegasys.teku.core.signatures.LocalSlashingProtector)

Aggregations

Path (java.nio.file.Path)1 LocalSlashingProtector (tech.pegasys.teku.core.signatures.LocalSlashingProtector)1 SlashingProtector (tech.pegasys.teku.core.signatures.SlashingProtector)1 PublicKeyLoader (tech.pegasys.teku.validator.client.loader.PublicKeyLoader)1 SlashingProtectionLogger (tech.pegasys.teku.validator.client.loader.SlashingProtectionLogger)1