use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class BeaconNodeCommand method call.
@Override
public Integer call() {
try {
startLogging();
final TekuConfiguration tekuConfig = tekuConfiguration();
startAction.start(tekuConfig, false);
return 0;
} catch (InvalidConfigurationException | DatabaseStorageException ex) {
reportUserError(ex);
} catch (CompletionException e) {
ExceptionUtil.<Throwable>getCause(e, InvalidConfigurationException.class).or(() -> ExceptionUtil.getCause(e, DatabaseStorageException.class)).ifPresentOrElse(this::reportUserError, () -> reportUnexpectedError(e));
} catch (Throwable t) {
reportUnexpectedError(t);
}
return 1;
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataPath_shouldAcceptNonDefaultValues.
@Test
public void dataPath_shouldAcceptNonDefaultValues() {
final TekuConfiguration config = getTekuConfigurationFromArguments("--data-path", TEST_PATH.toString());
assertThat(config.dataConfig().getDataBasePath()).isEqualTo(TEST_PATH);
assertThat(createConfigBuilder().data(b -> b.dataBasePath(TEST_PATH)).build()).usingRecursiveComparison().isEqualTo(config);
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class P2POptionsTest method minimumRandomlySelectedPeerCount_canBeOverriden.
@Test
public void minimumRandomlySelectedPeerCount_canBeOverriden() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--p2p-peer-lower-bound", "100", "--p2p-peer-upper-bound", "110", "--Xp2p-minimum-randomly-selected-peer-count", "40");
assertThat(tekuConfiguration.discovery().getMinRandomlySelectedPeers()).isEqualTo(40);
assertThat(createConfigBuilder().discovery(b -> b.minPeers(100).maxPeers(110).minRandomlySelectedPeers(40)).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class P2POptionsTest method privateKeyFile_shouldBeSettable.
@Test
public void privateKeyFile_shouldBeSettable() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--p2p-private-key-file", "/some/file");
assertThat(tekuConfiguration.network().getPrivateKeySource()).containsInstanceOf(FilePrivateKeySource.class);
assertThat(((FilePrivateKeySource) tekuConfiguration.network().getPrivateKeySource().get()).getFileName()).isEqualTo("/some/file");
assertThat(createConfigBuilder().network(b -> b.privateKeyFile("/some/file")).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class P2POptionsTest method p2pUdpPort_shouldDefaultToP2pPortWhenNeitherSet.
@Test
void p2pUdpPort_shouldDefaultToP2pPortWhenNeitherSet() {
final TekuConfiguration tekuConfig = getTekuConfigurationFromArguments();
assertThat(tekuConfig.discovery().getListenUdpPort()).isEqualTo(tekuConfig.network().getListenPort());
}
Aggregations