|
xrpld
|
Provides server functionality for clients. More...
#include <NetworkOPs.h>


Public Types | |
| enum class | FailHard : unsigned char { No , Yes } |
| using | clock_type = beast::AbstractClock<std::chrono::steady_clock> |
Public Member Functions | |
| ~NetworkOPs () override=default | |
| virtual void | stop ()=0 |
| virtual OperatingMode | getOperatingMode () const =0 |
| virtual std::string | strOperatingMode (OperatingMode const mode, bool const admin=false) const =0 |
| virtual std::string | strOperatingMode (bool const admin=false) const =0 |
| virtual void | submitTransaction (std::shared_ptr< STTx const > const &)=0 |
| virtual void | processTransaction (std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, FailHard failType)=0 |
| Process transactions as they arrive from the network or which are submitted by clients. | |
| virtual void | processTransactionSet (CanonicalTXSet const &set)=0 |
| Process a set of transactions synchronously, and ensuring that they are processed in one batch. | |
| virtual json::Value | getOwnerInfo (std::shared_ptr< ReadView const > lpLedger, AccountID const &account)=0 |
| virtual void | getBookPage (std::shared_ptr< ReadView const > &lpLedger, Book const &book, AccountID const &uTakerID, bool const bProof, unsigned int iLimit, json::Value const &jvMarker, json::Value &jvResult)=0 |
| virtual bool | processTrustedProposal (RCLCxPeerPos peerPos)=0 |
| virtual bool | recvValidation (std::shared_ptr< STValidation > const &val, std::string const &source)=0 |
| virtual void | mapComplete (std::shared_ptr< SHAMap > const &map, bool fromAcquire)=0 |
| virtual bool | beginConsensus (uint256 const &netLCL, std::unique_ptr< std::stringstream > const &clog)=0 |
| virtual void | endConsensus (std::unique_ptr< std::stringstream > const &clog)=0 |
| virtual void | setStandAlone ()=0 |
| virtual void | setStateTimer ()=0 |
| virtual void | setNeedNetworkLedger ()=0 |
| virtual void | clearNeedNetworkLedger ()=0 |
| virtual bool | isNeedNetworkLedger ()=0 |
| virtual bool | isFull ()=0 |
| virtual void | setMode (OperatingMode om)=0 |
| virtual bool | isBlocked ()=0 |
| virtual bool | isAmendmentBlocked ()=0 |
| virtual void | setAmendmentBlocked ()=0 |
| virtual bool | isAmendmentWarned ()=0 |
| virtual void | setAmendmentWarned ()=0 |
| virtual void | clearAmendmentWarned ()=0 |
| virtual bool | isUNLBlocked ()=0 |
| virtual void | setUNLBlocked ()=0 |
| virtual void | clearUNLBlocked ()=0 |
| virtual void | consensusViewChange ()=0 |
| virtual json::Value | getConsensusInfo ()=0 |
| virtual json::Value | getServerInfo (bool human, bool admin, bool counters)=0 |
| virtual void | clearLedgerFetch ()=0 |
| virtual json::Value | getLedgerFetchInfo ()=0 |
| virtual std::uint32_t | acceptLedger (std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)=0 |
| Accepts the current transaction tree, return the new ledger's sequence. | |
| virtual void | reportFeeChange ()=0 |
| virtual void | updateLocalTx (ReadView const &newValidLedger)=0 |
| virtual std::size_t | getLocalTxCount ()=0 |
| virtual void | pubLedger (std::shared_ptr< ReadView const > const &lpAccepted)=0 |
| virtual void | pubProposedTransaction (std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result)=0 |
| virtual void | pubValidation (std::shared_ptr< STValidation > const &val)=0 |
| virtual void | stateAccounting (json::Value &obj)=0 |
| virtual std::size_t | getBookSubscribersCount ()=0 |
| Total number of (book, subscriber) entries currently tracked. | |
| virtual void | subAccount (ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0 |
| virtual void | unsubAccount (ref isplistener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0 |
| virtual void | unsubAccountInternal (std::uint64_t uListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0 |
| virtual ErrorCodeI | subAccountHistory (ref ispListener, AccountID const &account)=0 |
| subscribe an account's new transactions and retrieve the account's historical transactions | |
| virtual void | unsubAccountHistory (ref ispListener, AccountID const &account, bool historyOnly)=0 |
| unsubscribe an account's transactions | |
| virtual void | unsubAccountHistoryInternal (std::uint64_t uListener, AccountID const &account, bool historyOnly)=0 |
| virtual void | scheduleAccountCleanup (std::uint64_t seq, hash_set< AccountID > rtAccounts, hash_set< AccountID > normalAccounts, hash_set< AccountID > historyAccounts)=0 |
| Schedule the server-side teardown of a disconnecting connection's account subscriptions off the destructor thread. | |
| virtual bool | subLedger (ref ispListener, json::Value &jvResult)=0 |
| virtual bool | unsubLedger (std::uint64_t uListener)=0 |
| virtual bool | subBookChanges (ref ispListener)=0 |
| virtual bool | unsubBookChanges (std::uint64_t uListener)=0 |
| virtual bool | subManifests (ref ispListener)=0 |
| virtual bool | unsubManifests (std::uint64_t uListener)=0 |
| virtual void | pubManifest (Manifest const &)=0 |
| virtual bool | subServer (ref ispListener, json::Value &jvResult, bool admin)=0 |
| virtual bool | unsubServer (std::uint64_t uListener)=0 |
| virtual bool | subBook (ref ispListener, Book const &)=0 |
| virtual bool | unsubBook (ref ispListener, Book const &)=0 |
| Remove a book subscription for a live subscriber. | |
| virtual bool | unsubBookInternal (std::uint64_t uListener, Book const &)=0 |
| Remove a book subscription during InfoSub teardown. | |
| virtual bool | subTransactions (ref ispListener)=0 |
| virtual bool | unsubTransactions (std::uint64_t uListener)=0 |
| virtual bool | subRTTransactions (ref ispListener)=0 |
| virtual bool | unsubRTTransactions (std::uint64_t uListener)=0 |
| virtual bool | subValidations (ref ispListener)=0 |
| virtual bool | unsubValidations (std::uint64_t uListener)=0 |
| virtual bool | subPeerStatus (ref ispListener)=0 |
| virtual bool | unsubPeerStatus (std::uint64_t uListener)=0 |
| virtual void | pubPeerStatus (std::function< json::Value(void)> const &)=0 |
| virtual bool | subConsensus (ref ispListener)=0 |
| virtual bool | unsubConsensus (std::uint64_t uListener)=0 |
| virtual pointer | findRpcSub (std::string const &strUrl)=0 |
| virtual pointer | addRpcSub (std::string const &strUrl, ref rspEntry)=0 |
| virtual bool | tryRemoveRpcSub (std::string const &strUrl)=0 |
| virtual beast::Journal const & | journal () const =0 |
| Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g. | |
Static Public Member Functions | |
| static FailHard | doFailHard (bool noMeansDont) |
Provides server functionality for clients.
Clients include backend applications, local commands, and connected clients. This class acts as a proxy, fulfilling the command with local data if possible, or asking the network and returning the results if needed.
A backend application or local client can trust a local instance of xrpld / NetworkOPs. However, client software connecting to non-local instances of xrpld will need to be hardened to protect against hostile or unreliable servers.
Definition at line 81 of file NetworkOPs.h.
Definition at line 84 of file NetworkOPs.h.
|
strong |
| Enumerator | |
|---|---|
| No | |
| Yes | |
Definition at line 86 of file NetworkOPs.h.
|
overridedefault |
|
static |
Definition at line 88 of file NetworkOPs.h.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
nodiscardpure virtual |
Implemented in xrpl::NetworkOPsImp.
|
nodiscardpure virtual |
Implemented in xrpl::NetworkOPsImp.
|
nodiscardpure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Process transactions as they arrive from the network or which are submitted by clients.
Process local transactions synchronously
| transaction | Transaction object |
| bUnlimited | Whether a privileged client connection submitted it. |
| bLocal | Client submission. |
| failType | fail_hard setting from transaction submission. |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Process a set of transactions synchronously, and ensuring that they are processed in one batch.
| set | Transaction object set |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Accepts the current transaction tree, return the new ledger's sequence.
This API is only used via RPC with the server in STANDALONE mode and performs a virtual consensus round, with all the transactions we are proposing being accepted.
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Implemented in xrpl::NetworkOPsImp.
|
pure virtual |
Total number of (book, subscriber) entries currently tracked.
Counts every weak_ptr stored across every book in subBook_, NOT the number of distinct subscribers and NOT the number of distinct books: a single subscriber following N books contributes N entries.
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
subscribe an account's new transactions and retrieve the account's historical transactions
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
unsubscribe an account's transactions
| historyOnly | if true, only stop historical transactions |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Schedule the server-side teardown of a disconnecting connection's account subscriptions off the destructor thread.
The implementation posts a low-priority JobQueue task that erases the entries in bounded chunks, so ~InfoSub returns immediately instead of running the erase loop inline. The sets are taken by value so the job owns its copies and never references the destroyed InfoSub. Cleanup is keyed on seq (unique per connection), so deferring it cannot disturb a reconnected client reusing the same accounts.
| seq | The disconnecting connection's unique subscription id. |
| rtAccounts | Real-time account subscriptions to remove. |
| normalAccounts | Normal account subscriptions to remove. |
| historyAccounts | Account-history subscriptions to remove. |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Remove a book subscription for a live subscriber.
Clears the book from the subscriber's own tracking set (InfoSub::bookSubscriptions_) and then removes the server-side entry from subBook_. Call this from RPC unsubscribe handlers.
| ispListener | The subscriber requesting removal. |
| book | The order book to unsubscribe from. |
book.Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Remove a book subscription during InfoSub teardown.
Removes only the server-side entry from subBook_. Does NOT touch InfoSub::bookSubscriptions_ because the InfoSub is being destroyed. Called by ~InfoSub() for each book in bookSubscriptions_.
| uListener | The sequence number of the subscriber being torn down. |
| book | The order book entry to remove. |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
pure virtualinherited |
Implemented in xrpl::NetworkOPsImp.
|
nodiscardpure virtualinherited |
Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g.
application-level Logs) is the only surviving sink — primarily destructor-time cleanup failures.
Implemented in xrpl::NetworkOPsImp.