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);
});
}
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;
}
Aggregations