use of org.ethereum.datasource.KeyValueDataSource in project rskj by rsksmart.
the class BlockChainImplTest method createBlockChain.
private static BlockChainImpl createBlockChain(Repository repository, IndexedBlockStore blockStore, BlockValidatorImpl blockValidator) {
KeyValueDataSource ds = new HashMapDB();
ds.init();
ReceiptStore receiptStore = new ReceiptStoreImpl(ds);
AdminInfo adminInfo = new SimpleAdminInfo();
EthereumListener listener = new BlockExecutorTest.SimpleEthereumListener();
BlockChainImpl blockChain = new BlockChainImpl(config, repository, blockStore, receiptStore, null, listener, adminInfo, blockValidator);
TransactionPoolImpl transactionPool = new TransactionPoolImpl(config, repository, blockStore, receiptStore, null, listener, 10, 100);
blockChain.setTransactionPool(transactionPool);
return blockChain;
}
use of org.ethereum.datasource.KeyValueDataSource in project rskj by rsksmart.
the class ContractDetailsImpl method checkDataSourceIsOpened.
private void checkDataSourceIsOpened() {
if (!this.closed) {
return;
}
if (!this.externalStorage) {
return;
}
logger.trace("reopening contract details data source");
KeyValueDataSource ds = levelDbByName(config, this.getDataSourceName());
TrieStoreImpl newStore = new TrieStoreImpl(ds);
Trie newTrie = newStore.retrieve(this.trie.getHash().getBytes());
this.trie = newTrie;
this.closed = false;
}
use of org.ethereum.datasource.KeyValueDataSource in project rskj by rsksmart.
the class CommonConfig method makeDataSource.
private KeyValueDataSource makeDataSource(RskSystemProperties config, String name) {
KeyValueDataSource ds = new LevelDbDataSource(config, name);
ds.init();
return ds;
}
use of org.ethereum.datasource.KeyValueDataSource in project rskj by rsksmart.
the class CommonConfig method repository.
@Bean
public Repository repository(RskSystemProperties config) {
String databaseDir = config.databaseDir();
if (config.databaseReset()) {
FileUtil.recursiveDelete(databaseDir);
logger.info("Database reset done");
}
KeyValueDataSource ds = makeDataSource(config, "state");
KeyValueDataSource detailsDS = makeDataSource(config, "details");
return new RepositoryImpl(config, new TrieStoreImpl(ds), detailsDS);
}
use of org.ethereum.datasource.KeyValueDataSource in project rskj by rsksmart.
the class DefaultConfig method receiptStore.
@Bean
public ReceiptStore receiptStore(RskSystemProperties config) {
KeyValueDataSource ds = new LevelDbDataSource(config, "receipts");
ds.init();
return new ReceiptStoreImpl(ds);
}
Aggregations