rippled
Loading...
Searching...
No Matches
SQLiteDatabase.cpp
1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/app/ledger/TransactionMaster.h>
3#include <xrpld/app/misc/detail/AccountTxPaging.h>
4#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
5#include <xrpld/app/rdb/backend/detail/Node.h>
6
7#include <xrpl/basics/StringUtilities.h>
8#include <xrpl/rdb/DatabaseCon.h>
9#include <xrpl/rdb/SociDB.h>
10
11namespace xrpl {
12
13bool
15 Config const& config,
16 DatabaseCon::Setup const& setup,
17 DatabaseCon::CheckpointerSetup const& checkpointerSetup)
18{
19 auto [lgr, tx, res] = detail::makeLedgerDBs(config, setup, checkpointerSetup, j_);
20 txdb_ = std::move(tx);
21 ledgerDb_ = std::move(lgr);
22 return res;
23}
24
27{
28 /* if databases exists, use it */
29 if (existsLedger())
30 {
31 auto db = checkoutLedger();
33 }
34
35 /* else return empty value */
36 return {};
37}
38
41{
42 if (!useTxTables_)
43 return {};
44
46 {
47 auto db = checkoutTransaction();
49 }
50
51 return {};
52}
53
56{
57 if (!useTxTables_)
58 return {};
59
61 {
62 auto db = checkoutTransaction();
64 }
65
66 return {};
67}
68
71{
72 if (existsLedger())
73 {
74 auto db = checkoutLedger();
76 }
77
78 return {};
79}
80
81void
83{
84 if (!useTxTables_)
85 return;
86
88 {
89 auto db = checkoutTransaction();
91 return;
92 }
93}
94
95void
97{
98 if (existsLedger())
99 {
100 auto db = checkoutLedger();
102 return;
103 }
104}
105
106void
108{
109 if (!useTxTables_)
110 return;
111
112 if (existsTransaction())
113 {
114 auto db = checkoutTransaction();
116 return;
117 }
118}
119
120void
122{
123 if (!useTxTables_)
124 return;
125
126 if (existsTransaction())
127 {
128 auto db = checkoutTransaction();
130 return;
131 }
132}
133
136{
137 if (!useTxTables_)
138 return 0;
139
140 if (existsTransaction())
141 {
142 auto db = checkoutTransaction();
144 }
145
146 return 0;
147}
148
151{
152 if (!useTxTables_)
153 return 0;
154
155 if (existsTransaction())
156 {
157 auto db = checkoutTransaction();
159 }
160
161 return 0;
162}
163
166{
167 if (existsLedger())
168 {
169 auto db = checkoutLedger();
171 }
172
173 return {0, 0, 0};
174}
175
176bool
178{
179 if (existsLedger())
180 {
182 *ledgerDb_, txdb_, registry_.get().getApp(), ledger, current))
183 return false;
184 }
185
186 return true;
187}
188
191{
192 if (existsLedger())
193 {
194 auto db = checkoutLedger();
195 auto const res = detail::getLedgerInfoByIndex(*db, ledgerSeq, j_);
196
197 if (res.has_value())
198 return res;
199 }
200
201 return {};
202}
203
206{
207 if (existsLedger())
208 {
209 auto db = checkoutLedger();
210 auto const res = detail::getNewestLedgerInfo(*db, j_);
211
212 if (res.has_value())
213 return res;
214 }
215
216 return {};
217}
218
221{
222 if (existsLedger())
223 {
224 auto db = checkoutLedger();
225 auto const res = detail::getLimitedOldestLedgerInfo(*db, ledgerFirstIndex, j_);
226
227 if (res.has_value())
228 return res;
229 }
230
231 return {};
232}
233
236{
237 if (existsLedger())
238 {
239 auto db = checkoutLedger();
240 auto const res = detail::getLimitedNewestLedgerInfo(*db, ledgerFirstIndex, j_);
241
242 if (res.has_value())
243 return res;
244 }
245
246 return {};
247}
248
251{
252 if (existsLedger())
253 {
254 auto db = checkoutLedger();
255 auto const res = detail::getLedgerInfoByHash(*db, ledgerHash, j_);
256
257 if (res.has_value())
258 return res;
259 }
260
261 return {};
262}
263
266{
267 if (existsLedger())
268 {
269 auto db = checkoutLedger();
270 auto const res = detail::getHashByIndex(*db, ledgerIndex);
271
272 if (res.isNonZero())
273 return res;
274 }
275
276 return uint256();
277}
278
281{
282 if (existsLedger())
283 {
284 auto db = checkoutLedger();
285 auto const res = detail::getHashesByIndex(*db, ledgerIndex, j_);
286
287 if (res.has_value())
288 return res;
289 }
290
291 return {};
292}
293
296{
297 if (existsLedger())
298 {
299 auto db = checkoutLedger();
300 auto const res = detail::getHashesByIndex(*db, minSeq, maxSeq, j_);
301
302 if (!res.empty())
303 return res;
304 }
305
306 return {};
307}
308
311{
312 if (!useTxTables_)
313 return {};
314
315 if (existsTransaction())
316 {
317 auto db = checkoutTransaction();
318 auto const res = detail::getTxHistory(*db, registry_.get().getApp(), startIndex, 20).first;
319
320 if (!res.empty())
321 return res;
322 }
323
324 return {};
325}
326
329{
330 if (!useTxTables_)
331 return {};
332
333 LedgerMaster& ledgerMaster = registry_.get().getLedgerMaster();
334
335 if (existsTransaction())
336 {
337 auto db = checkoutTransaction();
338 return detail::getOldestAccountTxs(*db, registry_.get().getApp(), ledgerMaster, options, j_)
339 .first;
340 }
341
342 return {};
343}
344
347{
348 if (!useTxTables_)
349 return {};
350
351 LedgerMaster& ledgerMaster = registry_.get().getLedgerMaster();
352
353 if (existsTransaction())
354 {
355 auto db = checkoutTransaction();
356 return detail::getNewestAccountTxs(*db, registry_.get().getApp(), ledgerMaster, options, j_)
357 .first;
358 }
359
360 return {};
361}
362
365{
366 if (!useTxTables_)
367 return {};
368
369 if (existsTransaction())
370 {
371 auto db = checkoutTransaction();
372 return detail::getOldestAccountTxsB(*db, registry_.get().getApp(), options, j_).first;
373 }
374
375 return {};
376}
377
380{
381 if (!useTxTables_)
382 return {};
383
384 if (existsTransaction())
385 {
386 auto db = checkoutTransaction();
387 return detail::getNewestAccountTxsB(*db, registry_.get().getApp(), options, j_).first;
388 }
389
390 return {};
391}
392
395{
396 if (!useTxTables_)
397 return {};
398
399 static std::uint32_t const page_length(200);
400 auto onUnsavedLedger =
401 std::bind(saveLedgerAsync, std::ref(registry_.get().getApp()), std::placeholders::_1);
402 AccountTxs ret;
403 auto onTransaction = [&ret, &app = registry_.get().getApp()](
404 std::uint32_t ledger_index,
405 std::string const& status,
406 Blob const& rawTxn,
407 Blob const& rawMeta) {
408 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
409 };
410
411 if (existsTransaction())
412 {
413 auto db = checkoutTransaction();
414 auto newmarker =
415 detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length)
416 .first;
417 return {ret, newmarker};
418 }
419
420 return {};
421}
422
425{
426 if (!useTxTables_)
427 return {};
428
429 static std::uint32_t const page_length(200);
430 auto onUnsavedLedger =
431 std::bind(saveLedgerAsync, std::ref(registry_.get().getApp()), std::placeholders::_1);
432 AccountTxs ret;
433 auto onTransaction = [&ret, &app = registry_.get().getApp()](
434 std::uint32_t ledger_index,
435 std::string const& status,
436 Blob const& rawTxn,
437 Blob const& rawMeta) {
438 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
439 };
440
441 if (existsTransaction())
442 {
443 auto db = checkoutTransaction();
444 auto newmarker =
445 detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length)
446 .first;
447 return {ret, newmarker};
448 }
449
450 return {};
451}
452
455{
456 if (!useTxTables_)
457 return {};
458
459 static std::uint32_t const page_length(500);
460 auto onUnsavedLedger =
461 std::bind(saveLedgerAsync, std::ref(registry_.get().getApp()), std::placeholders::_1);
462 MetaTxsList ret;
463 auto onTransaction =
464 [&ret](
465 std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
466 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
467 };
468
469 if (existsTransaction())
470 {
471 auto db = checkoutTransaction();
472 auto newmarker =
473 detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length)
474 .first;
475 return {ret, newmarker};
476 }
477
478 return {};
479}
480
483{
484 if (!useTxTables_)
485 return {};
486
487 static std::uint32_t const page_length(500);
488 auto onUnsavedLedger =
489 std::bind(saveLedgerAsync, std::ref(registry_.get().getApp()), std::placeholders::_1);
490 MetaTxsList ret;
491 auto onTransaction =
492 [&ret](
493 std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
494 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
495 };
496
497 if (existsTransaction())
498 {
499 auto db = checkoutTransaction();
500 auto newmarker =
501 detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length)
502 .first;
503 return {ret, newmarker};
504 }
505
506 return {};
507}
508
511 uint256 const& id,
513 error_code_i& ec)
514{
515 if (!useTxTables_)
516 return TxSearched::Unknown;
517
518 if (existsTransaction())
519 {
520 auto db = checkoutTransaction();
521 return detail::getTransaction(*db, registry_.get().getApp(), id, range, ec);
522 }
523
524 return TxSearched::Unknown;
525}
526
528 : registry_(rhs.registry_), useTxTables_(rhs.useTxTables_), j_(rhs.j_)
529{
530 std::exchange(ledgerDb_, std::move(rhs.ledgerDb_));
531 std::exchange(txdb_, std::move(rhs.txdb_));
532}
533
534bool
536{
537 if (existsLedger())
538 {
539 auto db = checkoutLedger();
540 return detail::dbHasSpace(*db, config, j_);
541 }
542
543 return true;
544}
545
546bool
548{
549 if (!useTxTables_)
550 return true;
551
552 if (existsTransaction())
553 {
554 auto db = checkoutTransaction();
555 return detail::dbHasSpace(*db, config, j_);
556 }
557
558 return true;
559}
560
563{
564 if (existsLedger())
565 {
566 return xrpl::getKBUsedAll(ledgerDb_->getSession());
567 }
568
569 return 0;
570}
571
574{
575 if (existsLedger())
576 {
577 return xrpl::getKBUsedDB(ledgerDb_->getSession());
578 }
579
580 return 0;
581}
582
585{
586 if (!useTxTables_)
587 return 0;
588
589 if (existsTransaction())
590 {
591 return xrpl::getKBUsedDB(txdb_->getSession());
592 }
593
594 return 0;
595}
596
597void
602
603void
608
610 : registry_(registry)
611 , useTxTables_(config.useTxTables())
612 , j_(registry.getJournal("SQLiteDatabase"))
613{
614 DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_);
615 if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, registry_}))
616 {
617 std::string_view constexpr error = "Failed to create ledger databases";
618
619 JLOG(j_.fatal()) << error;
620 Throw<std::runtime_error>(error.data());
621 }
622}
623
625setup_RelationalDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue)
626{
627 return {registry, config, jobQueue};
628}
629
630} // namespace xrpl
T bind(T... args)
Stream fatal() const
Definition Journal.h:325
A pool of threads to perform work.
Definition JobQueue.h:38
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...
SQLiteDatabase(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
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.
std::reference_wrapper< ServiceRegistry > registry_
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.
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 ...
std::optional< LedgerHeader > getLedgerInfoByIndex(LedgerIndex ledgerSeq) override
getLedgerInfoByIndex Returns a ledger by its sequence.
Service registry for dependency injection.
T emplace_back(T... args)
T exchange(T... args)
std::optional< LedgerHeader > getLedgerInfoByHash(soci::session &session, uint256 const &ledgerHash, beast::Journal j)
getLedgerInfoByHash Returns info of ledger with given hash.
Definition Node.cpp:471
bool saveValidatedLedger(DatabaseCon &ldgDB, std::unique_ptr< DatabaseCon > const &txnDB, Application &app, std::shared_ptr< Ledger const > const &ledger, bool current)
saveValidatedLedger Saves ledger into database.
Definition Node.cpp:165
void deleteBeforeLedgerSeq(soci::session &session, TableType type, LedgerIndex ledgerSeq)
deleteBeforeLedgerSeq Deletes all entries in given table for the ledgers with given sequence and all ...
Definition Node.cpp:132
std::optional< LedgerIndex > getMinLedgerSeq(soci::session &session, TableType type)
getMinLedgerSeq Returns minimum ledger sequence in given table.
Definition Node.cpp:106
std::optional< LedgerIndex > getMaxLedgerSeq(soci::session &session, TableType type)
getMaxLedgerSeq Returns maximum ledger sequence in given table.
Definition Node.cpp:116
std::pair< RelationalDatabase::AccountTxs, int > getNewestAccountTxs(soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDatabase::AccountTxOptions const &options, beast::Journal j)
getNewestAccountTxs Returns newest transactions for given account which match given criteria starting...
Definition Node.cpp:831
std::pair< std::vector< std::shared_ptr< Transaction > >, int > getTxHistory(soci::session &session, Application &app, LedgerIndex startIndex, int quantity)
getTxHistory Returns given number of most recent transactions starting from given number of entry.
Definition Node.cpp:572
std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > getOldestAccountTxsB(soci::session &session, Application &app, RelationalDatabase::AccountTxOptions const &options, beast::Journal j)
getOldestAccountTxsB Returns oldest transactions in binary form for given account which match given c...
Definition Node.cpp:919
std::optional< LedgerHeader > getNewestLedgerInfo(soci::session &session, beast::Journal j)
getNewestLedgerInfo Returns info of newest saved ledger.
Definition Node.cpp:445
std::optional< LedgerHeader > getLimitedOldestLedgerInfo(soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
getLimitedOldestLedgerInfo Returns info of oldest ledger from ledgers with sequences greater or equal...
Definition Node.cpp:453
std::variant< RelationalDatabase::AccountTx, TxSearched > getTransaction(soci::session &session, Application &app, uint256 const &id, std::optional< ClosedInterval< uint32_t > > const &range, error_code_i &ec)
getTransaction Returns transaction with given hash.
Definition Node.cpp:1141
DatabasePairValid makeLedgerDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup, beast::Journal j)
makeLedgerDBs Opens ledger and transactions databases.
Definition Node.cpp:51
RelationalDatabase::CountMinMax getRowsMinMax(soci::session &session, TableType type)
getRowsMinMax Returns minimum ledger sequence, maximum ledger sequence and total number of rows in gi...
Definition Node.cpp:150
std::size_t getRows(soci::session &session, TableType type)
getRows Returns number of rows in given table.
Definition Node.cpp:138
std::optional< LedgerHeader > getLedgerInfoByIndex(soci::session &session, LedgerIndex ledgerSeq, beast::Journal j)
getLedgerInfoByIndex Returns ledger by its sequence.
Definition Node.cpp:437
std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > getNewestAccountTxsB(soci::session &session, Application &app, RelationalDatabase::AccountTxOptions const &options, beast::Journal j)
getNewestAccountTxsB Returns newest transactions in binary form for given account which match given c...
Definition Node.cpp:929
uint256 getHashByIndex(soci::session &session, LedgerIndex ledgerIndex)
getHashByIndex Returns hash of ledger with given sequence.
Definition Node.cpp:479
void deleteByLedgerSeq(soci::session &session, TableType type, LedgerIndex ledgerSeq)
deleteByLedgerSeq Deletes all entries in given table for the ledger with given sequence.
Definition Node.cpp:126
std::pair< RelationalDatabase::AccountTxs, int > getOldestAccountTxs(soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDatabase::AccountTxOptions const &options, beast::Journal j)
getOldestAccountTxs Returns oldest transactions for given account which match given criteria starting...
Definition Node.cpp:820
bool dbHasSpace(soci::session &session, Config const &config, beast::Journal j)
dbHasSpace Checks if given database has available space.
Definition Node.cpp:1217
std::optional< LedgerHeader > getLimitedNewestLedgerInfo(soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
getLimitedNewestLedgerInfo Returns info of newest ledger from ledgers with sequences greater or equal...
Definition Node.cpp:462
std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > oldestAccountTxPage(soci::session &session, std::function< void(std::uint32_t)> const &onUnsavedLedger, std::function< void(std::uint32_t, std::string const &, Blob &&, Blob &&)> const &onTransaction, RelationalDatabase::AccountTxPageOptions const &options, std::uint32_t page_length)
oldestAccountTxPage Searches oldest transactions for given account which match given criteria startin...
Definition Node.cpp:1119
std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > newestAccountTxPage(soci::session &session, std::function< void(std::uint32_t)> const &onUnsavedLedger, std::function< void(std::uint32_t, std::string const &, Blob &&, Blob &&)> const &onTransaction, RelationalDatabase::AccountTxPageOptions const &options, std::uint32_t page_length)
newestAccountTxPage Searches newest transactions for given account which match given criteria startin...
Definition Node.cpp:1130
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...
Definition Node.cpp:508
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
void saveLedgerAsync(Application &app, std::uint32_t seq)
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:34
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:116
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:108
void convertBlobsToTxResult(RelationalDatabase::AccountTxs &to, std::uint32_t ledger_index, std::string const &status, Blob const &rawTxn, Blob const &rawMeta, Application &app)
@ current
This was a new validation and was added.
base_uint< 256 > uint256
Definition base_uint.h:531
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
Definition RangeSet.h:25
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1179
@ ledgerMaster
ledger master data for signing
SQLiteDatabase setup_RelationalDatabase(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
setup_RelationalDatabase Creates and returns a SQLiteDatabase instance based on configuration.
error_code_i
Definition ErrorCodes.h:20
T ref(T... args)