use of tech.pegasys.teku.validator.api.ValidatorConfig in project teku by ConsenSys.
the class ExternalSignerUpcheckTLSIntegrationTest method buildExternalSignerUpcheck.
private static ExternalSignerUpcheck buildExternalSignerUpcheck(final URL serverUrl) {
final ValidatorConfig config = ValidatorConfig.builder().validatorExternalSignerPublicKeySources(List.of(KEYPAIR.getPublicKey().toString())).validatorExternalSignerUrl(serverUrl).validatorExternalSignerTimeout(TIMEOUT).validatorExternalSignerKeystore(TEKU_KEYSTORE).validatorExternalSignerKeystorePasswordFile(PASSWORD_FILE).validatorExternalSignerTruststore(EXTERNAL_SIGNER_TRUSTSTORE).validatorExternalSignerTruststorePasswordFile(PASSWORD_FILE).build();
final HttpClientExternalSignerFactory httpClientExternalSignerFactory = new HttpClientExternalSignerFactory(config);
return new ExternalSignerUpcheck(httpClientExternalSignerFactory.get(), config.getValidatorExternalSignerUrl(), config.getValidatorExternalSignerTimeout());
}
use of tech.pegasys.teku.validator.api.ValidatorConfig in project teku by ConsenSys.
the class ValidatorOptionsTest method shouldDisableSlashingProtectionForExternalSigners.
@Test
void shouldDisableSlashingProtectionForExternalSigners() {
final ValidatorConfig config = getTekuConfigurationFromArguments("--validators-external-signer-slashing-protection-enabled=false").validatorClient().getValidatorConfig();
assertThat(config.isValidatorExternalSignerSlashingProtectionEnabled()).isFalse();
}
use of tech.pegasys.teku.validator.api.ValidatorConfig in project teku by ConsenSys.
the class ValidatorOptionsTest method shouldReadFromConfigurationFile.
@Test
public void shouldReadFromConfigurationFile() throws MalformedURLException {
final ValidatorConfig config = getTekuConfigurationFromFile("validatorOptions_config.yaml").validatorClient().getValidatorConfig();
assertThat(config.getValidatorKeys()).containsExactlyInAnyOrder("a.key:a.password", "b.json:b.txt");
assertThat(config.getValidatorExternalSignerPublicKeySources()).containsExactly("0xad113a7d152dc74ae2b26db65bfb89ed07501c818bf47671c6d34e5a2f7224e4c5525dd4fddaa93aa328da86b7205009");
assertThat(config.getValidatorExternalSignerUrl()).isEqualTo(new URL("https://signer.url/"));
assertThat(config.getValidatorExternalSignerTimeout()).isEqualTo(Duration.ofMillis(1234));
assertThat(config.getGraffitiProvider().get()).isEqualTo(Optional.of(graffiti));
}
use of tech.pegasys.teku.validator.api.ValidatorConfig in project teku by ConsenSys.
the class ValidatorOptionsTest method shouldLoadGraffitiFromFile.
@Test
void shouldLoadGraffitiFromFile() {
final ValidatorConfig config = getTekuConfigurationFromFile("validatorOptionsWithGraffitiFile_config.yaml").validatorClient().getValidatorConfig();
assertThat(config.getGraffitiProvider().get()).isEqualTo(Optional.of(graffiti));
}
use of tech.pegasys.teku.validator.api.ValidatorConfig in project teku by ConsenSys.
the class ExternalSignerAltairIntegrationTest method setup.
@BeforeEach
void setup(final ClientAndServer client) throws MalformedURLException {
this.client = client;
final ValidatorConfig config = ValidatorConfig.builder().validatorExternalSignerPublicKeySources(List.of(KEYPAIR.getPublicKey().toString())).validatorExternalSignerUrl(new URL("http://127.0.0.1:" + client.getLocalPort())).validatorExternalSignerTimeout(TIMEOUT).build();
final HttpClientExternalSignerFactory httpClientExternalSignerFactory = new HttpClientExternalSignerFactory(config);
externalSigner = new ExternalSigner(spec, httpClientExternalSignerFactory.get(), config.getValidatorExternalSignerUrl(), KEYPAIR.getPublicKey(), TIMEOUT, queue, metricsSystem);
}
Aggregations