Search in sources :

Example 1 with MemKeyValueStore

use of tech.pegasys.teku.storage.store.MemKeyValueStore in project teku by ConsenSys.

the class DiscoveryNetworkTest method shouldNotEnableDiscoveryWhenDiscoveryIsDisabled.

@Test
public void shouldNotEnableDiscoveryWhenDiscoveryIsDisabled() {
    final DiscoveryConfig discoveryConfig = DiscoveryConfig.builder().isDiscoveryEnabled(false).build();
    final NetworkConfig networkConfig = NetworkConfig.builder().build();
    final PeerSelectionStrategy peerSelectionStrategy = new SimplePeerSelectionStrategy(new TargetPeerRange(20, 30, 0));
    final DiscoveryNetwork<?> network = DiscoveryNetworkBuilder.create().metricsSystem(new NoOpMetricsSystem()).asyncRunner(DelayedExecutorAsyncRunner.create()).kvStore(new MemKeyValueStore<>()).p2pNetwork(p2pNetwork).peerSelectionStrategy(peerSelectionStrategy).discoveryConfig(discoveryConfig).p2pConfig(networkConfig).spec(spec).currentSchemaDefinitionsSupplier(spec::getGenesisSchemaDefinitions).build();
    assertThat(network.getEnr()).isEmpty();
}
Also used : NoOpMetricsSystem(org.hyperledger.besu.metrics.noop.NoOpMetricsSystem) NetworkConfig(tech.pegasys.teku.networking.p2p.network.config.NetworkConfig) SimplePeerSelectionStrategy(tech.pegasys.teku.network.p2p.peer.SimplePeerSelectionStrategy) PeerSelectionStrategy(tech.pegasys.teku.networking.p2p.connection.PeerSelectionStrategy) SimplePeerSelectionStrategy(tech.pegasys.teku.network.p2p.peer.SimplePeerSelectionStrategy) TargetPeerRange(tech.pegasys.teku.networking.p2p.connection.TargetPeerRange) MemKeyValueStore(tech.pegasys.teku.storage.store.MemKeyValueStore) Test(org.junit.jupiter.api.Test)

Aggregations

NoOpMetricsSystem (org.hyperledger.besu.metrics.noop.NoOpMetricsSystem)1 Test (org.junit.jupiter.api.Test)1 SimplePeerSelectionStrategy (tech.pegasys.teku.network.p2p.peer.SimplePeerSelectionStrategy)1 PeerSelectionStrategy (tech.pegasys.teku.networking.p2p.connection.PeerSelectionStrategy)1 TargetPeerRange (tech.pegasys.teku.networking.p2p.connection.TargetPeerRange)1 NetworkConfig (tech.pegasys.teku.networking.p2p.network.config.NetworkConfig)1 MemKeyValueStore (tech.pegasys.teku.storage.store.MemKeyValueStore)1