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,
1325 auto onUnsavedLedger =
1329 auto onTransaction = [&ret, &app](
1337 if (existsTransaction())
1339 auto db = checkoutTransaction();
1341 detail::oldestAccountTxPage(
1342 *db, onUnsavedLedger, onTransaction, options, 0, page_length)
1344 return {ret, newmarker};
1347 if (shardStoreExists())
1351 iterateTransactionForward(
1355 if (opt.maxLedger != UINT32_MAX &&
1356 shardIndex > seqToShardIndex(opt.minLedger))
1358 auto [marker, total] = detail::oldestAccountTxPage(
1365 opt.marker = marker;
1368 limit_used += total;
1372 return {ret, opt.
marker};
1387 auto onUnsavedLedger =
1391 auto onTransaction = [&ret, &app](
1399 if (existsTransaction())
1401 auto db = checkoutTransaction();
1403 detail::newestAccountTxPage(
1404 *db, onUnsavedLedger, onTransaction, options, 0, page_length)
1406 return {ret, newmarker};
1409 if (shardStoreExists())
1413 iterateTransactionBack(
1417 if (opt.minLedger &&
1418 shardIndex < seqToShardIndex(opt.minLedger))
1420 auto [marker, total] = detail::newestAccountTxPage(
1427 opt.marker = marker;
1430 limit_used += total;
1434 return {ret, opt.
marker};
1449 auto onUnsavedLedger =
1452 auto onTransaction = [&ret](
1457 ret.
emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
1460 if (existsTransaction())
1462 auto db = checkoutTransaction();
1464 detail::oldestAccountTxPage(
1465 *db, onUnsavedLedger, onTransaction, options, 0, page_length)
1467 return {ret, newmarker};
1470 if (shardStoreExists())
1474 iterateTransactionForward(
1478 if (opt.maxLedger != UINT32_MAX &&
1479 shardIndex > seqToShardIndex(opt.minLedger))
1481 auto [marker, total] = detail::oldestAccountTxPage(
1488 opt.marker = marker;
1491 limit_used += total;
1495 return {ret, opt.
marker};
1510 auto onUnsavedLedger =
1513 auto onTransaction = [&ret](
1518 ret.
emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
1521 if (existsTransaction())
1523 auto db = checkoutTransaction();
1525 detail::newestAccountTxPage(
1526 *db, onUnsavedLedger, onTransaction, options, 0, page_length)
1528 return {ret, newmarker};
1531 if (shardStoreExists())
1535 iterateTransactionBack(
1539 if (opt.minLedger &&
1540 shardIndex < seqToShardIndex(opt.minLedger))
1542 auto [marker, total] = detail::newestAccountTxPage(
1549 opt.marker = marker;
1552 limit_used += total;
1556 return {ret, opt.
marker};
1563 SQLiteDatabaseImp::getTransaction(
1569 return TxSearched::unknown;
1571 if (existsTransaction())
1573 auto db = checkoutTransaction();
1574 return detail::getTransaction(*db, app_,
id,
range, ec);
1580 auto txMetaSession = txMetaDB_->checkoutDb();
1582 if (
auto const shardIndex =
1583 detail::getShardIndexforTransaction(*txMetaSession,
id))
1585 shardStore->callForTransactionSQLByShardIndex(
1586 *shardIndex, [&](soci::session& session) {
1591 range->lower(), firstLedgerSeq(*shardIndex));
1593 range->upper(), lastLedgerSeq(*shardIndex));
1597 res = detail::getTransaction(session, app_,
id, range1, ec);
1599 return res.
index() == 1 &&
1600 std::get<TxSearched>(res) !=
1601 TxSearched::unknown;
1608 return TxSearched::unknown;
1612 SQLiteDatabaseImp::ledgerDbHasSpace(
Config const& config)
1616 auto db = checkoutLedger();
1617 return detail::dbHasSpace(*db, config, j_);
1620 if (shardStoreExists())
1622 return iterateLedgerBack(
1624 return detail::dbHasSpace(session, config, j_);
1632 SQLiteDatabaseImp::transactionDbHasSpace(
Config const& config)
1637 if (existsTransaction())
1639 auto db = checkoutTransaction();
1640 return detail::dbHasSpace(*db, config, j_);
1643 if (shardStoreExists())
1645 return iterateTransactionBack(
1647 return detail::dbHasSpace(session, config, j_);
1655 SQLiteDatabaseImp::getKBUsedAll()
1662 if (shardStoreExists())
1677 SQLiteDatabaseImp::getKBUsedLedger()
1684 if (shardStoreExists())
1699 SQLiteDatabaseImp::getKBUsedTransaction()
1704 if (existsTransaction())
1709 if (shardStoreExists())
1712 iterateTransactionBack(
1724 SQLiteDatabaseImp::closeLedgerDB()
1730 SQLiteDatabaseImp::closeTransactionDB()
1738 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 minimum 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.
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.
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_