Search in sources :

Example 1 with DepositStorage

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

the class StorageService method doStart.

@Override
protected SafeFuture<?> doStart() {
    return SafeFuture.fromRunnable(() -> {
        final VersionedDatabaseFactory dbFactory = new VersionedDatabaseFactory(serviceConfig.getMetricsSystem(), serviceConfig.getDataDirLayout().getBeaconDataDirectory(), config.getDataStorageMode(), config.getDataStorageCreateDbVersion(), config.getDataStorageFrequency(), config.getEth1DepositContract(), config.isStoreNonCanonicalBlocksEnabled(), config.getMaxKnownNodeCacheSize(), config.getSpec());
        database = dbFactory.createDatabase();
        chainStorage = ChainStorage.create(database, config.getSpec());
        final DepositStorage depositStorage = DepositStorage.create(serviceConfig.getEventChannels().getPublisher(Eth1EventsChannel.class), database);
        serviceConfig.getEventChannels().subscribe(Eth1DepositStorageChannel.class, depositStorage).subscribe(Eth1EventsChannel.class, depositStorage).subscribe(StorageUpdateChannel.class, chainStorage).subscribe(VoteUpdateChannel.class, chainStorage).subscribeMultithreaded(StorageQueryChannel.class, chainStorage, STORAGE_QUERY_CHANNEL_PARALLELISM);
    });
}
Also used : DepositStorage(tech.pegasys.teku.storage.server.DepositStorage) Eth1EventsChannel(tech.pegasys.teku.pow.api.Eth1EventsChannel) VersionedDatabaseFactory(tech.pegasys.teku.storage.server.VersionedDatabaseFactory) VoteUpdateChannel(tech.pegasys.teku.storage.api.VoteUpdateChannel)

Example 2 with DepositStorage

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

the class DebugDbCommand method getDeposits.

@Command(name = "get-deposits", description = "List the ETH1 deposit information stored in the database", mixinStandardHelpOptions = true, showDefaultValues = true, abbreviateSynopsis = true, versionProvider = PicoCliVersionProvider.class, synopsisHeading = "%n", descriptionHeading = "%nDescription:%n%n", optionListHeading = "%nOptions:%n", footerHeading = "%n", footer = "Teku is licensed under the Apache License 2.0")
public int getDeposits(@Mixin final BeaconNodeDataOptions dataOptions, @Mixin final DataStorageOptions dataStorageOptions, @Mixin final Eth2NetworkOptions eth2NetworkOptions) throws Exception {
    try (final YamlEth1EventsChannel eth1EventsChannel = new YamlEth1EventsChannel(System.out);
        final Database database = createDatabase(dataOptions, dataStorageOptions, eth2NetworkOptions)) {
        final DepositStorage depositStorage = DepositStorage.create(eth1EventsChannel, database);
        depositStorage.replayDepositEvents().join();
    }
    return 0;
}
Also used : DepositStorage(tech.pegasys.teku.storage.server.DepositStorage) Database(tech.pegasys.teku.storage.server.Database) Command(picocli.CommandLine.Command)

Aggregations

DepositStorage (tech.pegasys.teku.storage.server.DepositStorage)2 Command (picocli.CommandLine.Command)1 Eth1EventsChannel (tech.pegasys.teku.pow.api.Eth1EventsChannel)1 VoteUpdateChannel (tech.pegasys.teku.storage.api.VoteUpdateChannel)1 Database (tech.pegasys.teku.storage.server.Database)1 VersionedDatabaseFactory (tech.pegasys.teku.storage.server.VersionedDatabaseFactory)1