use of tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK in project teku by ConsenSys.
the class BeaconNodeCommandTest method overrideConfigFileValuesIfKeyIsPresentInCLIOptions.
@Test
public void overrideConfigFileValuesIfKeyIsPresentInCLIOptions() throws IOException {
final Path configFile = createConfigFile();
final String[] args = { CONFIG_FILE_OPTION_NAME, configFile.toString(), "--p2p-interface", "1.2.3.5" };
beaconNodeCommand.parse(args);
final TekuConfiguration expected = expectedCompleteConfigInFileBuilder().network(n -> n.networkInterface("1.2.3.5")).build();
assertTekuAndLoggingConfiguration(expected, expectedCompleteConfigInFileLoggingBuilder().build());
}
use of tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK in project teku by ConsenSys.
the class BeaconNodeCommandTest method overrideConfigFileValuesIfKeyIsPresentInEnvironmentVariables.
@Test
public void overrideConfigFileValuesIfKeyIsPresentInEnvironmentVariables() throws IOException {
final Path configFile = createConfigFile();
final String[] args = { CONFIG_FILE_OPTION_NAME, configFile.toString() };
beaconNodeCommand = new BeaconNodeCommand(outputWriter, errorWriter, Collections.singletonMap("TEKU_P2P_INTERFACE", "1.2.3.5"), startAction, loggingConfigurator);
beaconNodeCommand.parse(args);
final TekuConfiguration expected = expectedCompleteConfigInFileBuilder().network(n -> n.networkInterface("1.2.3.5")).build();
assertTekuAndLoggingConfiguration(expected, expectedCompleteConfigInFileLoggingBuilder().build());
}
use of tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK in project teku by ConsenSys.
the class MetricsOptionsTest method metricsCategories_shouldAcceptMultipleValues.
@Test
public void metricsCategories_shouldAcceptMultipleValues() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--metrics-categories", "LIBP2P,NETWORK,EVENTBUS,PROCESS");
final MetricsConfig config = tekuConfiguration.metricsConfig();
assertThat(config.getMetricsCategories()).isEqualTo(Set.of(LIBP2P, NETWORK, EVENTBUS, PROCESS));
assertThat(createConfigBuilder().metrics(b -> b.metricsCategories(Set.of(LIBP2P, NETWORK, EVENTBUS, PROCESS))).build()).usingRecursiveComparison().withComparatorForFields(SET_COMPARATOR, SET_FIELDS).isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK in project teku by ConsenSys.
the class BeaconNodeCommandTest method expectedDefaultConfigurationBuilder.
private TekuConfiguration.Builder expectedDefaultConfigurationBuilder() {
final Eth2NetworkConfiguration networkConfig = Eth2NetworkConfiguration.builder("mainnet").build();
return expectedConfigurationBuilder().eth2NetworkConfig(b -> b.applyNetworkDefaults("mainnet")).executionEngine(b -> b.endpoint(null)).powchain(b -> {
b.depositContract(networkConfig.getEth1DepositContractAddress());
b.eth1Endpoints(new ArrayList<>()).depositContractDeployBlock(networkConfig.getEth1DepositContractDeployBlock());
}).storageConfiguration(b -> b.eth1DepositContract(networkConfig.getEth1DepositContractAddress())).metrics(b -> b.metricsCategories(DEFAULT_METRICS_CATEGORIES)).restApi(b -> b.eth1DepositContractAddress(networkConfig.getEth1DepositContractAddress())).p2p(p -> p.peerRateLimit(500).peerRequestLimit(50)).discovery(d -> d.isDiscoveryEnabled(true).listenUdpPort(9000).bootnodes(networkConfig.getDiscoveryBootnodes())).network(n -> n.advertisedPort(OptionalInt.empty()).networkInterface("0.0.0.0").listenPort(9000).privateKeyFile("")).validator(b -> b.validatorKeystoreLockingEnabled(true).validatorPerformanceTrackingMode(ValidatorPerformanceTrackingMode.ALL)).interop(b -> b.interopEnabled(false).interopGenesisTime(0).interopOwnedValidatorCount(0));
}
use of tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory.NETWORK in project teku by ConsenSys.
the class BeaconNodeCommandTest method overrideEnvironmentValuesIfKeyIsPresentInCLIOptions.
@Test
public void overrideEnvironmentValuesIfKeyIsPresentInCLIOptions() {
final String[] args = createCliArgs();
args[5] = "1.2.3.5";
beaconNodeCommand = new BeaconNodeCommand(outputWriter, errorWriter, Collections.singletonMap("TEKU_P2P_INTERFACE", "1.2.3.4"), startAction, loggingConfigurator);
beaconNodeCommand.parse(args);
TekuConfiguration expected = expectedConfigurationBuilder().network(n -> n.networkInterface("1.2.3.5")).build();
assertTekuAndLoggingConfiguration(expected, expectedLoggingBuilder().build());
}
Aggregations