Search in sources :

Example 1 with FunctionalNodeModule

use of com.radixdlt.FunctionalNodeModule 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)

Aggregations

FunctionalNodeModule (com.radixdlt.FunctionalNodeModule)1 SystemCountersImpl (com.radixdlt.counters.SystemCountersImpl)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 InMemoryBFTKeyModule (com.radixdlt.keys.InMemoryBFTKeyModule)1 GetVerticesRequestRateLimit (com.radixdlt.middleware2.network.GetVerticesRequestRateLimit)1 NoOpPeerControl (com.radixdlt.network.p2p.NoOpPeerControl)1 PeerControl (com.radixdlt.network.p2p.PeerControl)1 Addressing (com.radixdlt.networks.Addressing)1 DatabaseCacheSize (com.radixdlt.store.DatabaseCacheSize)1 PersistenceModule (com.radixdlt.store.PersistenceModule)1 SyncConfig (com.radixdlt.sync.SyncConfig)1 TimeSupplier (com.radixdlt.utils.TimeSupplier)1