use of tech.pegasys.teku.services.chainstorage.StorageConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataPath_shouldReadFromConfigurationFile.
@Test
public void dataPath_shouldReadFromConfigurationFile() {
final TekuConfiguration tekuConfiguration = getTekuConfigurationFromFile("dataOptions_config.yaml");
final StorageConfiguration config = tekuConfiguration.storageConfiguration();
assertThat(tekuConfiguration.dataConfig().getDataBasePath()).isEqualTo(TEST_PATH);
assertThat(config.getDataStorageMode()).isEqualTo(ARCHIVE);
assertThat(config.getDataStorageCreateDbVersion()).isEqualTo(DatabaseVersion.V4);
assertThat(config.getDataStorageFrequency()).isEqualTo(128L);
}
use of tech.pegasys.teku.services.chainstorage.StorageConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataStorageCreateDbVersion_shouldAcceptNonDefaultValues.
@Test
public void dataStorageCreateDbVersion_shouldAcceptNonDefaultValues() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--Xdata-storage-create-db-version", "noop");
final StorageConfiguration config = tekuConfiguration.storageConfiguration();
assertThat(config.getDataStorageCreateDbVersion()).isEqualTo(DatabaseVersion.NOOP);
assertThat(createConfigBuilder().storageConfiguration(b -> b.dataStorageCreateDbVersion(DatabaseVersion.NOOP)).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.services.chainstorage.StorageConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataStorageCreateDbVersion_shouldDefault.
@Test
public void dataStorageCreateDbVersion_shouldDefault() {
final StorageConfiguration config = getTekuConfigurationFromArguments().storageConfiguration();
final DatabaseVersion expectedDefault = DatabaseVersion.isLevelDbSupported() ? DatabaseVersion.LEVELDB_TREE : DatabaseVersion.V5;
assertThat(config.getDataStorageCreateDbVersion()).isEqualTo(expectedDefault);
}
use of tech.pegasys.teku.services.chainstorage.StorageConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataStorageFrequency_shouldAcceptNonDefaultValues.
@Test
public void dataStorageFrequency_shouldAcceptNonDefaultValues() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--data-storage-archive-frequency", "1024000");
final StorageConfiguration config = tekuConfiguration.storageConfiguration();
assertThat(config.getDataStorageFrequency()).isEqualTo(1024000L);
assertThat(createConfigBuilder().storageConfiguration(b -> b.dataStorageFrequency(1024000L)).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.services.chainstorage.StorageConfiguration in project teku by ConsenSys.
the class DataOptionsTest method dataStorageMode_shouldAcceptPrune.
@Test
public void dataStorageMode_shouldAcceptPrune() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--data-storage-mode", "prune");
final StorageConfiguration config = tekuConfiguration.storageConfiguration();
assertThat(config.getDataStorageMode()).isEqualTo(PRUNE);
assertThat(createConfigBuilder().storageConfiguration(b -> b.dataStorageMode(PRUNE)).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
Aggregations