Search in sources :

Example 11 with TekuConfiguration

use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.

the class ValidatorOptionsTest method shouldReportEmptyIfFeeRecipientNotSpecified.

@Test
public void shouldReportEmptyIfFeeRecipientNotSpecified() {
    final TekuConfiguration config = getTekuConfigurationFromArguments();
    assertThat(config.validatorClient().getValidatorConfig().getProposerDefaultFeeRecipient()).isEmpty();
}
Also used : TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Test(org.junit.jupiter.api.Test) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)

Example 12 with TekuConfiguration

use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.

the class ValidatorOptionsTest method shouldEnableBlindedBeaconBlocks.

@Test
public void shouldEnableBlindedBeaconBlocks() {
    final String[] args = { "--Xvalidators-blinded-blocks-api-enabled", "true" };
    final TekuConfiguration config = getTekuConfigurationFromArguments(args);
    assertThat(config.validatorClient().getValidatorConfig().isBlindedBeaconBlocksApiEnabled()).isTrue();
}
Also used : TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Test(org.junit.jupiter.api.Test) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)

Example 13 with TekuConfiguration

use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.

the class ValidatorOptionsTest method beaconNodeApiEndpoint_shouldBeEmptyByDefault.

@Test
void beaconNodeApiEndpoint_shouldBeEmptyByDefault() {
    TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments();
    assertThat(tekuConfiguration.validatorClient().getValidatorConfig().getBeaconNodeApiEndpoint()).isEmpty();
}
Also used : TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Test(org.junit.jupiter.api.Test) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)

Example 14 with TekuConfiguration

use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.

the class Eth2NetworkOptionsTest method shouldLoadMergeTerminalBlockHashOverride.

@Test
void shouldLoadMergeTerminalBlockHashOverride() {
    final TekuConfiguration config = getTekuConfigurationFromArguments("--Xnetwork-terminal-block-hash-override", "0x7562f205a2d14e80a3a67da9df0b769b0ba0111a8e81034606f8f27f51f4dd8e");
    assertThat(config.eth2NetworkConfiguration().getTerminalBlockHashOverride()).isEqualTo(Optional.of(Bytes32.fromHexStringStrict("0x7562f205a2d14e80a3a67da9df0b769b0ba0111a8e81034606f8f27f51f4dd8e")));
    assertThat(createConfigBuilder().eth2NetworkConfig(b -> b.terminalBlockHashOverride(Bytes32.fromHexStringStrict("0x7562f205a2d14e80a3a67da9df0b769b0ba0111a8e81034606f8f27f51f4dd8e"))).build()).usingRecursiveComparison().isEqualTo(config);
}
Also used : TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Test(org.junit.jupiter.api.Test) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)

Example 15 with TekuConfiguration

use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.

the class Eth2NetworkOptionsTest method shouldUseBellatrixForkEpochIfSpecified.

@Test
void shouldUseBellatrixForkEpochIfSpecified() {
    final TekuConfiguration config = getTekuConfigurationFromArguments("--Xnetwork-bellatrix-fork-epoch", "120000", "--Xee-endpoint", "someEndpoint");
    final Spec spec = config.eth2NetworkConfiguration().getSpec();
    assertThat(spec.getForkSchedule().getSpecMilestoneAtEpoch(UInt64.valueOf(119999))).isEqualTo(SpecMilestone.ALTAIR);
    assertThat(spec.getForkSchedule().getSpecMilestoneAtEpoch(UInt64.valueOf(120000))).isEqualTo(SpecMilestone.BELLATRIX);
    assertThat(createConfigBuilder().executionEngine(b -> b.endpoint("someEndpoint")).eth2NetworkConfig(b -> b.bellatrixForkEpoch(UInt64.valueOf(120000))).build()).usingRecursiveComparison().isEqualTo(config);
}
Also used : Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Test(org.junit.jupiter.api.Test) TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Optional(java.util.Optional) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) BigInteger(java.math.BigInteger) UInt256(org.apache.tuweni.units.bigints.UInt256) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest) Spec(tech.pegasys.teku.spec.Spec) Bytes32(org.apache.tuweni.bytes.Bytes32) SpecMilestone(tech.pegasys.teku.spec.SpecMilestone) TekuConfiguration(tech.pegasys.teku.config.TekuConfiguration) Spec(tech.pegasys.teku.spec.Spec) Test(org.junit.jupiter.api.Test) AbstractBeaconNodeCommandTest(tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)

Aggregations

TekuConfiguration (tech.pegasys.teku.config.TekuConfiguration)94 Test (org.junit.jupiter.api.Test)88 AbstractBeaconNodeCommandTest (tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest)84 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)19 BeaconRestApiConfig (tech.pegasys.teku.beaconrestapi.BeaconRestApiConfig)14 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)12 List (java.util.List)10 Eth2NetworkConfiguration (tech.pegasys.teku.networks.Eth2NetworkConfiguration)9 Optional (java.util.Optional)8 URL (java.net.URL)7 OptionalInt (java.util.OptionalInt)6 Set (java.util.Set)6 JVM (org.hyperledger.besu.metrics.StandardMetricCategory.JVM)6 PROCESS (org.hyperledger.besu.metrics.StandardMetricCategory.PROCESS)6 EVENTBUS (tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.EVENTBUS)6 LIBP2P (tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.LIBP2P)6 NETWORK (tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK)6 MetricsConfig (tech.pegasys.teku.infrastructure.metrics.MetricsConfig)5 P2PConfig (tech.pegasys.teku.networking.eth2.P2PConfig)5 DiscoveryConfig (tech.pegasys.teku.networking.p2p.discovery.DiscoveryConfig)5