public class H2FullPrunedBlockStore extends DatabaseFullPrunedBlockStore
allConnections, chainHeadBlock, chainHeadHash, conn, connectionURL, fullStoreDepth, params, password, schemaName, username, verifiedChainHeadBlock, verifiedChainHeadHash
Constructor and Description |
---|
H2FullPrunedBlockStore(NetworkParameters params,
java.lang.String dbName,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore
|
H2FullPrunedBlockStore(NetworkParameters params,
java.lang.String dbName,
int fullStoreDepth,
int cacheSize)
Creates a new H2FullPrunedBlockStore with the given cache size
|
H2FullPrunedBlockStore(NetworkParameters params,
java.lang.String dbName,
java.lang.String username,
java.lang.String password,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore, with given credentials for H2 database
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<java.lang.String> |
getCreateIndexesSQL()
Get the SQL statements that create the indexes (DDL).
|
protected java.util.List<java.lang.String> |
getCreateSchemeSQL()
Get the SQL statements that create the schema (DDL).
|
protected java.util.List<java.lang.String> |
getCreateTablesSQL()
Get the SQL statements that create the tables (DDL).
|
protected java.lang.String |
getDatabaseDriverClass()
Get the database driver class,
|
protected java.lang.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, getTransactionOutputSelectSQL, getUndoBlock, getUpdateHeadersSQL, getUpdateSettingsSLQ, getUpdateUndoableBlocksSQL, getVerifiedChainHead, hasUnspentOutputs, maybeConnect, put, put, putUpdateStoredBlock, removeUnspentTransactionOutput, resetStore, setChainHead, setVerifiedChainHead
public H2FullPrunedBlockStore(NetworkParameters params, java.lang.String dbName, java.lang.String username, java.lang.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, java.lang.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, java.lang.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 java.lang.String getDuplicateKeyErrorCode()
DatabaseFullPrunedBlockStore
This is the code returned by SQLException.getSQLState()
getDuplicateKeyErrorCode
in class DatabaseFullPrunedBlockStore
protected java.util.List<java.lang.String> getCreateTablesSQL()
DatabaseFullPrunedBlockStore
getCreateTablesSQL
in class DatabaseFullPrunedBlockStore
protected java.util.List<java.lang.String> getCreateIndexesSQL()
DatabaseFullPrunedBlockStore
getCreateIndexesSQL
in class DatabaseFullPrunedBlockStore
protected java.util.List<java.lang.String> getCreateSchemeSQL()
DatabaseFullPrunedBlockStore
getCreateSchemeSQL
in class DatabaseFullPrunedBlockStore
protected java.lang.String getDatabaseDriverClass()
DatabaseFullPrunedBlockStore
i.e org.postgresql.Driver.
getDatabaseDriverClass
in class DatabaseFullPrunedBlockStore