Search in sources :

Example 6 with BeaconChainUtil

use of tech.pegasys.teku.statetransition.BeaconChainUtil in project teku by ConsenSys.

the class NodeManager method create.

public static NodeManager create(final Spec spec, Eth2P2PNetworkFactory networkFactory, final List<BLSKeyPair> validatorKeys, Consumer<Eth2P2PNetworkBuilder> configureNetwork) throws Exception {
    final EventChannels eventChannels = EventChannels.createSyncChannels(ChannelExceptionHandler.THROWING_HANDLER, new NoOpMetricsSystem());
    final RecentChainData storageClient = MemoryOnlyRecentChainData.create(spec);
    final BeaconChainUtil chainUtil = BeaconChainUtil.create(spec, storageClient, validatorKeys);
    chainUtil.initializeStorage();
    final Eth2P2PNetworkBuilder networkBuilder = networkFactory.builder().spec(spec).eventChannels(eventChannels).recentChainData(storageClient);
    configureNetwork.accept(networkBuilder);
    final BlockGossipChannel blockGossipChannel = eventChannels.getPublisher(BlockGossipChannel.class);
    final Eth2P2PNetwork eth2P2PNetwork = networkBuilder.startNetwork();
    return new NodeManager(blockGossipChannel, storageClient, chainUtil, eth2P2PNetwork);
}
Also used : RecentChainData(tech.pegasys.teku.storage.client.RecentChainData) MemoryOnlyRecentChainData(tech.pegasys.teku.storage.client.MemoryOnlyRecentChainData) BlockGossipChannel(tech.pegasys.teku.networking.eth2.gossip.BlockGossipChannel) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) EventChannels(tech.pegasys.teku.infrastructure.events.EventChannels) NoOpMetricsSystem(org.hyperledger.besu.metrics.noop.NoOpMetricsSystem) BeaconChainUtil(tech.pegasys.teku.statetransition.BeaconChainUtil)

Aggregations

BeaconChainUtil (tech.pegasys.teku.statetransition.BeaconChainUtil)6 MemoryOnlyRecentChainData (tech.pegasys.teku.storage.client.MemoryOnlyRecentChainData)6 RecentChainData (tech.pegasys.teku.storage.client.RecentChainData)6 SignedBeaconBlock (tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock)4 BeaconState (tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)4 Disabled (org.junit.jupiter.api.Disabled)3 Test (org.junit.jupiter.api.Test)3 BLSKeyPair (tech.pegasys.teku.bls.BLSKeyPair)3 InlineEventThread (tech.pegasys.teku.infrastructure.async.eventthread.InlineEventThread)3 BlockImportNotifications (tech.pegasys.teku.statetransition.block.BlockImportNotifications)3 BlockImporter (tech.pegasys.teku.statetransition.block.BlockImporter)3 ForkChoice (tech.pegasys.teku.statetransition.forkchoice.ForkChoice)3 MergeTransitionBlockValidator (tech.pegasys.teku.statetransition.forkchoice.MergeTransitionBlockValidator)3 StubForkChoiceNotifier (tech.pegasys.teku.statetransition.forkchoice.StubForkChoiceNotifier)3 BufferedReader (java.io.BufferedReader)2 InputStreamReader (java.io.InputStreamReader)2 NoOpMetricsSystem (org.hyperledger.besu.metrics.noop.NoOpMetricsSystem)2 Reader (tech.pegasys.teku.benchmarks.gen.BlockIO.Reader)2 EventChannels (tech.pegasys.teku.infrastructure.events.EventChannels)2 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)2