Search in sources :

Example 1 with MultiNodeDeterministicRunner

use of com.radixdlt.environment.deterministic.MultiNodeDeterministicRunner in project radixdlt by radixdlt.

the class DeterministicActorsTest method setup.

@SuppressWarnings("UnstableApiUsage")
@Before
public void setup() {
    var allNodes = nodeKeys.stream().map(k -> BFTNode.create(k.getPublicKey())).toList();
    this.network = new DeterministicNetwork(allNodes, MessageSelector.firstSelector(), MessageMutator.nothing());
    var nodeCreators = Streams.mapWithIndex(nodeKeys.stream(), (k, i) -> (Supplier<Injector>) () -> createRunner(i == 1, k, allNodes)).toList();
    deterministicRunner = new MultiNodeDeterministicRunner(nodeCreators, this::stopDatabase, network);
    deterministicRunner.start();
}
Also used : Module(com.google.inject.Module) Key(com.google.inject.Key) PersistentSafetyStateStore(com.radixdlt.hotstuff.safety.PersistentSafetyStateStore) BerkeleyAdditionalStore(com.radixdlt.store.berkeley.BerkeleyAdditionalStore) SubstateAccumulatorHashModule(com.radixdlt.statecomputer.substatehash.SubstateAccumulatorHashModule) After(org.junit.After) PersistedNodeForTestingModule(com.radixdlt.modules.PersistedNodeForTestingModule) DatabaseEnvironment(com.radixdlt.store.DatabaseEnvironment) Streams(com.google.common.collect.Streams) Multibinder(com.google.inject.multibindings.Multibinder) LastEventsModule(com.radixdlt.environment.deterministic.LastEventsModule) Collectors(java.util.stream.Collectors) Logger(org.apache.logging.log4j.Logger) MainnetForksModule(com.radixdlt.statecomputer.forks.modules.MainnetForksModule) InvalidProposedTxn(com.radixdlt.statecomputer.InvalidProposedTxn) Amount(com.radixdlt.application.tokens.Amount) NetworkId(com.radixdlt.networks.NetworkId) java.util(java.util) Modules(com.google.inject.util.Modules) SyncCheckTrigger(com.radixdlt.sync.messages.local.SyncCheckTrigger) Supplier(java.util.function.Supplier) DeterministicNetwork(com.radixdlt.environment.deterministic.network.DeterministicNetwork) MockedGenesisModule(com.radixdlt.statecomputer.checkpoint.MockedGenesisModule) ImmutableList(com.google.common.collect.ImmutableList) DatabaseLocation(com.radixdlt.store.DatabaseLocation) MessageSelector(com.radixdlt.environment.deterministic.network.MessageSelector) MempoolConfig(com.radixdlt.mempool.MempoolConfig) EvictingQueue(com.google.common.collect.EvictingQueue) BerkeleyLedgerEntryStore(com.radixdlt.store.berkeley.BerkeleyLedgerEntryStore) BerkeleyRecoverableProcessedTxnStore(com.radixdlt.api.core.reconstruction.BerkeleyRecoverableProcessedTxnStore) Before(org.junit.Before) PrivateKeys(com.radixdlt.utils.PrivateKeys) EventDispatcher(com.radixdlt.environment.EventDispatcher) Network(com.radixdlt.networks.Network) Environment(com.radixdlt.environment.Environment) Test(org.junit.Test) MempoolRelayTrigger(com.radixdlt.mempool.MempoolRelayTrigger) Scopes(com.google.inject.Scopes) ForksModule(com.radixdlt.statecomputer.forks.ForksModule) Injector(com.google.inject.Injector) BFTNode(com.radixdlt.hotstuff.bft.BFTNode) LedgerUpdate(com.radixdlt.ledger.LedgerUpdate) Provides(com.google.inject.Provides) ECKeyPair(com.radixdlt.crypto.ECKeyPair) Rule(org.junit.Rule) FailOnEvent(com.radixdlt.harness.FailOnEvent) Guice(com.google.inject.Guice) Self(com.radixdlt.hotstuff.bft.Self) MultiNodeDeterministicRunner(com.radixdlt.environment.deterministic.MultiNodeDeterministicRunner) MessageMutator(com.radixdlt.environment.deterministic.network.MessageMutator) PeersView(com.radixdlt.network.p2p.PeersView) LogManager(org.apache.logging.log4j.LogManager) TemporaryFolder(org.junit.rules.TemporaryFolder) AbstractModule(com.google.inject.AbstractModule) MultiNodeDeterministicRunner(com.radixdlt.environment.deterministic.MultiNodeDeterministicRunner) DeterministicNetwork(com.radixdlt.environment.deterministic.network.DeterministicNetwork) Supplier(java.util.function.Supplier) Before(org.junit.Before)

Aggregations

EvictingQueue (com.google.common.collect.EvictingQueue)1 ImmutableList (com.google.common.collect.ImmutableList)1 Streams (com.google.common.collect.Streams)1 AbstractModule (com.google.inject.AbstractModule)1 Guice (com.google.inject.Guice)1 Injector (com.google.inject.Injector)1 Key (com.google.inject.Key)1 Module (com.google.inject.Module)1 Provides (com.google.inject.Provides)1 Scopes (com.google.inject.Scopes)1 Multibinder (com.google.inject.multibindings.Multibinder)1 Modules (com.google.inject.util.Modules)1 BerkeleyRecoverableProcessedTxnStore (com.radixdlt.api.core.reconstruction.BerkeleyRecoverableProcessedTxnStore)1 Amount (com.radixdlt.application.tokens.Amount)1 ECKeyPair (com.radixdlt.crypto.ECKeyPair)1 Environment (com.radixdlt.environment.Environment)1 EventDispatcher (com.radixdlt.environment.EventDispatcher)1 LastEventsModule (com.radixdlt.environment.deterministic.LastEventsModule)1 MultiNodeDeterministicRunner (com.radixdlt.environment.deterministic.MultiNodeDeterministicRunner)1 DeterministicNetwork (com.radixdlt.environment.deterministic.network.DeterministicNetwork)1