|
rippled
|


Public Types | |
| using | AccountTx = std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > > |
| using | AccountTxs = std::vector< AccountTx > |
| using | txnMetaLedgerType = std::tuple< Blob, Blob, std::uint32_t > |
| using | MetaTxsList = std::vector< txnMetaLedgerType > |
| using | LedgerSequence = uint32_t |
| using | LedgerHash = uint256 |
| using | LedgerShortcut = RPC::LedgerShortcut |
| using | LedgerSpecifier = std::variant< LedgerRange, LedgerShortcut, LedgerSequence, LedgerHash > |
Public Member Functions | |
| RelationalDBInterfacePostgresImp (Application &app, Config const &config, JobQueue &jobQueue) | |
| void | stop () override |
| There is only one implementation of this interface: RelationalDBInterfacePostgresImp. More... | |
| void | sweep () override |
| sweep Sweep the database. More... | |
| std::optional< LedgerIndex > | getMinLedgerSeq () override |
| getMinLedgerSeq Returns minimum ledger sequence in Ledgers table. More... | |
| std::optional< LedgerIndex > | getMaxLedgerSeq () override |
| getMaxLedgerSeq Returns maximum ledger sequence in Ledgers table. More... | |
| std::string | getCompleteLedgers () override |
| getCompleteLedgers Returns string which contains list of completed ledgers. More... | |
| std::chrono::seconds | getValidatedLedgerAge () override |
| getValidatedLedgerAge Returns age of last validated ledger. More... | |
| bool | writeLedgerAndTransactions (LedgerInfo const &info, std::vector< AccountTransactionsData > const &accountTxData) override |
| writeLedgerAndTransactions Write new ledger and transaction data into database. More... | |
| std::optional< LedgerInfo > | getLedgerInfoByIndex (LedgerIndex ledgerSeq) override |
| getLedgerInfoByIndex Returns ledger by its sequence. More... | |
| std::optional< LedgerInfo > | getNewestLedgerInfo () override |
| getNewestLedgerInfo Returns info of newest saved ledger. More... | |
| std::optional< LedgerInfo > | getLedgerInfoByHash (uint256 const &ledgerHash) override |
| uint256 | getHashByIndex (LedgerIndex ledgerIndex) override |
| getHashByIndex Returns hash of ledger with given sequence. More... | |
| std::optional< LedgerHashPair > | getHashesByIndex (LedgerIndex ledgerIndex) override |
| getHashesByIndex Returns hash of the ledger and hash of parent ledger for the ledger of given sequence. More... | |
| std::map< LedgerIndex, LedgerHashPair > | getHashesByIndex (LedgerIndex minSeq, LedgerIndex maxSeq) override |
| getHashesByIndex Returns hash of the ledger and hash of parent ledger for all ledgers with sequences from given minimum limit to given maximum limit. More... | |
| std::vector< uint256 > | getTxHashes (LedgerIndex seq) override |
| getTxHashes Returns vector of tx hashes by given ledger sequence. More... | |
| std::vector< std::shared_ptr< Transaction > > | getTxHistory (LedgerIndex startIndex) override |
| getTxHistory Returns most recent 20 transactions starting from given number or entry. More... | |
| std::pair< AccountTxResult, RPC::Status > | getAccountTx (AccountTxArgs const &args) override |
| getAccountTx Get last account transactions specifies by passed argumenrs structure. More... | |
| Transaction::Locator | locateTransaction (uint256 const &id) override |
| locateTransaction Returns information used to locate a transaction. More... | |
| bool | ledgerDbHasSpace (Config const &config) override |
| ledgerDbHasSpace Checks if ledger database has available space. More... | |
| bool | transactionDbHasSpace (Config const &config) override |
| transactionDbHasSpace Checks if transaction database has available space. More... | |
| bool | isCaughtUp (std::string &reason) override |
| isCaughtUp returns whether the database is caught up with the network More... | |
| virtual std::optional< LedgerInfo > | getLedgerInfoByHash (uint256 const &ledgerHash)=0 |
| getLedgerInfoByHash Returns info of ledger with given hash. More... | |
Static Public Member Functions | |
| static std::unique_ptr< RelationalDBInterface > | init (Application &app, Config const &config, JobQueue &jobQueue) |
| init Creates and returns appropriate interface based on config. More... | |
Private Member Functions | |
| bool | dbHasSpace (Config const &config) |
Private Attributes | |
| Application & | app_ |
| beast::Journal | j_ |
| std::shared_ptr< PgPool > | pgPool_ |
Definition at line 43 of file RelationalDBInterfacePostgres.cpp.
|
inherited |
Definition at line 85 of file RelationalDBInterface.h.
|
inherited |
Definition at line 86 of file RelationalDBInterface.h.
|
inherited |
Definition at line 87 of file RelationalDBInterface.h.
|
inherited |
Definition at line 88 of file RelationalDBInterface.h.
|
inherited |
Definition at line 90 of file RelationalDBInterface.h.
|
inherited |
Definition at line 91 of file RelationalDBInterface.h.
|
inherited |
Definition at line 92 of file RelationalDBInterface.h.
|
inherited |
Definition at line 94 of file RelationalDBInterface.h.
| ripple::RelationalDBInterfacePostgresImp::RelationalDBInterfacePostgresImp | ( | Application & | app, |
| Config const & | config, | ||
| JobQueue & | jobQueue | ||
| ) |
Definition at line 46 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
There is only one implementation of this interface: RelationalDBInterfacePostgresImp.
It wraps a stoppable object (PgPool) that does not follow RAII, and it does not go through the effort of following RAII either. The owner of the only object of that type (ApplicationImp) holds it by the type of its interface instead of its implementation, and thus the lifetime management methods need to be part of the interface.
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 68 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
sweep Sweep the database.
Method is specific for postgres backend.
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 144 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getMinLedgerSeq Returns minimum ledger sequence in Ledgers table.
Implements ripple::RelationalDBInterface.
Definition at line 152 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getMaxLedgerSeq Returns maximum ledger sequence in Ledgers table.
Implements ripple::RelationalDBInterface.
Definition at line 158 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getCompleteLedgers Returns string which contains list of completed ledgers.
Method is specific for postgres backend.
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 164 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getValidatedLedgerAge Returns age of last validated ledger.
Method is specific for postgres backend.
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 170 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
writeLedgerAndTransactions Write new ledger and transaction data into database.
Method is specific for Postgres backend.
| info | Ledger info to write. |
| accountTxData | Transaction data to write |
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 176 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getLedgerInfoByIndex Returns ledger by its sequence.
| ledgerSeq | Ledger sequence. |
Implements ripple::RelationalDBInterface.
Definition at line 184 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getNewestLedgerInfo Returns info of newest saved ledger.
Implements ripple::RelationalDBInterface.
Definition at line 190 of file RelationalDBInterfacePostgres.cpp.
|
override |
Definition at line 196 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getHashByIndex Returns hash of ledger with given sequence.
| ledgerIndex | Ledger sequence. |
Implements ripple::RelationalDBInterface.
Definition at line 202 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getHashesByIndex Returns hash of the ledger and hash of parent ledger for the ledger of given sequence.
| ledgerIndex | Ledger sequence. |
Implements ripple::RelationalDBInterface.
Definition at line 208 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getHashesByIndex Returns hash of the ledger and hash of parent ledger for all ledgers with sequences from given minimum limit to given maximum limit.
| minSeq | Minimum ledger sequence. |
| maxSeq | Maximum ledger sequence. |
Implements ripple::RelationalDBInterface.
Definition at line 218 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getTxHashes Returns vector of tx hashes by given ledger sequence.
Method is specific to postgres backend.
| seq | Ledger sequence |
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 226 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getTxHistory Returns most recent 20 transactions starting from given number or entry.
| startIndex | First number of returned entry. |
Implements ripple::RelationalDBInterface.
Definition at line 232 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
getAccountTx Get last account transactions specifies by passed argumenrs structure.
Function if specific to postgres backend.
| args | Arguments which specify account and whose tx to return. |
| app | Application |
| j | Journal |
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 238 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
locateTransaction Returns information used to locate a transaction.
Function is specific to postgres backend.
| id | Hash of the transaction. |
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 244 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
ledgerDbHasSpace Checks if ledger database has available space.
| config | Config object. |
Implements ripple::RelationalDBInterface.
Definition at line 258 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
transactionDbHasSpace Checks if transaction database has available space.
| config | Config object. |
Implements ripple::RelationalDBInterface.
Definition at line 264 of file RelationalDBInterfacePostgres.cpp.
|
overridevirtual |
isCaughtUp returns whether the database is caught up with the network
| [out] | reason | if the database is not caught up, reason contains a helpful message describing why |
Implements ripple::RelationalDBInterfacePostgres.
Definition at line 279 of file RelationalDBInterfacePostgres.cpp.
|
private |
Definition at line 250 of file RelationalDBInterfacePostgres.cpp.
|
staticinherited |
init Creates and returns appropriate interface based on config.
| app | Application object. |
| config | Config object. |
| jobQueue | JobQueue object. |
Definition at line 40 of file RelationalDBInterface.cpp.
|
pure virtualinherited |
getLedgerInfoByHash Returns info of ledger with given hash.
| ledgerHash | Hash of the ledger. |
|
private |
Definition at line 135 of file RelationalDBInterfacePostgres.cpp.
|
private |
Definition at line 136 of file RelationalDBInterfacePostgres.cpp.
|
private |
Definition at line 137 of file RelationalDBInterfacePostgres.cpp.
1.8.17