public class MySQLFullPrunedBlockStore extends DatabaseFullPrunedBlockStore
A full pruned block store using the MySQL database engine. As an added bonus an address index is calculated,
so you can use DatabaseFullPrunedBlockStore.calculateBalanceForAddress(org.bitcoinj.core.Address)
to quickly look up
the quantity of bitcoins controlled by that address.
allConnections, chainHeadBlock, chainHeadHash, conn, connectionURL, fullStoreDepth, params, password, schemaName, username, verifiedChainHeadBlock, verifiedChainHeadHash
Constructor and Description |
---|
MySQLFullPrunedBlockStore(NetworkParameters params,
int fullStoreDepth,
String hostname,
String dbName,
String username,
String password)
Creates a new MySQLFullPrunedBlockStore.
|
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 |
getDeleteOpenoutputsSQL()
Get the SQL to delete a openoutputs record.
|
protected String |
getDuplicateKeyErrorCode()
Get the database specific error code that indicated a duplicate key error when inserting a record.
|
protected String |
getInsertOpenoutputsSQL()
Get the SQL to insert a openoutputs record.
|
protected String |
getSelectOpenoutputsSQL()
Get the SQL to select a openoutputs record.
|
protected String |
getTrasactionOutputSelectSQL()
Get the SQL to select the transaction outputs for a given address.
|
abortDatabaseBatchWrite, addUnspentTransactionOutput, beginDatabaseBatchWrite, calculateBalanceForAddress, close, commitDatabaseBatchWrite, deleteStore, dumpSizes, get, get, getBalanceSelectSQL, getChainHead, getChainHeadHeight, getCompatibilitySQL, getDeleteUndoableBlocksSQL, getDropTablesSQL, getInsertHeadersSQL, getInsertSettingsSQL, getInsertUndoableBlocksSQL, getOnceUndoableStoredBlock, getOpenTransactionOutputs, getParams, getSelectHeadersDumpSQL, getSelectHeadersSQL, getSelectOpenoutputsCountSQL, getSelectopenoutputsDumpSQL, getSelectSettingsDumpSQL, getSelectSettingsSQL, getSelectUndoableblocksDumpSQL, getSelectUndoableBlocksSQL, getTablesExistSQL, getTransactionOutput, getUndoBlock, getUpdateHeadersSQL, getUpdateSettingsSLQ, getUpdateUndoableBlocksSQL, getVerifiedChainHead, hasUnspentOutputs, maybeConnect, put, put, putUpdateStoredBlock, removeUnspentTransactionOutput, resetStore, setChainHead, setVerifiedChainHead
public MySQLFullPrunedBlockStore(NetworkParameters params, int fullStoreDepth, String hostname, String dbName, String username, String password) throws BlockStoreException
params
- A copy of the NetworkParameters usedfullStoreDepth
- The number of blocks of history stored in full (something like 1000 is pretty safe)hostname
- The hostname of the database to connect todbName
- The database to connect tousername
- The database usernamepassword
- The password to the databaseBlockStoreException
- 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 String getSelectOpenoutputsSQL()
DatabaseFullPrunedBlockStore
getSelectOpenoutputsSQL
in class DatabaseFullPrunedBlockStore
protected String getInsertOpenoutputsSQL()
DatabaseFullPrunedBlockStore
getInsertOpenoutputsSQL
in class DatabaseFullPrunedBlockStore
protected String getDeleteOpenoutputsSQL()
DatabaseFullPrunedBlockStore
getDeleteOpenoutputsSQL
in class DatabaseFullPrunedBlockStore
protected String getTrasactionOutputSelectSQL()
DatabaseFullPrunedBlockStore
getTrasactionOutputSelectSQL
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.