Search in sources :

Example 1 with InMemoryBFTKeyModule

use of com.radixdlt.keys.InMemoryBFTKeyModule in project radixdlt by radixdlt.

the class PersistedNodeForTestingModule method configure.

@Override
public void configure() {
    bind(Addressing.class).toInstance(Addressing.ofNetwork(Network.LOCALNET));
    bind(SyncConfig.class).toInstance(SyncConfig.of(500, 10, 3000, 10, Long.MAX_VALUE));
    bind(Integer.class).annotatedWith(BFTSyncPatienceMillis.class).toInstance(200);
    bind(Long.class).annotatedWith(PacemakerTimeout.class).toInstance(1000L);
    bind(Double.class).annotatedWith(PacemakerRate.class).toInstance(2.0);
    bind(Integer.class).annotatedWith(PacemakerMaxExponent.class).toInstance(6);
    bind(RateLimiter.class).annotatedWith(GetVerticesRequestRateLimit.class).toInstance(RateLimiter.create(Double.MAX_VALUE));
    bindConstant().annotatedWith(DatabaseCacheSize.class).to((long) (Runtime.getRuntime().maxMemory() * 0.125));
    // System
    bind(SystemCounters.class).to(SystemCountersImpl.class).in(Scopes.SINGLETON);
    bind(TimeSupplier.class).toInstance(System::currentTimeMillis);
    // P2P
    bind(PeerControl.class).toInstance(new NoOpPeerControl());
    install(new InMemoryBFTKeyModule());
    install(new CryptoModule());
    install(new FunctionalNodeModule());
    install(new RadixEngineStoreModule());
    install(new PersistenceModule());
    install(new ConsensusRecoveryModule());
    install(new LedgerRecoveryModule());
}
Also used : BFTSyncPatienceMillis(com.radixdlt.hotstuff.sync.BFTSyncPatienceMillis) InMemoryBFTKeyModule(com.radixdlt.keys.InMemoryBFTKeyModule) PacemakerTimeout(com.radixdlt.hotstuff.bft.PacemakerTimeout) NoOpPeerControl(com.radixdlt.network.p2p.NoOpPeerControl) SyncConfig(com.radixdlt.sync.SyncConfig) TimeSupplier(com.radixdlt.utils.TimeSupplier) PersistenceModule(com.radixdlt.store.PersistenceModule) Addressing(com.radixdlt.networks.Addressing) PacemakerMaxExponent(com.radixdlt.hotstuff.bft.PacemakerMaxExponent) FunctionalNodeModule(com.radixdlt.FunctionalNodeModule) PacemakerRate(com.radixdlt.hotstuff.bft.PacemakerRate) DatabaseCacheSize(com.radixdlt.store.DatabaseCacheSize) SystemCountersImpl(com.radixdlt.counters.SystemCountersImpl) GetVerticesRequestRateLimit(com.radixdlt.middleware2.network.GetVerticesRequestRateLimit) NoOpPeerControl(com.radixdlt.network.p2p.NoOpPeerControl) PeerControl(com.radixdlt.network.p2p.PeerControl)

Example 2 with InMemoryBFTKeyModule

use of com.radixdlt.keys.InMemoryBFTKeyModule in project radixdlt by radixdlt.

the class PersistedNodeForTestingModule method configure.

@Override
public void configure() {
    bind(Addressing.class).toInstance(Addressing.ofNetwork(Network.LOCALNET));
    bind(SyncConfig.class).toInstance(SyncConfig.of(500, 10, 3000, 10, Long.MAX_VALUE));
    bind(Integer.class).annotatedWith(BFTSyncPatienceMillis.class).toInstance(200);
    bind(Long.class).annotatedWith(PacemakerTimeout.class).toInstance(1000L);
    bind(Double.class).annotatedWith(PacemakerRate.class).toInstance(2.0);
    bind(Integer.class).annotatedWith(PacemakerMaxExponent.class).toInstance(6);
    bind(RateLimiter.class).annotatedWith(GetVerticesRequestRateLimit.class).toInstance(RateLimiter.create(Double.MAX_VALUE));
    bindConstant().annotatedWith(DatabaseCacheSize.class).to((long) (Runtime.getRuntime().maxMemory() * 0.125));
    // System
    bind(SystemCounters.class).to(SystemCountersImpl.class).in(Scopes.SINGLETON);
    bind(TimeSupplier.class).toInstance(System::currentTimeMillis);
    // P2P
    bind(PeerControl.class).toInstance(new NoOpPeerControl());
    install(new InMemoryBFTKeyModule());
    install(new CryptoModule());
    install(new FunctionalNodeModule());
    install(new RadixEngineStoreModule());
    install(new PersistenceModule());
    install(new ConsensusRecoveryModule());
    install(new LedgerRecoveryModule());
}
Also used : BFTSyncPatienceMillis(com.radixdlt.consensus.sync.BFTSyncPatienceMillis) InMemoryBFTKeyModule(com.radixdlt.keys.InMemoryBFTKeyModule) PacemakerTimeout(com.radixdlt.consensus.bft.PacemakerTimeout) NoOpPeerControl(com.radixdlt.network.p2p.NoOpPeerControl) SyncConfig(com.radixdlt.sync.SyncConfig) TimeSupplier(com.radixdlt.utils.TimeSupplier) PersistenceModule(com.radixdlt.store.PersistenceModule) Addressing(com.radixdlt.networks.Addressing) PacemakerMaxExponent(com.radixdlt.consensus.bft.PacemakerMaxExponent) PacemakerRate(com.radixdlt.consensus.bft.PacemakerRate) DatabaseCacheSize(com.radixdlt.store.DatabaseCacheSize) SystemCountersImpl(com.radixdlt.counters.SystemCountersImpl) GetVerticesRequestRateLimit(com.radixdlt.middleware2.network.GetVerticesRequestRateLimit) NoOpPeerControl(com.radixdlt.network.p2p.NoOpPeerControl) PeerControl(com.radixdlt.network.p2p.PeerControl)

Aggregations

SystemCountersImpl (com.radixdlt.counters.SystemCountersImpl)2 InMemoryBFTKeyModule (com.radixdlt.keys.InMemoryBFTKeyModule)2 GetVerticesRequestRateLimit (com.radixdlt.middleware2.network.GetVerticesRequestRateLimit)2 NoOpPeerControl (com.radixdlt.network.p2p.NoOpPeerControl)2 PeerControl (com.radixdlt.network.p2p.PeerControl)2 Addressing (com.radixdlt.networks.Addressing)2 DatabaseCacheSize (com.radixdlt.store.DatabaseCacheSize)2 PersistenceModule (com.radixdlt.store.PersistenceModule)2 SyncConfig (com.radixdlt.sync.SyncConfig)2 TimeSupplier (com.radixdlt.utils.TimeSupplier)2 FunctionalNodeModule (com.radixdlt.FunctionalNodeModule)1 PacemakerMaxExponent (com.radixdlt.consensus.bft.PacemakerMaxExponent)1 PacemakerRate (com.radixdlt.consensus.bft.PacemakerRate)1 PacemakerTimeout (com.radixdlt.consensus.bft.PacemakerTimeout)1 BFTSyncPatienceMillis (com.radixdlt.consensus.sync.BFTSyncPatienceMillis)1 PacemakerMaxExponent (com.radixdlt.hotstuff.bft.PacemakerMaxExponent)1 PacemakerRate (com.radixdlt.hotstuff.bft.PacemakerRate)1 PacemakerTimeout (com.radixdlt.hotstuff.bft.PacemakerTimeout)1 BFTSyncPatienceMillis (com.radixdlt.hotstuff.sync.BFTSyncPatienceMillis)1