20 #include <ripple/app/ledger/AcceptedLedger.h>
21 #include <ripple/app/ledger/LedgerMaster.h>
22 #include <ripple/app/ledger/LedgerToJson.h>
23 #include <ripple/app/ledger/TransactionMaster.h>
24 #include <ripple/app/misc/Manifest.h>
25 #include <ripple/app/misc/impl/AccountTxPaging.h>
26 #include <ripple/app/rdb/backend/SQLiteDatabase.h>
27 #include <ripple/app/rdb/backend/detail/Node.h>
28 #include <ripple/app/rdb/backend/detail/Shard.h>
29 #include <ripple/basics/BasicConfig.h>
30 #include <ripple/basics/StringUtilities.h>
31 #include <ripple/core/DatabaseCon.h>
32 #include <ripple/core/SociDB.h>
33 #include <ripple/json/to_string.h>
34 #include <ripple/nodestore/DatabaseShard.h>
35 #include <soci/sqlite3/soci-sqlite3.h>
48 ,
j_(
app_.journal(
"SQLiteDatabaseImp"))
57 "Failed to create ledger databases";
60 Throw<std::runtime_error>(error.data());
70 "Failed to create metadata databases";
73 Throw<std::runtime_error>(error.data());
113 bool current)
override;
271 return static_cast<bool>(
lgrdb_);
282 return static_cast<bool>(
txdb_);
303 return lgrdb_->checkoutDb();
314 return txdb_->checkoutDb();
331 ledgerSeq, callback);
348 ledgerSeq, callback);
366 bool(soci::session& session,
std::uint32_t shardIndex)>
const&
370 firstIndex, callback);
389 bool(soci::session& session,
std::uint32_t shardIndex)>
const&
393 firstIndex, callback);
412 bool(soci::session& session,
std::uint32_t shardIndex)>
const&
416 firstIndex, callback);
435 bool(soci::session& session,
std::uint32_t shardIndex)>
const&
439 firstIndex, callback);
449 auto [lgr, tx, res] =
451 txdb_ = std::move(tx);
462 auto [lgrMetaDB, txMetaDB] =
749 res.numberOfRows += r.numberOfRows;
750 if (res.minLedgerSequence == 0)
751 res.minLedgerSequence = r.minLedgerSequence;
752 res.maxLedgerSequence = r.maxLedgerSequence;
776 if (ledger->info().seq < shardStore->earliestLedgerSeq())
784 auto lgrMetaSession =
lgrMetaDB_->checkoutDb();
785 auto txMetaSession =
txMetaDB_->checkoutDb();
792 shardStore->seqToShardIndex(ledger->info().seq));
813 doLedger(ledgerSeq, [&](soci::session& session) {
874 session, ledgerFirstIndex,
j_))
907 session, ledgerFirstIndex,
j_))
936 auto lgrMetaSession =
lgrMetaDB_->checkoutDb();
938 if (
auto const shardIndex =
941 shardStore->callForLedgerSQLByShardIndex(
942 *shardIndex, [&](soci::session& session) {
969 doLedger(ledgerIndex, [&](soci::session& session) {
994 doLedger(ledgerIndex, [&](soci::session& session) {
1019 while (minSeq <= maxSeq)
1022 if (shardMaxSeq > maxSeq)
1023 shardMaxSeq = maxSeq;
1024 doLedger(minSeq, [&](soci::session& session) {
1027 res.
insert(r.begin(), r.end());
1030 minSeq = shardMaxSeq + 1;
1062 session,
app_, startIndex, quantity,
true);
1063 txs.
insert(txs.
end(), tx.begin(), tx.end());
1073 startIndex += total;
1109 if (opt.maxLedger &&
1110 shardIndex > seqToShardIndex(opt.maxLedger))
1112 auto [r, total] = detail::getOldestAccountTxs(
1113 session, app_, ledgerMaster, opt, limit_used, j_);
1114 ret.insert(ret.end(), r.begin(), r.end());
1119 limit_used += total;
1130 if (opt.offset <= total)
1133 opt.offset -= total;
1144 RelationalDatabase::AccountTxs
1152 if (existsTransaction())
1154 auto db = checkoutTransaction();
1155 return detail::getNewestAccountTxs(
1160 if (shardStoreExists())
1165 iterateTransactionBack(
1169 if (opt.minLedger &&
1170 shardIndex < seqToShardIndex(opt.minLedger))
1172 auto [r, total] = detail::getNewestAccountTxs(
1173 session, app_, ledgerMaster, opt, limit_used, j_);
1174 ret.insert(ret.end(), r.begin(), r.end());
1179 limit_used += total;
1190 if (opt.offset <= total)
1193 opt.offset -= total;
1204 RelationalDatabase::MetaTxsList
1210 if (existsTransaction())
1212 auto db = checkoutTransaction();
1213 return detail::getOldestAccountTxsB(*db, app_, options, {}, j_).first;
1216 if (shardStoreExists())
1221 iterateTransactionForward(
1225 if (opt.maxLedger &&
1226 shardIndex > seqToShardIndex(opt.maxLedger))
1228 auto [r, total] = detail::getOldestAccountTxsB(
1229 session, app_, opt, limit_used, j_);
1230 ret.insert(ret.end(), r.begin(), r.end());
1235 limit_used += total;
1246 if (opt.offset <= total)
1249 opt.offset -= total;
1260 RelationalDatabase::MetaTxsList
1266 if (existsTransaction())
1268 auto db = checkoutTransaction();
1269 return detail::getNewestAccountTxsB(*db, app_, options, {}, j_).first;
1272 if (shardStoreExists())
1277 iterateTransactionBack(
1281 if (opt.minLedger &&
1282 shardIndex < seqToShardIndex(opt.minLedger))
1284 auto [r, total] = detail::getNewestAccountTxsB(
1285 session, app_, opt, limit_used, j_);
1286 ret.insert(ret.end(), r.begin(), r.end());
1291 limit_used += total;
1302 if (opt.offset <= total)
1305 opt.offset -= total;
1317 RelationalDatabase::AccountTxs,
1326 auto onUnsavedLedger =
1330 auto onTransaction = [&ret, &app](
1338 if (existsTransaction())
1340 auto db = checkoutTransaction();
1341 auto newmarker = detail::oldestAccountTxPage(
1350 return {ret, newmarker};
1353 if (shardStoreExists())
1357 iterateTransactionForward(
1361 if (opt.maxLedger != UINT32_MAX &&
1362 shardIndex > seqToShardIndex(opt.minLedger))
1364 auto [marker, total] = detail::oldestAccountTxPage(
1372 opt.marker = marker;
1375 limit_used += total;
1379 return {ret, opt.
marker};
1395 auto onUnsavedLedger =
1399 auto onTransaction = [&ret, &app](
1407 if (existsTransaction())
1409 auto db = checkoutTransaction();
1410 auto newmarker = detail::newestAccountTxPage(
1419 return {ret, newmarker};
1422 if (shardStoreExists())
1426 iterateTransactionBack(
1430 if (opt.minLedger &&
1431 shardIndex < seqToShardIndex(opt.minLedger))
1433 auto [marker, total] = detail::newestAccountTxPage(
1441 opt.marker = marker;
1444 limit_used += total;
1448 return {ret, opt.
marker};
1464 auto onUnsavedLedger =
1467 auto onTransaction = [&ret](
1472 ret.
emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
1475 if (existsTransaction())
1477 auto db = checkoutTransaction();
1478 auto newmarker = detail::oldestAccountTxPage(
1487 return {ret, newmarker};
1490 if (shardStoreExists())
1494 iterateTransactionForward(
1498 if (opt.maxLedger != UINT32_MAX &&
1499 shardIndex > seqToShardIndex(opt.minLedger))
1501 auto [marker, total] = detail::oldestAccountTxPage(
1509 opt.marker = marker;
1512 limit_used += total;
1516 return {ret, opt.
marker};
1532 auto onUnsavedLedger =
1535 auto onTransaction = [&ret](
1540 ret.
emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
1543 if (existsTransaction())
1545 auto db = checkoutTransaction();
1546 auto newmarker = detail::newestAccountTxPage(
1555 return {ret, newmarker};
1558 if (shardStoreExists())
1562 iterateTransactionBack(
1566 if (opt.minLedger &&
1567 shardIndex < seqToShardIndex(opt.minLedger))
1569 auto [marker, total] = detail::newestAccountTxPage(
1577 opt.marker = marker;
1580 limit_used += total;
1584 return {ret, opt.
marker};
1591 SQLiteDatabaseImp::getTransaction(
1597 return TxSearched::unknown;
1599 if (existsTransaction())
1601 auto db = checkoutTransaction();
1602 return detail::getTransaction(*db, app_,
id,
range, ec);
1608 auto txMetaSession = txMetaDB_->checkoutDb();
1610 if (
auto const shardIndex =
1611 detail::getShardIndexforTransaction(*txMetaSession,
id))
1613 shardStore->callForTransactionSQLByShardIndex(
1614 *shardIndex, [&](soci::session& session) {
1619 range->lower(), firstLedgerSeq(*shardIndex));
1621 range->upper(), lastLedgerSeq(*shardIndex));
1625 res = detail::getTransaction(session, app_,
id, range1, ec);
1627 return res.
index() == 1 &&
1628 std::get<TxSearched>(res) !=
1629 TxSearched::unknown;
1636 return TxSearched::unknown;
1640 SQLiteDatabaseImp::ledgerDbHasSpace(
Config const& config)
1644 auto db = checkoutLedger();
1645 return detail::dbHasSpace(*db, config, j_);
1648 if (shardStoreExists())
1650 return iterateLedgerBack(
1652 return detail::dbHasSpace(session, config, j_);
1660 SQLiteDatabaseImp::transactionDbHasSpace(
Config const& config)
1665 if (existsTransaction())
1667 auto db = checkoutTransaction();
1668 return detail::dbHasSpace(*db, config, j_);
1671 if (shardStoreExists())
1673 return iterateTransactionBack(
1675 return detail::dbHasSpace(session, config, j_);
1683 SQLiteDatabaseImp::getKBUsedAll()
1690 if (shardStoreExists())
1705 SQLiteDatabaseImp::getKBUsedLedger()
1712 if (shardStoreExists())
1727 SQLiteDatabaseImp::getKBUsedTransaction()
1732 if (existsTransaction())
1737 if (shardStoreExists())
1740 iterateTransactionBack(
1752 SQLiteDatabaseImp::closeLedgerDB()
1758 SQLiteDatabaseImp::closeTransactionDB()
1766 return std::make_unique<SQLiteDatabaseImp>(app, config, jobQueue);
void deleteByLedgerSeq(soci::session &session, TableType type, LedgerIndex ledgerSeq)
deleteByLedgerSeq Deletes all entries in given table for the ledger with given sequence.
std::uint32_t lastLedgerSeq(std::uint32_t shardIndex) const noexcept
Calculates the last ledger sequence for a given shard index.
@ ledgerMaster
ledger master data for signing
std::optional< LedgerInfo > getNewestLedgerInfo(soci::session &session, beast::Journal j)
getNewestLedgerInfo Returns info of newest saved ledger.
virtual bool callForLedgerSQLByLedgerSeq(LedgerIndex ledgerSeq, std::function< bool(soci::session &session)> const &callback)=0
Invoke a callback on the SQLite db holding the corresponding ledger.
std::unique_ptr< DatabaseCon > lgrMetaDB_
void deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteBeforeLedgerSeq Deletes all ledgers with a sequence number less than or equal to the given ledg...
void deleteBeforeLedgerSeq(soci::session &session, TableType type, LedgerIndex ledgerSeq)
deleteBeforeLedgerSeq Deletes all entries in given table for the ledgers with given sequence and all ...
bool saveLedgerMeta(std::shared_ptr< Ledger const > const &ledger, Application &app, soci::session &lgrMetaSession, soci::session &txnMetaSession, std::uint32_t const shardIndex)
saveLedgerMeta Stores (transaction ID -> shard index) and (ledger hash -> shard index) mappings in th...
bool existsLedger()
existsLedger Checks if the node store ledger database exists.
std::uint32_t seqToShardIndex(LedgerIndex ledgerSeq)
seqToShardIndex Provides the index of the shard that stores the ledger with the given sequence.
std::uint32_t getKBUsedLedger() override
getKBUsedLedger Returns the amount of space space used by the ledger database.
bool iterateLedgerForward(std::optional< std::uint32_t > firstIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)
iterateLedgerForward Checks out ledger databases for all shards in ascending order starting from the ...
std::optional< LedgerInfo > getLedgerInfoByIndex(LedgerIndex ledgerSeq) override
getLedgerInfoByIndex Returns a ledger by its sequence.
bool saveValidatedLedger(std::shared_ptr< Ledger const > const &ledger, bool current) override
saveValidatedLedger Saves a ledger into the database.
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
DatabasePair makeMetaDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeMetaDBs Opens ledger and transaction 'meta' databases which map ledger hashes and transaction IDs...
std::uint32_t getKBUsedTransaction() override
getKBUsedTransaction Returns the amount of space used by the transaction database.
RelationalDatabase::CountMinMax getRowsMinMax(soci::session &session, TableType type)
getRowsMinMax Returns minumum ledger sequence, maximum ledger sequence and total number of rows in gi...
bool makeMetaDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeMetaDBs Opens shard index lookup databases, and stores their descriptors in private member variab...
void convertBlobsToTxResult(RelationalDatabase::AccountTxs &to, std::uint32_t ledger_index, std::string const &status, Blob const &rawTxn, Blob const &rawMeta, Application &app)
std::vector< AccountTx > AccountTxs
bool doLedger(LedgerIndex ledgerSeq, std::function< bool(soci::session &session)> const &callback)
doLedger Checks out the ledger database owned by the shard containing the given ledger,...
std::uint32_t getKBUsedDB(soci::session &s)
bool iterateLedgerBack(std::optional< std::uint32_t > firstIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)
iterateLedgerBack Checks out ledger databases for all shards in descending order starting from the gi...
virtual NodeStore::DatabaseShard * getShardStore()=0
virtual bool callForTransactionSQLByLedgerSeq(LedgerIndex ledgerSeq, std::function< bool(soci::session &session)> const &callback)=0
Invoke a callback on the transaction SQLite db for the corresponding ledger.
bool transactionDbHasSpace(Config const &config) override
transactionDbHasSpace Checks if the transaction database has available space.
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::optional< LedgerInfo > getLimitedOldestLedgerInfo(soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
getLimitedOldestLedgerInfo Returns info of oldest ledger from ledgers with sequences greather or equa...
LedgerIndex firstLedgerSeq(std::uint32_t shardIndex)
firstLedgerSeq Returns the sequence of the first ledger stored in the shard specified by the shard in...
std::optional< LedgerIndex > getMaxLedgerSeq() override
getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers table.
void deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteAccountTransactionsBeforeLedgerSeq Deletes all account transactions with a sequence number less...
uint256 getHashByIndex(soci::session &session, LedgerIndex ledgerIndex)
getHashByIndex Returns hash of ledger with given sequence.
std::optional< LedgerInfo > getLedgerInfoByHash(soci::session &session, uint256 const &ledgerHash, beast::Journal j)
getLedgerInfoByHash Returns info of ledger with given hash.
virtual AccountIDCache const & accountIDCache() const =0
bool saveValidatedLedger(DatabaseCon &ldgDB, DatabaseCon &txnDB, Application &app, std::shared_ptr< Ledger const > const &ledger, bool current)
saveValidatedLedger Saves ledger into database.
std::optional< LedgerInfo > getLimitedNewestLedgerInfo(soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
getLimitedNewestLedgerInfo Returns info of newest ledger from ledgers with sequences greather or equa...
bool ledgerDbHasSpace(Config const &config) override
ledgerDbHasSpace Checks if the ledger database has available space.
Integers of any length that is a multiple of 32-bits.
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::unique_ptr< DatabaseCon > txdb_
std::uint32_t firstLedgerSeq(std::uint32_t shardIndex) const noexcept
Calculates the first ledger sequence for a given shard index.
std::uint32_t getKBUsedAll(soci::session &s)
std::pair< std::vector< std::shared_ptr< Transaction > >, int > getTxHistory(soci::session &session, Application &app, LedgerIndex startIndex, int quantity, bool count)
getTxHistory Returns given number of most recent transactions starting from given number of entry.
std::optional< LedgerIndex > getAccountTransactionsMinLedgerSeq() override
getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransacti...
uint256 getHashByIndex(LedgerIndex ledgerIndex) override
getHashByIndex Returns the hash of the ledger with the given sequence.
LedgerIndex lastLedgerSeq(std::uint32_t shardIndex)
lastLedgerSeq Returns the sequence of the last ledger stored in the shard specified by the shard inde...
virtual LedgerMaster & getLedgerMaster()=0
std::size_t getAccountTransactionCount() override
getAccountTransactionCount Returns the number of account transactions.
std::vector< txnMetaLedgerType > MetaTxsList
virtual bool iterateLedgerSQLsBack(std::optional< std::uint32_t > maxShardIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)=0
iterateLedgerSQLsBack Checks out ledger databases for all shards in descending order starting from gi...
bool existsTransaction()
existsTransaction Checks if the node store transaction database exists.
virtual bool iterateLedgerSQLsForward(std::optional< std::uint32_t > minShardIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)=0
iterateLedgerSQLsForward Checks out ledger databases for all shards in ascending order starting from ...
void saveLedgerAsync(Application &app, std::uint32_t seq)
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 ...
auto checkoutTransaction()
checkoutTransaction Checks out and returns the node store transaction database.
DatabasePairValid makeLedgerDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeLedgerDBs Opens ledger and transactions databases.
MetaTxsList getOldestAccountTxsB(AccountTxOptions const &options) override
getOldestAccountTxsB Returns the oldest transactions in binary form for the account that matches the ...
bool iterateTransactionForward(std::optional< std::uint32_t > firstIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)
iterateTransactionForward Checks out transaction databases for all shards in ascending order starting...
std::optional< LedgerIndex > getTransactionsMinLedgerSeq() override
getTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the Transactions table.
AccountTxs getNewestAccountTxs(AccountTxOptions const &options) override
getNewestAccountTxs Returns the newest transactions for the account that matches the given criteria s...
std::optional< LedgerInfo > getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedOldestLedgerInfo Returns the info of the oldest ledger whose sequence number is greater tha...
@ current
This was a new validation and was added.
A generic endpoint for log messages.
std::uint32_t getKBUsedAll() override
getKBUsedAll Returns the amount of space used by all databases.
void deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteTransactionsBeforeLedgerSeq Deletes all transactions with a sequence number less than or equal ...
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
std::size_t getRows(soci::session &session, TableType type)
getRows Returns number of rows in given table.
std::optional< LedgerInfo > getLedgerInfoByIndex(soci::session &session, LedgerIndex ledgerSeq, beast::Journal j)
getLedgerInfoByIndex Returns ledger by its sequence.
std::optional< std::uint32_t > getShardIndexforLedger(soci::session &session, LedgerHash const &hash)
getShardIndexforLedger Queries the ledger meta database to retrieve the index of the shard that conta...
std::variant< AccountTx, TxSearched > getTransaction(uint256 const &id, std::optional< ClosedInterval< std::uint32_t >> const &range, error_code_i &ec) override
A pool of threads to perform work.
void closeLedgerDB() override
Closes the ledger database.
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::optional< LedgerIndex > getMinLedgerSeq(soci::session &session, TableType type)
getMinLedgerSeq Returns minimum ledger sequence in given table.
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 ...
std::optional< LedgerInfo > getNewestLedgerInfo() override
getNewestLedgerInfo Returns the info of the newest saved ledger.
std::unique_ptr< DatabaseCon > lgrdb_
std::optional< LedgerInfo > getLedgerInfoByHash(uint256 const &ledgerHash) override
getLedgerInfoByHash Returns the info of the ledger with given hash.
std::uint32_t seqToShardIndex(std::uint32_t ledgerSeq) const noexcept
Calculates the shard index for a given ledger sequence.
auto checkoutLedger()
checkoutTransaction Checks out and returns node store ledger database.
SQLiteDatabaseImp(Application &app, Config const &config, JobQueue &jobQueue)
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...
void deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) override
deleteTransactionByLedgerSeq Deletes transactions from the ledger with the given sequence.
std::optional< LedgerIndex > getMinLedgerSeq() override
getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.
std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex) override
getTxHistory Returns the 20 most recent transactions starting from the given number.
bool doTransaction(LedgerIndex ledgerSeq, std::function< bool(soci::session &session)> const &callback)
doTransaction Checks out the transaction database owned by the shard containing the given ledger,...
void closeTransactionDB() override
Closes the transaction database.
std::optional< LedgerInfo > getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedNewestLedgerInfo Returns the info of the newest ledger whose sequence number is greater tha...
MetaTxsList getNewestAccountTxsB(AccountTxOptions const &options) override
getNewestAccountTxsB Returns the newest transactions in binary form for the account that matches the ...
RelationalDatabase::CountMinMax getLedgerCountMinMax() override
getLedgerCountMinMax Returns the minimum ledger sequence, maximum ledger sequence and total number of...
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
bool iterateTransactionBack(std::optional< std::uint32_t > firstIndex, std::function< bool(soci::session &session, std::uint32_t shardIndex)> const &callback)
iterateTransactionBack Checks out transaction databases for all shards in descending order starting f...
std::pair< RelationalDatabase::AccountTxs, int > getOldestAccountTxs(soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
getOldestAccountTxs Returns oldest transactions for given account which match given criteria starting...
std::optional< LedgerIndex > getMaxLedgerSeq(soci::session &session, TableType type)
getMaxLedgerSeq Returns maximum ledger sequence in given table.
std::size_t getTransactionCount() override
getTransactionCount Returns the number of transactions.
std::optional< LedgerHashPair > getHashesByIndex(soci::session &session, LedgerIndex ledgerIndex, beast::Journal j)
getHashesByIndex Returns hash of the ledger and hash of parent ledger for the ledger of given sequenc...
std::optional< LedgerHashPair > getHashesByIndex(LedgerIndex ledgerIndex) override
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
AccountTxs getOldestAccountTxs(AccountTxOptions const &options) override
getOldestAccountTxs Returns the oldest transactions for the account that matches the given criteria s...
std::optional< AccountTxMarker > marker
std::unique_ptr< RelationalDatabase > getSQLiteDatabase(Application &app, Config const &config, JobQueue &jobQueue)
bool shardStoreExists()
shardStoreExists Checks whether the shard store exists
std::unique_ptr< DatabaseCon > txMetaDB_