use of tech.pegasys.teku.spec.config.SpecConfigBellatrix in project teku by ConsenSys.
the class SpecVersionTest method shouldCreateBellatrixSpec.
@Test
void shouldCreateBellatrixSpec() {
final SpecConfigBellatrix bellatrixSpecConfig = SpecConfigBellatrix.required(minimalConfig);
final SpecVersion expectedVersion = SpecVersion.createBellatrix(bellatrixSpecConfig);
final Optional<SpecVersion> actualVersion = SpecVersion.create(SpecMilestone.BELLATRIX, minimalConfig);
assertThat(actualVersion).isPresent();
assertThat(actualVersion.get().getMilestone()).isEqualTo(SpecMilestone.BELLATRIX);
assertThat(actualVersion.get().getSchemaDefinitions()).hasSameClassAs(expectedVersion.getSchemaDefinitions());
}
use of tech.pegasys.teku.spec.config.SpecConfigBellatrix in project teku by ConsenSys.
the class TerminalPowBlockMonitor method start.
public synchronized void start() {
if (timer.isPresent()) {
return;
}
Optional<SpecConfigBellatrix> maybeSpecConfigBellatrix = getSpecConfigBellatrix();
if (maybeSpecConfigBellatrix.isEmpty()) {
LOG.error("Bellatrix spec config not found. Monitor will shutdown.");
stop();
return;
}
specConfigBellatrix = maybeSpecConfigBellatrix.get();
localTransitionConfiguration = new TransitionConfiguration(specConfigBellatrix.getTerminalTotalDifficulty(), specConfigBellatrix.getTerminalBlockHash(), UInt64.ZERO);
final Duration pollingPeriod = Duration.ofSeconds(spec.getGenesisSpec().getConfig().getSecondsPerEth1Block());
timer = Optional.of(asyncRunner.runWithFixedDelay(this::monitor, pollingPeriod, (error) -> LOG.error("An error occurred while executing the monitor task", error)));
LOG.info("Monitor has started. Waiting BELLATRIX fork activation. Polling every {}", pollingPeriod);
}
Aggregations