3#include <xrpl/rdb/RelationalDatabase.h>
443 return static_cast<bool>(
txdb_);
465 return txdb_->checkoutDb();
A generic endpoint for log messages.
A pool of threads to perform work.
bool existsLedger()
existsLedger Checks if the node store ledger database exists.
uint256 getHashByIndex(LedgerIndex ledgerIndex) override
getHashByIndex Returns the hash of the ledger with the given sequence.
MetaTxsList getNewestAccountTxsB(AccountTxOptions const &options) override
getNewestAccountTxsB Returns the newest transactions in binary form for the account that matches the ...
bool ledgerDbHasSpace(Config const &config)
ledgerDbHasSpace Checks if the ledger database has available space.
auto checkoutTransaction()
checkoutTransaction Checks out and returns the node store transaction database.
void deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) override
deleteTransactionByLedgerSeq Deletes transactions from the ledger with the given sequence.
std::optional< LedgerHeader > getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedOldestLedgerInfo Returns the info of the oldest ledger whose sequence number is greater tha...
bool makeLedgerDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeLedgerDBs Opens ledger and transaction databases for the node store, and stores their descriptors...
std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex) override
getTxHistory Returns the 20 most recent transactions starting from the given number.
AccountTxs getOldestAccountTxs(AccountTxOptions const &options) override
getOldestAccountTxs Returns the oldest transactions for the account that matches the given criteria s...
void closeTransactionDB() override
Closes the transaction database.
auto checkoutLedger()
checkoutTransaction Checks out and returns node store ledger database.
void closeLedgerDB() override
Closes the ledger database.
SQLiteDatabase & operator=(SQLiteDatabase const &)=delete
std::optional< LedgerHeader > getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedNewestLedgerInfo Returns the info of the newest ledger whose sequence number is greater tha...
CountMinMax getLedgerCountMinMax() override
getLedgerCountMinMax Returns the minimum ledger sequence, maximum ledger sequence and total number of...
std::unique_ptr< DatabaseCon > txdb_
MetaTxsList getOldestAccountTxsB(AccountTxOptions const &options) override
getOldestAccountTxsB Returns the oldest transactions in binary form for the account that matches the ...
bool saveValidatedLedger(std::shared_ptr< Ledger const > const &ledger, bool current) override
saveValidatedLedger Saves a ledger into the database.
std::optional< LedgerIndex > getMaxLedgerSeq() override
getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers table.
std::optional< LedgerIndex > getMinLedgerSeq() override
getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.
std::uint32_t getKBUsedTransaction() override
getKBUsedTransaction Returns the amount of space used by the transaction database.
std::uint32_t getKBUsedLedger() override
getKBUsedLedger Returns the amount of space space used by the ledger database.
AccountTxs getNewestAccountTxs(AccountTxOptions const &options) override
getNewestAccountTxs Returns the newest transactions for the account that matches the given criteria s...
void deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteAccountTransactionsBeforeLedgerSeq Deletes all account transactions with a sequence number less...
std::optional< LedgerIndex > getAccountTransactionsMinLedgerSeq() override
getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransacti...
std::size_t getAccountTransactionCount() override
getAccountTransactionCount Returns the number of account transactions.
bool existsTransaction()
existsTransaction Checks if the node store transaction database exists.
std::pair< AccountTxs, std::optional< AccountTxMarker > > newestAccountTxPage(AccountTxPageOptions const &options) override
newestAccountTxPage Returns the newest transactions for the account that matches the given criteria s...
std::pair< MetaTxsList, std::optional< AccountTxMarker > > oldestAccountTxPageB(AccountTxPageOptions const &options) override
oldestAccountTxPageB Returns the oldest transactions in binary form for the account that matches the ...
void deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteTransactionsBeforeLedgerSeq Deletes all transactions with a sequence number less than or equal ...
std::unique_ptr< DatabaseCon > ledgerDb_
std::optional< LedgerHeader > getLedgerInfoByHash(uint256 const &ledgerHash) override
getLedgerInfoByHash Returns the info of the ledger with given hash.
std::optional< LedgerHeader > getNewestLedgerInfo() override
getNewestLedgerInfo Returns the info of the newest saved ledger.
void deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteBeforeLedgerSeq Deletes all ledgers with a sequence number less than or equal to the given ledg...
std::uint32_t getKBUsedAll() override
getKBUsedAll Returns the amount of space used by all databases.
std::size_t getTransactionCount() override
getTransactionCount Returns the number of transactions.
ServiceRegistry & registry_
std::optional< LedgerHashPair > getHashesByIndex(LedgerIndex ledgerIndex) override
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
std::variant< AccountTx, TxSearched > getTransaction(uint256 const &id, std::optional< ClosedInterval< std::uint32_t > > const &range, error_code_i &ec) override
getTransaction Returns the transaction with the given hash.
std::optional< LedgerIndex > getTransactionsMinLedgerSeq() override
getTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the Transactions table.
std::pair< AccountTxs, std::optional< AccountTxMarker > > oldestAccountTxPage(AccountTxPageOptions const &options) override
oldestAccountTxPage Returns the oldest transactions for the account that matches the given criteria s...
bool transactionDbHasSpace(Config const &config)
transactionDbHasSpace Checks if the transaction database has available space.
std::pair< MetaTxsList, std::optional< AccountTxMarker > > newestAccountTxPageB(AccountTxPageOptions const &options) override
newestAccountTxPageB Returns the newest transactions in binary form for the account that matches the ...
SQLiteDatabase & operator=(SQLiteDatabase &&)=delete
std::optional< LedgerHeader > getLedgerInfoByIndex(LedgerIndex ledgerSeq) override
getLedgerInfoByIndex Returns a ledger by its sequence.
SQLiteDatabase(SQLiteDatabase const &)=delete
Service registry for dependency injection.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
@ current
This was a new validation and was added.
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
SQLiteDatabase setup_RelationalDatabase(ServiceRegistry ®istry, Config const &config, JobQueue &jobQueue)
setup_RelationalDatabase Creates and returns a SQLiteDatabase instance based on configuration.