rippled
Classes | Typedefs | Enumerations | Functions | Variables
ripple::detail Namespace Reference

Classes

class  AccountIdCache
 Caches the base58 representations of AccountIDs. More...
 
class  AccountIDTag
 
class  ApplyStateTable
 
class  ApplyViewBase
 
struct  basic_sha512_half_hasher
 Returns the SHA512-Half digest of a message. More...
 
class  BasicFullBelowCache
 Remembers which tree keys have all descendants resident. More...
 
class  CachedViewImpl
 
class  CurrencyTag
 
struct  DatabasePairValid
 
struct  defaultObject_t
 
class  DeferredCredits
 
class  DirectoryTag
 
class  Generator
 Produces a sequence of secp256k1 key pairs. More...
 
struct  is_contiguous_container
 
struct  is_contiguous_container< Container, std::void_t< decltype(std::declval< Container const >().size()), decltype(std::declval< Container const >().data()), typename Container::value_type > >
 
struct  is_contiguous_container< Slice >
 
struct  LocalValues
 
struct  MessageHeader
 
class  NodeIDTag
 
struct  nonPresentObject_t
 
struct  PeerDataCounts
 
class  RawStateTable
 
class  ReadViewFwdIter
 
class  ReadViewFwdRange
 
class  RippledCfgGuard
 Write a rippled config file and remove when done. More...
 
class  STVar
 
class  test_user_type_free
 
class  test_user_type_member
 
struct  throw_policy
 
class  ValidatorsTxtGuard
 Write a validators.txt file and remove when done. More...
 
class  VotableValue
 
class  Work
 
class  WorkBase
 
class  WorkFile
 
class  WorkPlain
 
class  WorkSSL
 

Typedefs

using response_type = boost::beast::http::response< boost::beast::http::string_body >
 
using seed_pair = std::pair< std::uint64_t, std::uint64_t >
 
template<class Engine , class Result = typename Engine::result_type>
using is_engine = std::is_invocable_r< Result, Engine >
 
template<class T >
using test_hardened_unordered_set = std::unordered_set< T, hardened_hash<> >
 
template<class T >
using test_hardened_unordered_map = std::unordered_map< T, int, hardened_hash<> >
 
template<class T >
using test_hardened_unordered_multiset = std::unordered_multiset< T, hardened_hash<> >
 
template<class T >
using test_hardened_unordered_multimap = std::unordered_multimap< T, int, hardened_hash<> >
 

Enumerations

enum  TableType { TableType::Ledgers, TableType::Transactions, TableType::AccountTransactions }
 

Functions

constexpr static std::pair< bool, std::uint64_tsumOfFirstSquares (std::size_t xIn)
 
template<class T >
std::vector< T > getTrustLineItems (AccountID const &accountID, ReadView const &view, LineDirection direction=LineDirection::outgoing)
 
static std::string to_string (TableType type)
 to_string Returns the name of a table according to its TableType. More...
 
DatabasePairValid makeLedgerDBs (Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
 makeLedgerDBs Opens ledger and transactions databases. More...
 
std::optional< LedgerIndexgetMinLedgerSeq (soci::session &session, TableType type)
 getMinLedgerSeq Returns minimum ledger sequence in given table. More...
 
std::optional< LedgerIndexgetMaxLedgerSeq (soci::session &session, TableType type)
 getMaxLedgerSeq Returns maximum ledger sequence in given table. More...
 
void deleteByLedgerSeq (soci::session &session, TableType type, LedgerIndex ledgerSeq)
 deleteByLedgerSeq Deletes all entries in given table for the ledger with given sequence. More...
 
void deleteBeforeLedgerSeq (soci::session &session, TableType type, LedgerIndex ledgerSeq)
 deleteBeforeLedgerSeq Deletes all entries in given table for the ledgers with given sequence and all sequences below it. More...
 
std::size_t getRows (soci::session &session, TableType type)
 getRows Returns number of rows in given table. More...
 
RelationalDatabase::CountMinMax getRowsMinMax (soci::session &session, TableType type)
 getRowsMinMax Returns minimum ledger sequence, maximum ledger sequence and total number of rows in given table. More...
 
bool saveValidatedLedger (DatabaseCon &ldgDB, DatabaseCon &txnDB, Application &app, std::shared_ptr< Ledger const > const &ledger, bool current)
 saveValidatedLedger Saves ledger into database. More...
 
static std::optional< LedgerInfogetLedgerInfo (soci::session &session, std::string const &sqlSuffix, beast::Journal j)
 getLedgerInfo Returns the info of the ledger retrieved from the database by using the provided SQL query suffix. More...
 
std::optional< LedgerInfogetLedgerInfoByIndex (soci::session &session, LedgerIndex ledgerSeq, beast::Journal j)
 getLedgerInfoByIndex Returns ledger by its sequence. More...
 
std::optional< LedgerInfogetNewestLedgerInfo (soci::session &session, beast::Journal j)
 getNewestLedgerInfo Returns info of newest saved ledger. More...
 
std::optional< LedgerInfogetLimitedOldestLedgerInfo (soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
 getLimitedOldestLedgerInfo Returns info of oldest ledger from ledgers with sequences greather or equal to given. More...
 
std::optional< LedgerInfogetLimitedNewestLedgerInfo (soci::session &session, LedgerIndex ledgerFirstIndex, beast::Journal j)
 getLimitedNewestLedgerInfo Returns info of newest ledger from ledgers with sequences greather or equal to given. More...
 
std::optional< LedgerInfogetLedgerInfoByHash (soci::session &session, uint256 const &ledgerHash, beast::Journal j)
 getLedgerInfoByHash Returns info of ledger with given hash. More...
 
uint256 getHashByIndex (soci::session &session, LedgerIndex ledgerIndex)
 getHashByIndex Returns hash of ledger with given sequence. More...
 
std::optional< LedgerHashPairgetHashesByIndex (soci::session &session, LedgerIndex ledgerIndex, beast::Journal j)
 getHashesByIndex Returns hash of the ledger and hash of parent ledger for the ledger of given sequence. More...
 
std::map< LedgerIndex, LedgerHashPairgetHashesByIndex (soci::session &session, LedgerIndex minSeq, LedgerIndex maxSeq, beast::Journal j)
 getHashesByIndex Returns hash of the ledger and hash of parent ledger for all ledgers with seqyences from given minimum limit to fiven maximum limit. More...
 
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. More...
 
static std::string transactionsSQL (Application &app, std::string selection, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, bool descending, bool binary, bool count, beast::Journal j)
 transactionsSQL Returns a SQL query for selecting the oldest or newest transactions in decoded or binary form for the account that matches the given criteria starting from the provided offset. More...
 
static std::pair< RelationalDatabase::AccountTxs, int > getAccountTxs (soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, bool descending, beast::Journal j)
 getAccountTxs Returns the oldest or newest transactions for the account that matches the given criteria starting from the provided offset. More...
 
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 from given offset. More...
 
std::pair< RelationalDatabase::AccountTxs, int > getNewestAccountTxs (soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
 getNewestAccountTxs Returns newest transactions for given account which match given criteria starting from given offset. More...
 
static std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > getAccountTxsB (soci::session &session, Application &app, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, bool descending, beast::Journal j)
 getAccountTxsB Returns the oldest or newest transactions in binary form for the account that matches given criteria starting from the provided offset. More...
 
std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > getOldestAccountTxsB (soci::session &session, Application &app, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
 getOldestAccountTxsB Returns oldest transactions in binary form for given account which match given criteria starting from given offset. More...
 
std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > getNewestAccountTxsB (soci::session &session, Application &app, RelationalDatabase::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
 getNewestAccountTxsB Returns newest transactions in binary form for given account which match given criteria starting from given offset. More...
 
static std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > accountTxPage (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, int limit_used, std::uint32_t page_length, bool forward)
 accountTxPage Searches for the oldest or newest transactions for the account that matches the given criteria starting from the provided marker and invokes the callback parameter for each found transaction. More...
 
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, int limit_used, std::uint32_t page_length)
 oldestAccountTxPage Searches oldest transactions for given account which match given criteria starting from given marker and calls callback for each found transaction. More...
 
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, int limit_used, std::uint32_t page_length)
 newestAccountTxPage Searches newest transactions for given account which match given criteria starting from given marker and calls callback for each found transaction. More...
 
std::variant< RelationalDatabase::AccountTx, TxSearchedgetTransaction (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. More...
 
bool dbHasSpace (soci::session &session, Config const &config, beast::Journal j)
 dbHasSpace Checks if given database has available space. More...
 
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 to the index of the shard that holds the ledger or transaction. More...
 
bool saveLedgerMeta (std::shared_ptr< Ledger const > const &ledger, Application &app, soci::session &lgrMetaSession, soci::session &txnMetaSession, std::uint32_t shardIndex)
 saveLedgerMeta Stores (transaction ID -> shard index) and (ledger hash -> shard index) mappings in the meta databases. More...
 
std::optional< std::uint32_tgetShardIndexforLedger (soci::session &session, LedgerHash const &hash)
 getShardIndexforLedger Queries the ledger meta database to retrieve the index of the shard that contains this ledger. More...
 
std::optional< std::uint32_tgetShardIndexforTransaction (soci::session &session, TxID const &id)
 getShardIndexforTransaction Queries the transaction meta database to retrieve the index of the shard that contains this transaction. More...
 
std::string toString (LedgerInfo const &info)
 Convenience function for printing out basic ledger info. More...
 
template<bool = true>
seed_pair make_seed_pair () noexcept
 
void accessViolation () noexcept
 
template<class = void>
boost::thread_specific_ptr< detail::LocalValues > & getLocalValues ()
 
void spin_pause () noexcept
 Inform the processor that we are in a tight spin-wait loop. More...
 
std::string getSociSqliteInit (std::string const &name, std::string const &dir, std::string const &ext)
 
std::string getSociInit (BasicConfig const &config, std::string const &dbName)
 
template<class V , class N , class = std::enable_if_t< std::is_same_v<std::remove_cv_t<N>, SLE> && std::is_base_of_v<ReadView, V>>>
bool internalDirNext (V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
 
template<class V , class N , class = std::enable_if_t< std::is_same_v<std::remove_cv_t<N>, SLE> && std::is_base_of_v<ReadView, V>>>
bool internalDirFirst (V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
 
template<typename BufferSequence >
auto buffersBegin (BufferSequence const &bufs)
 
template<typename BufferSequence >
auto buffersEnd (BufferSequence const &bufs)
 
template<class BufferSequence >
std::optional< MessageHeaderparseMessageHeader (boost::system::error_code &ec, BufferSequence const &bufs, std::size_t size)
 Parse a message header. More...
 
template<class T , class Buffers , class = std::enable_if_t< std::is_base_of<::google::protobuf::Message, T>::value>>
std::shared_ptr< T > parseMessageContent (MessageHeader const &header, Buffers const &buffers)
 
template<class T , class Buffers , class Handler , class = std::enable_if_t< std::is_base_of<::google::protobuf::Message, T>::value>>
bool invoke (MessageHeader const &header, Buffers const &buffers, Handler &handler)
 
std::map< std::string, VoteBehavior > const & supportedAmendments ()
 Amendments that this server supports and the default voting behavior. More...
 
std::size_t numDownVotedAmendments ()
 Amendments that this server won't vote for by default. More...
 
std::size_t numUpVotedAmendments ()
 Amendments that this server will vote for by default. More...
 
constexpr std::uint32_t make_hash_prefix (char a, char b, char c)
 
STAmount as_amount (Rate const &rate)
 
void copy_uint32 (std::uint8_t *out, std::uint32_t v)
 
uint256 deriveDeterministicRootKey (Seed const &seed)
 
template<class T , class... Args>
STVar make_stvar (Args &&... args)
 
bool operator== (STVar const &lhs, STVar const &rhs)
 
bool operator!= (STVar const &lhs, STVar const &rhs)
 
static std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & transResults ()
 
static std::string encodeBase58 (void const *message, std::size_t size, void *temp, std::size_t temp_size)
 
static std::string decodeBase58 (std::string const &s)
 
SlabAllocatorSet< SHAMapItemslabber ({ { 128, megabytes(std::size_t(60)) }, { 192, megabytes(std::size_t(46)) }, { 272, megabytes(std::size_t(60)) }, { 384, megabytes(std::size_t(56)) }, { 564, megabytes(std::size_t(40)) }, { 772, megabytes(std::size_t(46)) }, { 1052, megabytes(std::size_t(60)) }, })
 
std::string configContents (std::string const &dbPath, std::string const &validatorsFile)
 
std::string valFileContents ()
 

Variables

constexpr int TableTypeCount = 3
 
static constexpr std::size_t numFeatures = 58
 
defaultObject_t defaultObject
 
nonPresentObject_t nonPresentObject
 
constexpr std::string_view isoCharSet
 
constexpr std::size_t isoCodeOffset = 12
 
constexpr std::size_t isoCodeLength = 3
 

Typedef Documentation

◆ response_type

using ripple::detail::response_type = typedef boost::beast::http::response<boost::beast::http::string_body>

Definition at line 31 of file Work.h.

◆ seed_pair

Definition at line 39 of file hardened_hash.h.

◆ is_engine

template<class Engine , class Result = typename Engine::result_type>
using ripple::detail::is_engine = typedef std::is_invocable_r<Result, Engine>

Definition at line 51 of file ripple/basics/random.h.

◆ test_hardened_unordered_set

Definition at line 83 of file hardened_hash_test.cpp.

◆ test_hardened_unordered_map

template<class T >
using ripple::detail::test_hardened_unordered_map = typedef std::unordered_map<T, int, hardened_hash<> >

Definition at line 86 of file hardened_hash_test.cpp.

◆ test_hardened_unordered_multiset

Definition at line 90 of file hardened_hash_test.cpp.

◆ test_hardened_unordered_multimap

Definition at line 94 of file hardened_hash_test.cpp.

Enumeration Type Documentation

◆ TableType

Enumerator
Ledgers 
Transactions 
AccountTransactions 

Definition at line 35 of file Node.h.

Function Documentation

◆ sumOfFirstSquares()

constexpr static std::pair<bool, std::uint64_t> ripple::detail::sumOfFirstSquares ( std::size_t  xIn)
staticconstexpr

Definition at line 193 of file TxQ.cpp.

◆ getTrustLineItems()

template<class T >
std::vector<T> ripple::detail::getTrustLineItems ( AccountID const &  accountID,
ReadView const &  view,
LineDirection  direction = LineDirection::outgoing 
)

Definition at line 64 of file TrustLine.cpp.

◆ to_string()

static std::string ripple::detail::to_string ( TableType  type)
static

to_string Returns the name of a table according to its TableType.

Parameters
typeAn enum denoting the table's type.
Returns
Name of the table.

Definition at line 46 of file Node.cpp.

◆ makeLedgerDBs()

DatabasePairValid ripple::detail::makeLedgerDBs ( Config const &  config,
DatabaseCon::Setup const &  setup,
DatabaseCon::CheckpointerSetup const &  checkpointerSetup 
)

makeLedgerDBs Opens ledger and transactions databases.

Parameters
configConfig object.
setupPath to database and opening parameters.
checkpointerSetupDatabase checkpointer setup.
Returns
Struct DatabasePairValid which contain unique pointers to ledger and transaction databases and flag if opening was successfull.

Definition at line 67 of file Node.cpp.

◆ getMinLedgerSeq()

std::optional< LedgerIndex > ripple::detail::getMinLedgerSeq ( soci::session &  session,
TableType  type 
)

getMinLedgerSeq Returns minimum ledger sequence in given table.

Parameters
sessionSession with database.
typeTable ID for which the result is returned.
Returns
Ledger sequence or none if no ledgers exist.

Definition at line 123 of file Node.cpp.

◆ getMaxLedgerSeq()

std::optional< LedgerIndex > ripple::detail::getMaxLedgerSeq ( soci::session &  session,
TableType  type 
)

getMaxLedgerSeq Returns maximum ledger sequence in given table.

Parameters
sessionSession with database.
typeTable ID for which the result is returned.
Returns
Ledger sequence or none if no ledgers exist.

Definition at line 133 of file Node.cpp.

◆ deleteByLedgerSeq()

void ripple::detail::deleteByLedgerSeq ( soci::session &  session,
TableType  type,
LedgerIndex  ledgerSeq 
)

deleteByLedgerSeq Deletes all entries in given table for the ledger with given sequence.

Parameters
sessionSession with database.
typeTable ID from which entries will be deleted.
ledgerSeqLedger sequence.

Definition at line 143 of file Node.cpp.

◆ deleteBeforeLedgerSeq()

void ripple::detail::deleteBeforeLedgerSeq ( soci::session &  session,
TableType  type,
LedgerIndex  ledgerSeq 
)

deleteBeforeLedgerSeq Deletes all entries in given table for the ledgers with given sequence and all sequences below it.

Parameters
sessionSession with database.
typeTable ID from which entries will be deleted.
ledgerSeqLedger sequence.

Definition at line 150 of file Node.cpp.

◆ getRows()

std::size_t ripple::detail::getRows ( soci::session &  session,
TableType  type 
)

getRows Returns number of rows in given table.

Parameters
sessionSession with database.
typeTable ID for which the result is returned.
Returns
Number of rows.

Definition at line 160 of file Node.cpp.

◆ getRowsMinMax()

RelationalDatabase::CountMinMax ripple::detail::getRowsMinMax ( soci::session &  session,
TableType  type 
)

getRowsMinMax Returns minimum ledger sequence, maximum ledger sequence and total number of rows in given table.

Parameters
sessionSession with database.
typeTable ID for which the result is returned.
Returns
Struct CountMinMax which contain minimum sequence, maximum sequence and number of rows.

Definition at line 172 of file Node.cpp.

◆ saveValidatedLedger()

bool ripple::detail::saveValidatedLedger ( DatabaseCon ldgDB,
DatabaseCon txnDB,
Application app,
std::shared_ptr< Ledger const > const &  ledger,
bool  current 
)

saveValidatedLedger Saves ledger into database.

Parameters
lgrDBLink to ledgers database.
txnDBLink to transactions database.
appApplication object.
ledgerThe ledger.
currentTrue if ledger is current.
Returns
True is saving was successfull.

Definition at line 187 of file Node.cpp.

◆ getLedgerInfo()

static std::optional<LedgerInfo> ripple::detail::getLedgerInfo ( soci::session &  session,
std::string const &  sqlSuffix,
beast::Journal  j 
)
static

getLedgerInfo Returns the info of the ledger retrieved from the database by using the provided SQL query suffix.

Parameters
sessionSession with the database.
sqlSuffixSQL string used to specify the sought ledger.
jJournal.
Returns
Ledger info or no value if the ledger was not found.

Definition at line 386 of file Node.cpp.

◆ getLedgerInfoByIndex()

std::optional< LedgerInfo > ripple::detail::getLedgerInfoByIndex ( soci::session &  session,
LedgerIndex  ledgerSeq,
beast::Journal  j 
)

getLedgerInfoByIndex Returns ledger by its sequence.

Parameters
sessionSession with database.
ledgerSeqLedger sequence.
jJournal.
Returns
Ledger or none if ledger not found.

Definition at line 456 of file Node.cpp.

◆ getNewestLedgerInfo()

std::optional< LedgerInfo > ripple::detail::getNewestLedgerInfo ( soci::session &  session,
beast::Journal  j 
)

getNewestLedgerInfo Returns info of newest saved ledger.

Parameters
sessionSession with database.
jJournal.
Returns
Ledger info or none if ledger not found.

Definition at line 467 of file Node.cpp.

◆ getLimitedOldestLedgerInfo()

std::optional< LedgerInfo > ripple::detail::getLimitedOldestLedgerInfo ( soci::session &  session,
LedgerIndex  ledgerFirstIndex,
beast::Journal  j 
)

getLimitedOldestLedgerInfo Returns info of oldest ledger from ledgers with sequences greather or equal to given.

Parameters
sessionSession with database.
ledgerFirstIndexMinimum ledger sequence.
jJournal.
Returns
Ledger info or none if ledger not found.

Definition at line 475 of file Node.cpp.

◆ getLimitedNewestLedgerInfo()

std::optional< LedgerInfo > ripple::detail::getLimitedNewestLedgerInfo ( soci::session &  session,
LedgerIndex  ledgerFirstIndex,
beast::Journal  j 
)

getLimitedNewestLedgerInfo Returns info of newest ledger from ledgers with sequences greather or equal to given.

Parameters
sessionSession with database.
ledgerFirstIndexMinimum ledger sequence.
jJournal.
Returns
Ledger info or none if ledger not found.

Definition at line 487 of file Node.cpp.

◆ getLedgerInfoByHash()

std::optional< LedgerInfo > ripple::detail::getLedgerInfoByHash ( soci::session &  session,
uint256 const &  ledgerHash,
beast::Journal  j 
)

getLedgerInfoByHash Returns info of ledger with given hash.

Parameters
sessionSession with database.
ledgerHashHash of the ledger.
jJournal.
Returns
Ledger or none if ledger not found.

Definition at line 499 of file Node.cpp.

◆ getHashByIndex()

uint256 ripple::detail::getHashByIndex ( soci::session &  session,
LedgerIndex  ledgerIndex 
)

getHashByIndex Returns hash of ledger with given sequence.

Parameters
sessionSession with database.
ledgerIndexLedger sequence.
Returns
Hash of the ledger.

Definition at line 510 of file Node.cpp.

◆ getHashesByIndex() [1/2]

std::optional< LedgerHashPair > ripple::detail::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 sequence.

Parameters
sessionSession with database.
ledgerIndexLedger sequence.
jJournal.
Returns
Struct LedgerHashPair which contain hashes of the ledger and its parent ledger.

Definition at line 540 of file Node.cpp.

◆ getHashesByIndex() [2/2]

std::map< LedgerIndex, LedgerHashPair > ripple::detail::getHashesByIndex ( soci::session &  session,
LedgerIndex  minSeq,
LedgerIndex  maxSeq,
beast::Journal  j 
)

getHashesByIndex Returns hash of the ledger and hash of parent ledger for all ledgers with seqyences from given minimum limit to fiven maximum limit.

Parameters
sessionSession with database.
minSeqMinimum ledger sequence.
maxSeqMaximum ledger sequence.
jJournal.
Returns
Map which points sequence number of found ledger to the struct LedgerHashPair which contains ledger hash and its parent hash.

Definition at line 571 of file Node.cpp.

◆ getTxHistory()

std::pair< std::vector< std::shared_ptr< Transaction > >, int > ripple::detail::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.

Parameters
sessionSession with database.
appApplication object.
startIndexOffset of first returned entry.
quantityNumber of returned entries.
countTrue if counting of all transaction in that shard required.
Returns
Vector of shared pointers to transactions sorted in descending order by ledger sequence. Also number of transactions if count == true.

Definition at line 616 of file Node.cpp.

◆ transactionsSQL()

static std::string ripple::detail::transactionsSQL ( Application app,
std::string  selection,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
bool  descending,
bool  binary,
bool  count,
beast::Journal  j 
)
static

transactionsSQL Returns a SQL query for selecting the oldest or newest transactions in decoded or binary form for the account that matches the given criteria starting from the provided offset.

Parameters
appApplication object.
selectionList of table fields to select from the database.
optionsStruct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, and a flag if this number is unlimited.
limit_usedNumber of transactions already returned in calls to other shard databases, if shard databases are used. No value if the node database is used.
descendingTrue for descending order, false for ascending.
binaryTrue for binary form, false for decoded.
countTrue for counting the number of transactions, false for selecting them.
jJournal.
Returns
SQL query string.

Definition at line 694 of file Node.cpp.

◆ getAccountTxs()

static std::pair<RelationalDatabase::AccountTxs, int> ripple::detail::getAccountTxs ( soci::session &  session,
Application app,
LedgerMaster ledgerMaster,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
bool  descending,
beast::Journal  j 
)
static

getAccountTxs Returns the oldest or newest transactions for the account that matches the given criteria starting from the provided offset.

Parameters
sessionSession with the database.
appApplication object.
ledgerMasterLedgerMaster object.
optionsStruct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, and a flag if this number is unlimited.
limit_usedNumber of transactions already returned in calls to other shard databases, if shard databases are used. No value if the node database is used.
descendingTrue for descending order, false for ascending.
jJournal.
Returns
Vector of pairs of found transactions and their metadata sorted by account sequence in the specified order along with the number of transactions processed or skipped. If this number is >= 0, then it represents the number of transactions processed, if it is < 0, then -number represents the number of transactions skipped. We need to skip some number of transactions if option offset is > 0 in the options structure.

Definition at line 805 of file Node.cpp.

◆ getOldestAccountTxs()

std::pair< RelationalDatabase::AccountTxs, int > ripple::detail::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 from given offset.

Parameters
sessionSession with database.
appApplication object.
ledgerMasterLedgerMaster object.
optionsStruct AccountTxOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, offset of first entry to return, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases, if shard databases are used. None if node database is used.
jJournal.
Returns
Vector of pairs of found transactions and their metadata sorted in ascending order by account sequence. Also number of transactions processed or skipped. If this number is >= 0, then it means number of transactions processed, if it is < 0, then -number means number of transactions skipped. We need to skip some quantity of transactions if option offset is > 0 in the options structure.

Definition at line 899 of file Node.cpp.

◆ getNewestAccountTxs()

std::pair< RelationalDatabase::AccountTxs, int > ripple::detail::getNewestAccountTxs ( soci::session &  session,
Application app,
LedgerMaster ledgerMaster,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
beast::Journal  j 
)

getNewestAccountTxs Returns newest transactions for given account which match given criteria starting from given offset.

Parameters
sessionSession with database.
appApplication object.
ledgerMasterLedgerMaster object.
optionsStruct AccountTxOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, offset of first entry to return, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases, if shard databases are used. None if node database is used.
jJournal.
Returns
Vector of pairs of found transactions and their metadata sorted in descending order by account sequence. Also number of transactions processed or skipped. If this number is >= 0, then it means number of transactions processed, if it is < 0, then -number means number of transactions skipped. We need to skip some quantity of transactions if option offset is > 0 in the options structure.

Definition at line 912 of file Node.cpp.

◆ getAccountTxsB()

static std::pair<std::vector<RelationalDatabase::txnMetaLedgerType>, int> ripple::detail::getAccountTxsB ( soci::session &  session,
Application app,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
bool  descending,
beast::Journal  j 
)
static

getAccountTxsB Returns the oldest or newest transactions in binary form for the account that matches given criteria starting from the provided offset.

Parameters
sessionSession with the database.
appApplication object.
optionsStruct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, and a flag if this number is unlimited.
limit_usedNumber of transactions already returned in calls to other shard databases, if shard databases are used. No value if the node database is used.
descendingTrue for descending order, false for ascending.
jJournal.
Returns
Vector of tuples each containing (the found transactions, their metadata, and their account sequences) sorted by account sequence in the specified order along with the number of transactions processed or skipped. If this number is >= 0, then it represents the number of transactions processed, if it is < 0, then -number represents the number of transactions skipped. We need to skip some number of transactions if option offset is > 0 in the options structure.

Definition at line 948 of file Node.cpp.

◆ getOldestAccountTxsB()

std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > ripple::detail::getOldestAccountTxsB ( soci::session &  session,
Application app,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
beast::Journal  j 
)

getOldestAccountTxsB Returns oldest transactions in binary form for given account which match given criteria starting from given offset.

Parameters
sessionSession with database.
appApplication object.
optionsStruct AccountTxOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, offset of first entry to return, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases, if shard databases are used. None if node database is used.
jJournal.
Returns
Vector of tuples of found transactions, their metadata and account sequences sorted in ascending order by account sequence. Also number of transactions processed or skipped. If this number is >= 0, then it means number of transactions processed, if it is < 0, then -number means number of transactions skipped. We need to skip some quantity of transactions if option offset is > 0 in the options structure.

Definition at line 1020 of file Node.cpp.

◆ getNewestAccountTxsB()

std::pair< std::vector< RelationalDatabase::txnMetaLedgerType >, int > ripple::detail::getNewestAccountTxsB ( soci::session &  session,
Application app,
RelationalDatabase::AccountTxOptions const &  options,
std::optional< int > const &  limit_used,
beast::Journal  j 
)

getNewestAccountTxsB Returns newest transactions in binary form for given account which match given criteria starting from given offset.

Parameters
sessionSession with database.
appApplication object.
optionsStruct AccountTxOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, offset of first entry to return, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases, if shard databases are used. None if node database is used.
jJournal.
Returns
Vector of tuples of found transactions, their metadata and account sequences sorted in descending order by account sequence. Also number of transactions processed or skipped. If this number is >= 0, then it means number of transactions processed, if it is < 0, then -number means number of transactions skipped. We need to skip some quantity of transactions if option offset is > 0 in the options structure.

Definition at line 1031 of file Node.cpp.

◆ accountTxPage()

static std::pair<std::optional<RelationalDatabase::AccountTxMarker>, int> ripple::detail::accountTxPage ( 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,
int  limit_used,
std::uint32_t  page_length,
bool  forward 
)
static

accountTxPage Searches for the oldest or newest transactions for the account that matches the given criteria starting from the provided marker and invokes the callback parameter for each found transaction.

Parameters
sessionSession with the database.
onUnsavedLedgerCallback function to call on each found unsaved ledger within the given range.
onTransactionCallback function to call on each found transaction.
optionsStruct AccountTxPageOptions which contains the criteria to match: the account, the ledger search range, the marker of the first returned entry, the number of transactions to return, and a flag if this number unlimited.
limit_usedNumber of transactions already returned in calls to other shard databases.
page_lengthTotal number of transactions to return.
forwardTrue for ascending order, false for descending.
Returns
Vector of tuples of found transactions, their metadata and account sequences sorted in the specified order by account sequence, a marker for the next search if the search was not finished and the number of transactions processed during this call.

Definition at line 1063 of file Node.cpp.

◆ oldestAccountTxPage()

std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > ripple::detail::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,
int  limit_used,
std::uint32_t  page_length 
)

oldestAccountTxPage Searches oldest transactions for given account which match given criteria starting from given marker and calls callback for each found transaction.

Parameters
sessionSession with database.
onUnsavedLedgerCallback function to call on each found unsaved ledger within given range.
onTransactionCallback function to call on each found transaction.
optionsStruct AccountTxPageOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, marker of first returned entry, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases.
page_lengthTotal number of transactions to return.
Returns
Vector of tuples of found transactions, their metadata and account sequences sorted in ascending order by account sequence and marker for next search if search not finished. Also number of transactions processed during this call.

Definition at line 1224 of file Node.cpp.

◆ newestAccountTxPage()

std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > ripple::detail::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,
int  limit_used,
std::uint32_t  page_length 
)

newestAccountTxPage Searches newest transactions for given account which match given criteria starting from given marker and calls callback for each found transaction.

Parameters
sessionSession with database.
onUnsavedLedgerCallback function to call on each found unsaved ledger within given range.
onTransactionCallback function to call on each found transaction.
optionsStruct AccountTxPageOptions which contain criteria to match: the account, minimum and maximum ledger numbers to search, marker of first returned entry, number of transactions to return, flag if this number unlimited.
limit_usedNumber or transactions already returned in calls to another shard databases.
page_lengthTotal number of transactions to return.
Returns
Vector of tuples of found transactions, their metadata and account sequences sorted in descending order by account sequence and marker for next search if search not finished. Also number of transactions processed during this call.

Definition at line 1245 of file Node.cpp.

◆ getTransaction()

std::variant< RelationalDatabase::AccountTx, TxSearched > ripple::detail::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.

If not found and range given then check if all ledgers from the range are present in the database.

Parameters
sessionSession with database.
appApplication object.
idHash of the transaction.
rangeRange of ledgers to check, if present.
ecDefault value of error code.
Returns
Transaction and its metadata if found, TxSearched::all if range given and all ledgers from range are present in the database, TxSearched::some if range given and not all ledgers are present, TxSearched::unknown if range not given or deserializing error occured. In the last case error code modified in ec link parameter, in other cases default error code remained.

Definition at line 1266 of file Node.cpp.

◆ dbHasSpace()

bool ripple::detail::dbHasSpace ( soci::session &  session,
Config const &  config,
beast::Journal  j 
)

dbHasSpace Checks if given database has available space.

Parameters
sessionSession with database.
configConfig object.
jJournal.
Returns
True if space is available.

Definition at line 1347 of file Node.cpp.

◆ makeMetaDBs()

DatabasePair ripple::detail::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 to the index of the shard that holds the ledger or transaction.

Parameters
configConfig object.
setupPath to database and opening parameters.
checkpointerSetupDatabase checkpointer setup.
Returns
Struct DatabasePair which contains unique pointers to the ledger and transaction databases.

Definition at line 32 of file app/rdb/backend/detail/impl/Shard.cpp.

◆ saveLedgerMeta()

bool ripple::detail::saveLedgerMeta ( std::shared_ptr< Ledger const > const &  ledger,
Application app,
soci::session &  lgrMetaSession,
soci::session &  txnMetaSession,
std::uint32_t  shardIndex 
)

saveLedgerMeta Stores (transaction ID -> shard index) and (ledger hash -> shard index) mappings in the meta databases.

Parameters
ledgerThe ledger.
appApplication object.
lgrMetaSessionSession to ledger meta database.
txnMetaSessionSession to transaction meta database.
shardIndexThe index of the shard that contains this ledger.
Returns
True on success.

Definition at line 56 of file app/rdb/backend/detail/impl/Shard.cpp.

◆ getShardIndexforLedger()

std::optional< std::uint32_t > ripple::detail::getShardIndexforLedger ( soci::session &  session,
LedgerHash const &  hash 
)

getShardIndexforLedger Queries the ledger meta database to retrieve the index of the shard that contains this ledger.

Parameters
sessionSession to the database.
hashHash of the ledger.
Returns
The index of the shard on success, otherwise an unseated value.

Definition at line 117 of file app/rdb/backend/detail/impl/Shard.cpp.

◆ getShardIndexforTransaction()

std::optional< std::uint32_t > ripple::detail::getShardIndexforTransaction ( soci::session &  session,
TxID const &  id 
)

getShardIndexforTransaction Queries the transaction meta database to retrieve the index of the shard that contains this transaction.

Parameters
sessionSession to the database.
idID of the transaction.
Returns
The index of the shard on success, otherwise an unseated value.

Definition at line 131 of file app/rdb/backend/detail/impl/Shard.cpp.

◆ toString()

std::string ripple::detail::toString ( LedgerInfo const &  info)

Convenience function for printing out basic ledger info.

Definition at line 42 of file ReportingETL.cpp.

◆ make_seed_pair()

template<bool = true>
seed_pair ripple::detail::make_seed_pair ( )
noexcept

Definition at line 43 of file hardened_hash.h.

◆ accessViolation()

void ripple::detail::accessViolation ( )
noexcept

Definition at line 31 of file contract.cpp.

◆ getLocalValues()

template<class = void>
boost::thread_specific_ptr<detail::LocalValues>& ripple::detail::getLocalValues ( )

Definition at line 74 of file LocalValue.h.

◆ spin_pause()

void ripple::detail::spin_pause ( )
noexcept

Inform the processor that we are in a tight spin-wait loop.

Spinlocks caught in tight loops can result in the processor's pipeline filling up with comparison operations, resulting in a misprediction at the time the lock is finally acquired, necessitating pipeline flushing which is ridiculously expensive and results in very high latency.

This function instructs the processor to "pause" for some architecture specific amount of time, to prevent this.

Definition at line 44 of file spinlock.h.

◆ getSociSqliteInit()

std::string ripple::detail::getSociSqliteInit ( std::string const &  name,
std::string const &  dir,
std::string const &  ext 
)

Definition at line 42 of file SociDB.cpp.

◆ getSociInit()

std::string ripple::detail::getSociInit ( BasicConfig const &  config,
std::string const &  dbName 
)

Definition at line 60 of file SociDB.cpp.

◆ internalDirNext()

template<class V , class N , class = std::enable_if_t< std::is_same_v<std::remove_cv_t<N>, SLE> && std::is_base_of_v<ReadView, V>>>
bool ripple::detail::internalDirNext ( V &  view,
uint256 const &  root,
std::shared_ptr< N > &  page,
unsigned int &  index,
uint256 entry 
)

Definition at line 43 of file View.cpp.

◆ internalDirFirst()

template<class V , class N , class = std::enable_if_t< std::is_same_v<std::remove_cv_t<N>, SLE> && std::is_base_of_v<ReadView, V>>>
bool ripple::detail::internalDirFirst ( V &  view,
uint256 const &  root,
std::shared_ptr< N > &  page,
unsigned int &  index,
uint256 entry 
)

Definition at line 89 of file View.cpp.

◆ buffersBegin()

template<typename BufferSequence >
auto ripple::detail::buffersBegin ( BufferSequence const &  bufs)

Definition at line 153 of file ProtocolMessage.h.

◆ buffersEnd()

template<typename BufferSequence >
auto ripple::detail::buffersEnd ( BufferSequence const &  bufs)

Definition at line 161 of file ProtocolMessage.h.

◆ parseMessageHeader()

template<class BufferSequence >
std::optional<MessageHeader> ripple::detail::parseMessageHeader ( boost::system::error_code &  ec,
BufferSequence const &  bufs,
std::size_t  size 
)

Parse a message header.

Returns
a seated optional if the message header was successfully parsed. An unseated optional otherwise, in which case
Parameters
eccontains more information:
  • set to errc::success if not enough bytes were present
  • set to errc::no_message if a valid header was not present @bufs - sequence of input buffers, can't be empty @size input data size

Definition at line 178 of file ProtocolMessage.h.

◆ parseMessageContent()

template<class T , class Buffers , class = std::enable_if_t< std::is_base_of<::google::protobuf::Message, T>::value>>
std::shared_ptr<T> ripple::detail::parseMessageContent ( MessageHeader const &  header,
Buffers const &  buffers 
)

Definition at line 273 of file ProtocolMessage.h.

◆ invoke()

template<class T , class Buffers , class Handler , class = std::enable_if_t< std::is_base_of<::google::protobuf::Message, T>::value>>
bool ripple::detail::invoke ( MessageHeader const &  header,
Buffers const &  buffers,
Handler &  handler 
)

Definition at line 308 of file ProtocolMessage.h.

◆ supportedAmendments()

std::map< std::string, VoteBehavior > const & ripple::detail::supportedAmendments ( )

Amendments that this server supports and the default voting behavior.

Amendments that this server supports.

Whether they are enabled depends on the Rules defined in the validated ledger

Definition at line 320 of file Feature.cpp.

◆ numDownVotedAmendments()

std::size_t ripple::detail::numDownVotedAmendments ( )

Amendments that this server won't vote for by default.

This function is only used in unit tests.

Definition at line 327 of file Feature.cpp.

◆ numUpVotedAmendments()

std::size_t ripple::detail::numUpVotedAmendments ( )

Amendments that this server will vote for by default.

This function is only used in unit tests.

Definition at line 334 of file Feature.cpp.

◆ make_hash_prefix()

constexpr std::uint32_t ripple::detail::make_hash_prefix ( char  a,
char  b,
char  c 
)
constexpr

Definition at line 31 of file HashPrefix.h.

◆ as_amount()

STAmount ripple::detail::as_amount ( Rate const &  rate)

Definition at line 30 of file Rate2.cpp.

◆ copy_uint32()

void ripple::detail::copy_uint32 ( std::uint8_t out,
std::uint32_t  v 
)

Definition at line 59 of file SecretKey.cpp.

◆ deriveDeterministicRootKey()

uint256 ripple::detail::deriveDeterministicRootKey ( Seed const &  seed)

Definition at line 68 of file SecretKey.cpp.

◆ make_stvar()

template<class T , class... Args>
STVar ripple::detail::make_stvar ( Args &&...  args)

Definition at line 143 of file STVar.h.

◆ operator==()

bool ripple::detail::operator== ( STVar const &  lhs,
STVar const &  rhs 
)

Definition at line 151 of file STVar.h.

◆ operator!=()

bool ripple::detail::operator!= ( STVar const &  lhs,
STVar const &  rhs 
)

Definition at line 157 of file STVar.h.

◆ transResults()

static std::unordered_map< TERUnderlyingType, std::pair<char const* const, char const* const> > const& ripple::detail::transResults ( )
static

Definition at line 32 of file TER.cpp.

◆ encodeBase58()

static std::string ripple::detail::encodeBase58 ( void const *  message,
std::size_t  size,
void *  temp,
std::size_t  temp_size 
)
static

Definition at line 99 of file tokens.cpp.

◆ decodeBase58()

static std::string ripple::detail::decodeBase58 ( std::string const &  s)
static

Definition at line 150 of file tokens.cpp.

◆ slabber()

SlabAllocatorSet<SHAMapItem> ripple::detail::slabber ( { { 128, megabytes(std::size_t(60)) }, { 192, megabytes(std::size_t(46)) }, { 272, megabytes(std::size_t(60)) }, { 384, megabytes(std::size_t(56)) }, { 564, megabytes(std::size_t(40)) }, { 772, megabytes(std::size_t(46)) }, { 1052, megabytes(std::size_t(60)) }, }  )

◆ configContents()

std::string ripple::detail::configContents ( std::string const &  dbPath,
std::string const &  validatorsFile 
)

Definition at line 34 of file Config_test.cpp.

◆ valFileContents()

std::string ripple::detail::valFileContents ( )

Definition at line 203 of file Config_test.cpp.

Variable Documentation

◆ TableTypeCount

constexpr int ripple::detail::TableTypeCount = 3
constexpr

Definition at line 36 of file Node.h.

◆ numFeatures

constexpr std::size_t ripple::detail::numFeatures = 58
staticconstexpr

Definition at line 77 of file Feature.h.

◆ defaultObject

defaultObject_t ripple::detail::defaultObject

Definition at line 36 of file STVar.cpp.

◆ nonPresentObject

nonPresentObject_t ripple::detail::nonPresentObject

Definition at line 37 of file STVar.cpp.

◆ isoCharSet

constexpr std::string_view ripple::detail::isoCharSet
constexpr
Initial value:
=
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789"
"<>(){}[]|?!@#$%^&*"

Definition at line 35 of file UintTypes.cpp.

◆ isoCodeOffset

constexpr std::size_t ripple::detail::isoCodeOffset = 12
constexpr

Definition at line 42 of file UintTypes.cpp.

◆ isoCodeLength

constexpr std::size_t ripple::detail::isoCodeLength = 3
constexpr

Definition at line 45 of file UintTypes.cpp.