20#ifndef RIPPLE_APP_RDB_RELATIONALDATABASE_H_INCLUDED
21#define RIPPLE_APP_RDB_RELATIONALDATABASE_H_INCLUDED
23#include <xrpld/app/ledger/Ledger.h>
24#include <xrpld/app/main/Application.h>
25#include <xrpld/app/misc/Transaction.h>
26#include <xrpld/core/Config.h>
27#include <xrpld/core/DatabaseCon.h>
28#include <xrpld/rpc/detail/RPCHelpers.h>
30#include <xrpl/beast/utility/instrumentation.h>
32#include <boost/filesystem.hpp>
33#include <boost/variant.hpp>
228template <
class T,
class C>
239 UNREACHABLE(
"ripple::rangeCheckedCast : domain error");
241 <<
"rangeCheckedCast domain error:"
246 return static_cast<T
>(c);
A pool of threads to perform work.
virtual std::optional< LedgerInfo > getNewestLedgerInfo()=0
getNewestLedgerInfo Returns the info of the newest saved ledger.
virtual ~RelationalDatabase()=default
virtual std::optional< LedgerInfo > getLedgerInfoByIndex(LedgerIndex ledgerSeq)=0
getLedgerInfoByIndex Returns a ledger by its sequence.
virtual std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex)=0
getTxHistory Returns the 20 most recent transactions starting from the given number.
virtual bool transactionDbHasSpace(Config const &config)=0
transactionDbHasSpace Checks if the transaction database has available space.
virtual std::optional< LedgerIndex > getMaxLedgerSeq()=0
getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers table.
virtual bool ledgerDbHasSpace(Config const &config)=0
ledgerDbHasSpace Checks if the ledger database has available space.
static std::unique_ptr< RelationalDatabase > init(Application &app, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
virtual std::optional< LedgerHashPair > getHashesByIndex(LedgerIndex ledgerIndex)=0
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
virtual std::optional< LedgerIndex > getMinLedgerSeq()=0
getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.
virtual std::map< LedgerIndex, LedgerHashPair > getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq)=0
getHashesByIndex Returns hashes of each ledger and its parent for all ledgers within the provided ran...
virtual std::optional< LedgerInfo > getLedgerInfoByHash(uint256 const &ledgerHash)=0
getLedgerInfoByHash Returns the info of the ledger with given hash.
virtual uint256 getHashByIndex(LedgerIndex ledgerIndex)=0
getHashByIndex Returns the hash of the ledger with the given sequence.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
beast::Journal debugLog()
Returns a debug journal.
std::optional< AccountTxMarker > marker
std::optional< LedgerSpecifier > ledger
AccountID const & account
AccountID const & account
std::optional< AccountTxMarker > marker
std::optional< AccountTxMarker > marker
std::variant< AccountTxs, MetaTxsList > transactions
LedgerIndex maxLedgerSequence
LedgerIndex minLedgerSequence