Search in sources :

Example 1 with ChainStorage

use of tech.pegasys.teku.storage.server.ChainStorage in project teku by ConsenSys.

the class StorageSystem method create.

static StorageSystem create(final Database database, final RestartedStorageSupplier restartedSupplier, final StateStorageMode storageMode, final StoreConfig storeConfig, final Spec spec, final ChainBuilder chainBuilder) {
    final StubMetricsSystem metricsSystem = new StubMetricsSystem();
    // Create and start storage server
    final ChainStorage chainStorageServer = ChainStorage.create(database, spec);
    // Create recent chain data
    final FinalizedCheckpointChannel finalizedCheckpointChannel = new StubFinalizedCheckpointChannel();
    final TrackingChainHeadChannel chainHeadChannel = new TrackingChainHeadChannel();
    final RecentChainData recentChainData = StorageBackedRecentChainData.createImmediately(SYNC_RUNNER, metricsSystem, storeConfig, chainStorageServer, chainStorageServer, chainStorageServer, finalizedCheckpointChannel, chainHeadChannel, spec);
    // Create combined client
    final CombinedChainDataClient combinedChainDataClient = new CombinedChainDataClient(recentChainData, chainStorageServer, spec);
    // Return storage system
    return new StorageSystem(metricsSystem, chainHeadChannel, storageMode, chainStorageServer, database, recentChainData, combinedChainDataClient, restartedSupplier, chainBuilder, spec);
}
Also used : FinalizedCheckpointChannel(tech.pegasys.teku.storage.api.FinalizedCheckpointChannel) StubFinalizedCheckpointChannel(tech.pegasys.teku.storage.api.StubFinalizedCheckpointChannel) TrackingChainHeadChannel(tech.pegasys.teku.storage.api.TrackingChainHeadChannel) StorageBackedRecentChainData(tech.pegasys.teku.storage.client.StorageBackedRecentChainData) RecentChainData(tech.pegasys.teku.storage.client.RecentChainData) StubMetricsSystem(tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem) StubFinalizedCheckpointChannel(tech.pegasys.teku.storage.api.StubFinalizedCheckpointChannel) CombinedChainDataClient(tech.pegasys.teku.storage.client.CombinedChainDataClient) ChainStorage(tech.pegasys.teku.storage.server.ChainStorage)

Aggregations

StubMetricsSystem (tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem)1 FinalizedCheckpointChannel (tech.pegasys.teku.storage.api.FinalizedCheckpointChannel)1 StubFinalizedCheckpointChannel (tech.pegasys.teku.storage.api.StubFinalizedCheckpointChannel)1 TrackingChainHeadChannel (tech.pegasys.teku.storage.api.TrackingChainHeadChannel)1 CombinedChainDataClient (tech.pegasys.teku.storage.client.CombinedChainDataClient)1 RecentChainData (tech.pegasys.teku.storage.client.RecentChainData)1 StorageBackedRecentChainData (tech.pegasys.teku.storage.client.StorageBackedRecentChainData)1 ChainStorage (tech.pegasys.teku.storage.server.ChainStorage)1