public class H2FullPrunedBlockStore extends DatabaseFullPrunedBlockStore
allConnections, chainHeadBlock, chainHeadHash, conn, connectionURL, fullStoreDepth, params, password, schemaName, username, verifiedChainHeadBlock, verifiedChainHeadHash
Constructor and Description |
---|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore
|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
int fullStoreDepth,
int cacheSize)
Creates a new H2FullPrunedBlockStore with the given cache size
|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
String username,
String password,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore, with given credentials for H2 database
|
Modifier and Type | Method and Description |
---|---|
protected List<String> |
getCreateIndexesSQL()
Get the SQL statements that create the indexes (DDL).
|
protected List<String> |
getCreateSchemeSQL()
Get the SQL statements that create the schema (DDL).
|
protected List<String> |
getCreateTablesSQL()
Get the SQL statements that create the tables (DDL).
|
protected String |
getDatabaseDriverClass()
Get the database driver class,
|
protected String |
getDuplicateKeyErrorCode()
Get the database specific error code that indicated a duplicate key error when inserting a record.
|
abortDatabaseBatchWrite, addUnspentTransactionOutput, beginDatabaseBatchWrite, calculateBalanceForAddress, close, commitDatabaseBatchWrite, deleteStore, dumpSizes, get, get, getBalanceSelectSQL, getChainHead, getChainHeadHeight, getCompatibilitySQL, getDeleteOpenoutputsSQL, getDeleteUndoableBlocksSQL, getDropTablesSQL, getInsertHeadersSQL, getInsertOpenoutputsSQL, getInsertSettingsSQL, getInsertUndoableBlocksSQL, getOnceUndoableStoredBlock, getOpenTransactionOutputs, getParams, getSelectHeadersDumpSQL, getSelectHeadersSQL, getSelectOpenoutputsCountSQL, getSelectopenoutputsDumpSQL, getSelectOpenoutputsSQL, getSelectSettingsDumpSQL, getSelectSettingsSQL, getSelectUndoableblocksDumpSQL, getSelectUndoableBlocksSQL, getTablesExistSQL, getTransactionOutput, getTrasactionOutputSelectSQL, getUndoBlock, getUpdateHeadersSQL, getUpdateSettingsSLQ, getUpdateUndoableBlocksSQL, getVerifiedChainHead, hasUnspentOutputs, maybeConnect, put, put, putUpdateStoredBlock, removeUnspentTransactionOutput, resetStore, setChainHead, setVerifiedChainHead
public H2FullPrunedBlockStore(NetworkParameters params, String dbName, String username, String password, int fullStoreDepth) throws BlockStoreException
params
- A copy of the NetworkParameters useddbName
- The path to the database on diskusername
- The username to use in the databasepassword
- The username's password to use in the databasefullStoreDepth
- The number of blocks of history stored in full (something like 1000 is pretty safe)BlockStoreException
- if the database fails to open for any reasonpublic H2FullPrunedBlockStore(NetworkParameters params, String dbName, int fullStoreDepth) throws BlockStoreException
params
- A copy of the NetworkParameters useddbName
- The path to the database on diskfullStoreDepth
- The number of blocks of history stored in full (something like 1000 is pretty safe)BlockStoreException
- if the database fails to open for any reasonpublic H2FullPrunedBlockStore(NetworkParameters params, String dbName, int fullStoreDepth, int cacheSize) throws BlockStoreException
params
- A copy of the NetworkParameters useddbName
- The path to the database on diskfullStoreDepth
- The number of blocks of history stored in full (something like 1000 is pretty safe)cacheSize
- The number of kilobytes to dedicate to H2 Cache (the default value of 16MB (16384) is a safe bet
to achieve good performance/cost when importing blocks from disk, past 32MB makes little sense,
and below 4MB sees a sharp drop in performance)BlockStoreException
- if the database fails to open for any reasonprotected String getDuplicateKeyErrorCode()
DatabaseFullPrunedBlockStore
This is the code returned by SQLException.getSQLState()
getDuplicateKeyErrorCode
in class DatabaseFullPrunedBlockStore
protected List<String> getCreateTablesSQL()
DatabaseFullPrunedBlockStore
getCreateTablesSQL
in class DatabaseFullPrunedBlockStore
protected List<String> getCreateIndexesSQL()
DatabaseFullPrunedBlockStore
getCreateIndexesSQL
in class DatabaseFullPrunedBlockStore
protected List<String> getCreateSchemeSQL()
DatabaseFullPrunedBlockStore
getCreateSchemeSQL
in class DatabaseFullPrunedBlockStore
protected String getDatabaseDriverClass()
DatabaseFullPrunedBlockStore
i.e org.postgresql.Driver.
getDatabaseDriverClass
in class DatabaseFullPrunedBlockStore
Copyright © 2016. All rights reserved.