rippled
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::NetworkOPsImp Class Referencefinal
Inheritance diagram for ripple::NetworkOPsImp:
Inheritance graph
[legend]
Collaboration diagram for ripple::NetworkOPsImp:
Collaboration graph
[legend]

Classes

struct  ServerFeeSummary
 Server fees published on server subscription. More...
 
class  StateAccounting
 State accounting records two attributes for each possible server state: 1) Amount of time spent in each state (in microseconds). More...
 
struct  Stats
 
struct  SubAccountHistoryIndex
 
struct  SubAccountHistoryInfo
 
struct  SubAccountHistoryInfoWeak
 
class  TransactionStatus
 Transaction with input flags and results to be applied in batches. More...
 

Public Types

enum  FailHard : unsigned char { FailHard::no, FailHard::yes }
 
using clock_type = beast::abstract_clock< std::chrono::steady_clock >
 

Public Member Functions

 NetworkOPsImp (Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool start_valid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
 
 ~NetworkOPsImp () override
 
OperatingMode getOperatingMode () const override
 
std::string strOperatingMode (OperatingMode const mode, bool const admin) const override
 
std::string strOperatingMode (bool const admin=false) const override
 
void submitTransaction (std::shared_ptr< STTx const > const &) override
 
void processTransaction (std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, FailHard failType) override
 Process transactions as they arrive from the network or which are submitted by clients. More...
 
void doTransactionSync (std::shared_ptr< Transaction > transaction, bool bUnlimited, FailHard failType)
 For transactions submitted directly by a client, apply batch of transactions and wait for this transaction to complete. More...
 
void doTransactionAsync (std::shared_ptr< Transaction > transaction, bool bUnlimited, FailHard failtype)
 For transactions not submitted by a locally connected client, fire and forget. More...
 
void transactionBatch ()
 Apply transactions in batches. More...
 
void apply (std::unique_lock< std::mutex > &batchLock)
 Attempt to apply transactions and post-process based on the results. More...
 
Json::Value getOwnerInfo (std::shared_ptr< ReadView const > lpLedger, AccountID const &account) override
 
void getBookPage (std::shared_ptr< ReadView const > &lpLedger, Book const &, AccountID const &uTakerID, const bool bProof, unsigned int iLimit, Json::Value const &jvMarker, Json::Value &jvResult) override
 
bool processTrustedProposal (RCLCxPeerPos proposal) override
 
bool recvValidation (std::shared_ptr< STValidation > const &val, std::string const &source) override
 
void mapComplete (std::shared_ptr< SHAMap > const &map, bool fromAcquire) override
 
bool beginConsensus (uint256 const &networkClosed) override
 
void endConsensus () override
 
void setStandAlone () override
 
void setStateTimer () override
 Called to initially start our timers. More...
 
void setNeedNetworkLedger () override
 
void clearNeedNetworkLedger () override
 
bool isNeedNetworkLedger () override
 
bool isFull () override
 
void setMode (OperatingMode om) override
 
bool isBlocked () override
 
bool isAmendmentBlocked () override
 
void setAmendmentBlocked () override
 
bool isAmendmentWarned () override
 
void setAmendmentWarned () override
 
void clearAmendmentWarned () override
 
bool isUNLBlocked () override
 
void setUNLBlocked () override
 
void clearUNLBlocked () override
 
void consensusViewChange () override
 
Json::Value getConsensusInfo () override
 
Json::Value getServerInfo (bool human, bool admin, bool counters) override
 
void clearLedgerFetch () override
 
Json::Value getLedgerFetchInfo () override
 
std::uint32_t acceptLedger (std::optional< std::chrono::milliseconds > consensusDelay) override
 Accepts the current transaction tree, return the new ledger's sequence. More...
 
void reportFeeChange () override
 
void reportConsensusStateChange (ConsensusPhase phase)
 
void updateLocalTx (ReadView const &view) override
 
std::size_t getLocalTxCount () override
 
void pubLedger (std::shared_ptr< ReadView const > const &lpAccepted) override
 
void pubProposedTransaction (std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result) override
 
void pubValidation (std::shared_ptr< STValidation > const &val) override
 
void forwardValidation (Json::Value const &jvObj) override
 
void forwardManifest (Json::Value const &jvObj) override
 
void forwardProposedTransaction (Json::Value const &jvObj) override
 
void forwardProposedAccountTransaction (Json::Value const &jvObj) override
 
void subAccount (InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
 
void unsubAccount (InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
 
void unsubAccountInternal (std::uint64_t seq, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
 
error_code_i subAccountHistory (InfoSub::ref ispListener, AccountID const &account) override
 subscribe an account's new transactions and retrieve the account's historical transactions More...
 
void unsubAccountHistory (InfoSub::ref ispListener, AccountID const &account, bool historyOnly) override
 unsubscribe an account's transactions More...
 
void unsubAccountHistoryInternal (std::uint64_t seq, AccountID const &account, bool historyOnly) override
 
bool subLedger (InfoSub::ref ispListener, Json::Value &jvResult) override
 
bool unsubLedger (std::uint64_t uListener) override
 
bool subBookChanges (InfoSub::ref ispListener) override
 
bool unsubBookChanges (std::uint64_t uListener) override
 
bool subServer (InfoSub::ref ispListener, Json::Value &jvResult, bool admin) override
 
bool unsubServer (std::uint64_t uListener) override
 
bool subBook (InfoSub::ref ispListener, Book const &) override
 
bool unsubBook (std::uint64_t uListener, Book const &) override
 
bool subManifests (InfoSub::ref ispListener) override
 
bool unsubManifests (std::uint64_t uListener) override
 
void pubManifest (Manifest const &) override
 
bool subTransactions (InfoSub::ref ispListener) override
 
bool unsubTransactions (std::uint64_t uListener) override
 
bool subRTTransactions (InfoSub::ref ispListener) override
 
bool unsubRTTransactions (std::uint64_t uListener) override
 
bool subValidations (InfoSub::ref ispListener) override
 
bool unsubValidations (std::uint64_t uListener) override
 
bool subPeerStatus (InfoSub::ref ispListener) override
 
bool unsubPeerStatus (std::uint64_t uListener) override
 
void pubPeerStatus (std::function< Json::Value(void)> const &) override
 
bool subConsensus (InfoSub::ref ispListener) override
 
bool unsubConsensus (std::uint64_t uListener) override
 
InfoSub::pointer findRpcSub (std::string const &strUrl) override
 
InfoSub::pointer addRpcSub (std::string const &strUrl, InfoSub::ref) override
 
bool tryRemoveRpcSub (std::string const &strUrl) override
 
void stop () override
 
void stateAccounting (Json::Value &obj) override
 

Static Public Member Functions

static FailHard doFailHard (bool noMeansDont)
 

Private Types

enum  DispatchState : unsigned char { DispatchState::none, DispatchState::scheduled, DispatchState::running }
 Synchronization states for transaction batches. More...
 
enum  SubTypes {
  sLedger, sManifests, sServer, sTransactions,
  sRTTransactions, sValidations, sPeerStatus, sConsensusPhase,
  sBookChanges, sLastEntry = sBookChanges
}
 
using SubMapType = hash_map< std::uint64_t, InfoSub::wptr >
 
using SubInfoMapType = hash_map< AccountID, SubMapType >
 
using subRpcMapType = hash_map< std::string, InfoSub::pointer >
 
using SubAccountHistoryMapType = hash_map< AccountID, hash_map< std::uint64_t, SubAccountHistoryInfoWeak > >
 

Private Member Functions

void switchLastClosedLedger (std::shared_ptr< Ledger const > const &newLCL)
 
bool checkLastClosedLedger (const Overlay::PeerSequence &, uint256 &networkClosed)
 
void setTimer (boost::asio::steady_timer &timer, std::chrono::milliseconds const &expiry_time, std::function< void()> onExpire, std::function< void()> onError)
 
void setHeartbeatTimer ()
 
void setClusterTimer ()
 
void processHeartbeatTimer ()
 
void processClusterTimer ()
 
Json::Value transJson (const STTx &transaction, TER result, bool validated, std::shared_ptr< ReadView const > const &ledger)
 
void pubValidatedTransaction (std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction)
 
void pubAccountTransaction (std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction)
 
void pubProposedAccountTransaction (std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result)
 
void pubServer ()
 
void pubConsensus (ConsensusPhase phase)
 
std::string getHostId (bool forAdmin)
 
void subAccountHistoryStart (std::shared_ptr< ReadView const > const &ledger, SubAccountHistoryInfoWeak &subInfo)
 
void addAccountHistoryJob (SubAccountHistoryInfoWeak subInfo)
 
void setAccountHistoryJobTimer (SubAccountHistoryInfoWeak subInfo)
 
void collect_metrics ()
 

Private Attributes

Applicationapp_
 
beast::Journal m_journal
 
std::unique_ptr< LocalTxsm_localTX
 
std::recursive_mutex mSubLock
 
std::atomic< OperatingModemMode
 
std::atomic< bool > needNetworkLedger_ {false}
 
std::atomic< bool > amendmentBlocked_ {false}
 
std::atomic< bool > amendmentWarned_ {false}
 
std::atomic< bool > unlBlocked_ {false}
 
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
 
boost::asio::steady_timer heartbeatTimer_
 
boost::asio::steady_timer clusterTimer_
 
boost::asio::steady_timer accountHistoryTxTimer_
 
RCLConsensus mConsensus
 
ConsensusPhase mLastConsensusPhase
 
LedgerMasterm_ledgerMaster
 
SubInfoMapType mSubAccount
 
SubInfoMapType mSubRTAccount
 
subRpcMapType mRpcSubMap
 
SubAccountHistoryMapType mSubAccountHistory
 
std::array< SubMapType, SubTypes::sLastEntry+1 > mStreamMaps
 
ServerFeeSummary mLastFeeSummary
 
JobQueuem_job_queue
 
const bool m_standalone
 
const std::size_t minPeerCount_
 
std::condition_variable mCond
 
std::mutex mMutex
 
DispatchState mDispatchState = DispatchState::none
 
std::vector< TransactionStatusmTransactions
 
StateAccounting accounting_ {}
 
std::mutex m_statsMutex
 
Stats m_stats
 

Static Private Attributes

static const std::array< char const *, 5 > states_ = stateNames
 

Detailed Description

Definition at line 79 of file NetworkOPs.cpp.

Member Typedef Documentation

◆ SubMapType

Definition at line 650 of file NetworkOPs.cpp.

◆ SubInfoMapType

Definition at line 651 of file NetworkOPs.cpp.

◆ subRpcMapType

Definition at line 652 of file NetworkOPs.cpp.

◆ SubAccountHistoryMapType

Definition at line 697 of file NetworkOPs.cpp.

◆ clock_type

Definition at line 89 of file NetworkOPs.h.

Member Enumeration Documentation

◆ DispatchState

enum ripple::NetworkOPsImp::DispatchState : unsigned char
strongprivate

Synchronization states for transaction batches.

Enumerator
none 
scheduled 
running 

Definition at line 109 of file NetworkOPs.cpp.

◆ SubTypes

Enumerator
sLedger 
sManifests 
sServer 
sTransactions 
sRTTransactions 
sValidations 
sPeerStatus 
sConsensusPhase 
sBookChanges 
sLastEntry 

Definition at line 743 of file NetworkOPs.cpp.

◆ FailHard

enum ripple::NetworkOPs::FailHard : unsigned char
stronginherited
Enumerator
no 
yes 

Definition at line 91 of file NetworkOPs.h.

Constructor & Destructor Documentation

◆ NetworkOPsImp()

ripple::NetworkOPsImp::NetworkOPsImp ( Application app,
NetworkOPs::clock_type clock,
bool  standalone,
std::size_t  minPeerCount,
bool  start_valid,
JobQueue job_queue,
LedgerMaster ledgerMaster,
ValidatorKeys const &  validatorKeys,
boost::asio::io_service &  io_svc,
beast::Journal  journal,
beast::insight::Collector::ptr const &  collector 
)

Definition at line 215 of file NetworkOPs.cpp.

◆ ~NetworkOPsImp()

ripple::NetworkOPsImp::~NetworkOPsImp ( )
override

Definition at line 253 of file NetworkOPs.cpp.

Member Function Documentation

◆ getOperatingMode()

OperatingMode ripple::NetworkOPsImp::getOperatingMode ( ) const
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 858 of file NetworkOPs.cpp.

◆ strOperatingMode() [1/2]

std::string ripple::NetworkOPsImp::strOperatingMode ( OperatingMode const  mode,
bool const  admin 
) const
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1110 of file NetworkOPs.cpp.

◆ strOperatingMode() [2/2]

std::string ripple::NetworkOPsImp::strOperatingMode ( bool const  admin = false) const
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 864 of file NetworkOPs.cpp.

◆ submitTransaction()

void ripple::NetworkOPsImp::submitTransaction ( std::shared_ptr< STTx const > const &  iTrans)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1130 of file NetworkOPs.cpp.

◆ processTransaction()

void ripple::NetworkOPsImp::processTransaction ( std::shared_ptr< Transaction > &  transaction,
bool  bUnlimited,
bool  bLocal,
FailHard  failType 
)
overridevirtual

Process transactions as they arrive from the network or which are submitted by clients.

Process local transactions synchronously

Parameters
transactionTransaction object
bUnlimitedWhether a privileged client connection submitted it.
bLocalClient submission.
failTypefail_hard setting from transaction submission.

Implements ripple::NetworkOPs.

Definition at line 1184 of file NetworkOPs.cpp.

◆ doTransactionSync()

void ripple::NetworkOPsImp::doTransactionSync ( std::shared_ptr< Transaction transaction,
bool  bUnlimited,
FailHard  failType 
)

For transactions submitted directly by a client, apply batch of transactions and wait for this transaction to complete.

Parameters
transactionTransaction object.
bUnliimitedWhether a privileged client connection submitted it.
failTypefail_hard setting from transaction submission.

Definition at line 1258 of file NetworkOPs.cpp.

◆ doTransactionAsync()

void ripple::NetworkOPsImp::doTransactionAsync ( std::shared_ptr< Transaction transaction,
bool  bUnlimited,
FailHard  failtype 
)

For transactions not submitted by a locally connected client, fire and forget.

Add to batch and trigger it to be processed if there's no batch currently being applied.

Parameters
transactionTransaction object
bUnlimitedWhether a privileged client connection submitted it.
failTypefail_hard setting from transaction submission.

Definition at line 1233 of file NetworkOPs.cpp.

◆ transactionBatch()

void ripple::NetworkOPsImp::transactionBatch ( )

Apply transactions in batches.

Continue until none are queued.

Definition at line 1298 of file NetworkOPs.cpp.

◆ apply()

void ripple::NetworkOPsImp::apply ( std::unique_lock< std::mutex > &  batchLock)

Attempt to apply transactions and post-process based on the results.

Parameters
Lockthat protects the transaction batching

Definition at line 1312 of file NetworkOPs.cpp.

◆ getOwnerInfo()

Json::Value ripple::NetworkOPsImp::getOwnerInfo ( std::shared_ptr< ReadView const >  lpLedger,
AccountID const &  account 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1519 of file NetworkOPs.cpp.

◆ getBookPage()

void ripple::NetworkOPsImp::getBookPage ( std::shared_ptr< ReadView const > &  lpLedger,
Book const &  book,
AccountID const &  uTakerID,
const bool  bProof,
unsigned int  iLimit,
Json::Value const &  jvMarker,
Json::Value jvResult 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 4155 of file NetworkOPs.cpp.

◆ processTrustedProposal()

bool ripple::NetworkOPsImp::processTrustedProposal ( RCLCxPeerPos  proposal)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1859 of file NetworkOPs.cpp.

◆ recvValidation()

bool ripple::NetworkOPsImp::recvValidation ( std::shared_ptr< STValidation > const &  val,
std::string const &  source 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2273 of file NetworkOPs.cpp.

◆ mapComplete()

void ripple::NetworkOPsImp::mapComplete ( std::shared_ptr< SHAMap > const &  map,
bool  fromAcquire 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1865 of file NetworkOPs.cpp.

◆ switchLastClosedLedger()

void ripple::NetworkOPsImp::switchLastClosedLedger ( std::shared_ptr< Ledger const > const &  newLCL)
private

Definition at line 1746 of file NetworkOPs.cpp.

◆ checkLastClosedLedger()

bool ripple::NetworkOPsImp::checkLastClosedLedger ( const Overlay::PeerSequence peerList,
uint256 networkClosed 
)
private

Definition at line 1641 of file NetworkOPs.cpp.

◆ beginConsensus()

bool ripple::NetworkOPsImp::beginConsensus ( uint256 const &  networkClosed)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1800 of file NetworkOPs.cpp.

◆ endConsensus()

void ripple::NetworkOPsImp::endConsensus ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1884 of file NetworkOPs.cpp.

◆ setStandAlone()

void ripple::NetworkOPsImp::setStandAlone ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 870 of file NetworkOPs.cpp.

◆ setStateTimer()

void ripple::NetworkOPsImp::setStateTimer ( )
overridevirtual

Called to initially start our timers.

Not called for stand-alone mode.

Implements ripple::NetworkOPs.

Definition at line 919 of file NetworkOPs.cpp.

◆ setNeedNetworkLedger()

void ripple::NetworkOPsImp::setNeedNetworkLedger ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 876 of file NetworkOPs.cpp.

◆ clearNeedNetworkLedger()

void ripple::NetworkOPsImp::clearNeedNetworkLedger ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 882 of file NetworkOPs.cpp.

◆ isNeedNetworkLedger()

bool ripple::NetworkOPsImp::isNeedNetworkLedger ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 888 of file NetworkOPs.cpp.

◆ isFull()

bool ripple::NetworkOPsImp::isFull ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 894 of file NetworkOPs.cpp.

◆ setMode()

void ripple::NetworkOPsImp::setMode ( OperatingMode  om)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2244 of file NetworkOPs.cpp.

◆ isBlocked()

bool ripple::NetworkOPsImp::isBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1585 of file NetworkOPs.cpp.

◆ isAmendmentBlocked()

bool ripple::NetworkOPsImp::isAmendmentBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1591 of file NetworkOPs.cpp.

◆ setAmendmentBlocked()

void ripple::NetworkOPsImp::setAmendmentBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1597 of file NetworkOPs.cpp.

◆ isAmendmentWarned()

bool ripple::NetworkOPsImp::isAmendmentWarned ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1604 of file NetworkOPs.cpp.

◆ setAmendmentWarned()

void ripple::NetworkOPsImp::setAmendmentWarned ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1610 of file NetworkOPs.cpp.

◆ clearAmendmentWarned()

void ripple::NetworkOPsImp::clearAmendmentWarned ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1616 of file NetworkOPs.cpp.

◆ isUNLBlocked()

bool ripple::NetworkOPsImp::isUNLBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1622 of file NetworkOPs.cpp.

◆ setUNLBlocked()

void ripple::NetworkOPsImp::setUNLBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1628 of file NetworkOPs.cpp.

◆ clearUNLBlocked()

void ripple::NetworkOPsImp::clearUNLBlocked ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1635 of file NetworkOPs.cpp.

◆ consensusViewChange()

void ripple::NetworkOPsImp::consensusViewChange ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 1940 of file NetworkOPs.cpp.

◆ getConsensusInfo()

Json::Value ripple::NetworkOPsImp::getConsensusInfo ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2290 of file NetworkOPs.cpp.

◆ getServerInfo()

Json::Value ripple::NetworkOPsImp::getServerInfo ( bool  human,
bool  admin,
bool  counters 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2296 of file NetworkOPs.cpp.

◆ clearLedgerFetch()

void ripple::NetworkOPsImp::clearLedgerFetch ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2668 of file NetworkOPs.cpp.

◆ getLedgerFetchInfo()

Json::Value ripple::NetworkOPsImp::getLedgerFetchInfo ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2674 of file NetworkOPs.cpp.

◆ acceptLedger()

std::uint32_t ripple::NetworkOPsImp::acceptLedger ( std::optional< std::chrono::milliseconds consensusDelay)
overridevirtual

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.

Implements ripple::NetworkOPs.

Definition at line 3880 of file NetworkOPs.cpp.

◆ reportFeeChange()

void ripple::NetworkOPsImp::reportFeeChange ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2980 of file NetworkOPs.cpp.

◆ reportConsensusStateChange()

void ripple::NetworkOPsImp::reportConsensusStateChange ( ConsensusPhase  phase)

Definition at line 3000 of file NetworkOPs.cpp.

◆ updateLocalTx()

void ripple::NetworkOPsImp::updateLocalTx ( ReadView const &  view)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 3009 of file NetworkOPs.cpp.

◆ getLocalTxCount()

std::size_t ripple::NetworkOPsImp::getLocalTxCount ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 3014 of file NetworkOPs.cpp.

◆ pubLedger()

void ripple::NetworkOPsImp::pubLedger ( std::shared_ptr< ReadView const > const &  lpAccepted)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2868 of file NetworkOPs.cpp.

◆ pubProposedTransaction()

void ripple::NetworkOPsImp::pubProposedTransaction ( std::shared_ptr< ReadView const > const &  ledger,
std::shared_ptr< STTx const > const &  transaction,
TER  result 
)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2680 of file NetworkOPs.cpp.

◆ pubValidation()

void ripple::NetworkOPsImp::pubValidation ( std::shared_ptr< STValidation > const &  val)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2123 of file NetworkOPs.cpp.

◆ forwardValidation()

void ripple::NetworkOPsImp::forwardValidation ( Json::Value const &  jvObj)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2742 of file NetworkOPs.cpp.

◆ forwardManifest()

void ripple::NetworkOPsImp::forwardManifest ( Json::Value const &  jvObj)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2762 of file NetworkOPs.cpp.

◆ forwardProposedTransaction()

void ripple::NetworkOPsImp::forwardProposedTransaction ( Json::Value const &  jvObj)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2711 of file NetworkOPs.cpp.

◆ forwardProposedAccountTransaction()

void ripple::NetworkOPsImp::forwardProposedAccountTransaction ( Json::Value const &  jvObj)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 2800 of file NetworkOPs.cpp.

◆ subAccount()

void ripple::NetworkOPsImp::subAccount ( InfoSub::ref  ispListener,
hash_set< AccountID > const &  vnaAccountIDs,
bool  rt 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3328 of file NetworkOPs.cpp.

◆ unsubAccount()

void ripple::NetworkOPsImp::unsubAccount ( InfoSub::ref  ispListener,
hash_set< AccountID > const &  vnaAccountIDs,
bool  rt 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3365 of file NetworkOPs.cpp.

◆ unsubAccountInternal()

void ripple::NetworkOPsImp::unsubAccountInternal ( std::uint64_t  seq,
hash_set< AccountID > const &  vnaAccountIDs,
bool  rt 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3381 of file NetworkOPs.cpp.

◆ subAccountHistory()

error_code_i ripple::NetworkOPsImp::subAccountHistory ( InfoSub::ref  ispListener,
AccountID const &  account 
)
overridevirtual

subscribe an account's new transactions and retrieve the account's historical transactions

Returns
rpcSUCCESS if successful, otherwise an error code

Implements ripple::InfoSub::Source.

Definition at line 3773 of file NetworkOPs.cpp.

◆ unsubAccountHistory()

void ripple::NetworkOPsImp::unsubAccountHistory ( InfoSub::ref  ispListener,
AccountID const &  account,
bool  historyOnly 
)
overridevirtual

unsubscribe an account's transactions

Parameters
historyOnlyif true, only stop historical transactions
Note
once a client receives enough historical transactions, it should unsubscribe with historyOnly == true to stop receiving more historical transactions. It will continue to receive new transactions.

Implements ripple::InfoSub::Source.

Definition at line 3819 of file NetworkOPs.cpp.

◆ unsubAccountHistoryInternal()

void ripple::NetworkOPsImp::unsubAccountHistoryInternal ( std::uint64_t  seq,
AccountID const &  account,
bool  historyOnly 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3830 of file NetworkOPs.cpp.

◆ subLedger()

bool ripple::NetworkOPsImp::subLedger ( InfoSub::ref  ispListener,
Json::Value jvResult 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3900 of file NetworkOPs.cpp.

◆ unsubLedger()

bool ripple::NetworkOPsImp::unsubLedger ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3940 of file NetworkOPs.cpp.

◆ subBookChanges()

bool ripple::NetworkOPsImp::subBookChanges ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3930 of file NetworkOPs.cpp.

◆ unsubBookChanges()

bool ripple::NetworkOPsImp::unsubBookChanges ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3948 of file NetworkOPs.cpp.

◆ subServer()

bool ripple::NetworkOPsImp::subServer ( InfoSub::ref  ispListener,
Json::Value jvResult,
bool  admin 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3974 of file NetworkOPs.cpp.

◆ unsubServer()

bool ripple::NetworkOPsImp::unsubServer ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4004 of file NetworkOPs.cpp.

◆ subBook()

bool ripple::NetworkOPsImp::subBook ( InfoSub::ref  ispListener,
Book const &  book 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3861 of file NetworkOPs.cpp.

◆ unsubBook()

bool ripple::NetworkOPsImp::unsubBook ( std::uint64_t  uListener,
Book const &  book 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3871 of file NetworkOPs.cpp.

◆ subManifests()

bool ripple::NetworkOPsImp::subManifests ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3956 of file NetworkOPs.cpp.

◆ unsubManifests()

bool ripple::NetworkOPsImp::unsubManifests ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 3966 of file NetworkOPs.cpp.

◆ pubManifest()

void ripple::NetworkOPsImp::pubManifest ( Manifest const &  mo)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 1949 of file NetworkOPs.cpp.

◆ subTransactions()

bool ripple::NetworkOPsImp::subTransactions ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4012 of file NetworkOPs.cpp.

◆ unsubTransactions()

bool ripple::NetworkOPsImp::unsubTransactions ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4022 of file NetworkOPs.cpp.

◆ subRTTransactions()

bool ripple::NetworkOPsImp::subRTTransactions ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4030 of file NetworkOPs.cpp.

◆ unsubRTTransactions()

bool ripple::NetworkOPsImp::unsubRTTransactions ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4040 of file NetworkOPs.cpp.

◆ subValidations()

bool ripple::NetworkOPsImp::subValidations ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4048 of file NetworkOPs.cpp.

◆ unsubValidations()

bool ripple::NetworkOPsImp::unsubValidations ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4064 of file NetworkOPs.cpp.

◆ subPeerStatus()

bool ripple::NetworkOPsImp::subPeerStatus ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4072 of file NetworkOPs.cpp.

◆ unsubPeerStatus()

bool ripple::NetworkOPsImp::unsubPeerStatus ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4082 of file NetworkOPs.cpp.

◆ pubPeerStatus()

void ripple::NetworkOPsImp::pubPeerStatus ( std::function< Json::Value(void)> const &  func)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 2215 of file NetworkOPs.cpp.

◆ subConsensus()

bool ripple::NetworkOPsImp::subConsensus ( InfoSub::ref  ispListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4090 of file NetworkOPs.cpp.

◆ unsubConsensus()

bool ripple::NetworkOPsImp::unsubConsensus ( std::uint64_t  uListener)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4100 of file NetworkOPs.cpp.

◆ findRpcSub()

InfoSub::pointer ripple::NetworkOPsImp::findRpcSub ( std::string const &  strUrl)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4107 of file NetworkOPs.cpp.

◆ addRpcSub()

InfoSub::pointer ripple::NetworkOPsImp::addRpcSub ( std::string const &  strUrl,
InfoSub::ref  rspEntry 
)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4120 of file NetworkOPs.cpp.

◆ tryRemoveRpcSub()

bool ripple::NetworkOPsImp::tryRemoveRpcSub ( std::string const &  strUrl)
overridevirtual

Implements ripple::InfoSub::Source.

Definition at line 4130 of file NetworkOPs.cpp.

◆ stop()

void ripple::NetworkOPsImp::stop ( )
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 564 of file NetworkOPs.cpp.

◆ stateAccounting()

void ripple::NetworkOPsImp::stateAccounting ( Json::Value obj)
overridevirtual

Implements ripple::NetworkOPs.

Definition at line 4057 of file NetworkOPs.cpp.

◆ setTimer()

void ripple::NetworkOPsImp::setTimer ( boost::asio::steady_timer &  timer,
std::chrono::milliseconds const &  expiry_time,
std::function< void()>  onExpire,
std::function< void()>  onError 
)
private

Definition at line 929 of file NetworkOPs.cpp.

◆ setHeartbeatTimer()

void ripple::NetworkOPsImp::setHeartbeatTimer ( )
private

Definition at line 961 of file NetworkOPs.cpp.

◆ setClusterTimer()

void ripple::NetworkOPsImp::setClusterTimer ( )
private

Definition at line 975 of file NetworkOPs.cpp.

◆ processHeartbeatTimer()

void ripple::NetworkOPsImp::processHeartbeatTimer ( )
private

Definition at line 1004 of file NetworkOPs.cpp.

◆ processClusterTimer()

void ripple::NetworkOPsImp::processClusterTimer ( )
private

Definition at line 1062 of file NetworkOPs.cpp.

◆ transJson()

Json::Value ripple::NetworkOPsImp::transJson ( const STTx transaction,
TER  result,
bool  validated,
std::shared_ptr< ReadView const > const &  ledger 
)
private

Definition at line 3022 of file NetworkOPs.cpp.

◆ pubValidatedTransaction()

void ripple::NetworkOPsImp::pubValidatedTransaction ( std::shared_ptr< ReadView const > const &  ledger,
AcceptedLedgerTx const &  transaction 
)
private

Definition at line 3080 of file NetworkOPs.cpp.

◆ pubAccountTransaction()

void ripple::NetworkOPsImp::pubAccountTransaction ( std::shared_ptr< ReadView const > const &  ledger,
AcceptedLedgerTx const &  transaction 
)
private

Definition at line 3135 of file NetworkOPs.cpp.

◆ pubProposedAccountTransaction()

void ripple::NetworkOPsImp::pubProposedAccountTransaction ( std::shared_ptr< ReadView const > const &  ledger,
std::shared_ptr< STTx const > const &  transaction,
TER  result 
)
private

Definition at line 3258 of file NetworkOPs.cpp.

◆ pubServer()

void ripple::NetworkOPsImp::pubServer ( )
private

Definition at line 2028 of file NetworkOPs.cpp.

◆ pubConsensus()

void ripple::NetworkOPsImp::pubConsensus ( ConsensusPhase  phase)
private

Definition at line 2096 of file NetworkOPs.cpp.

◆ getHostId()

std::string ripple::NetworkOPsImp::getHostId ( bool  forAdmin)
private

Definition at line 900 of file NetworkOPs.cpp.

◆ subAccountHistoryStart()

void ripple::NetworkOPsImp::subAccountHistoryStart ( std::shared_ptr< ReadView const > const &  ledger,
SubAccountHistoryInfoWeak subInfo 
)
private
Note
called while holding mSubLock

Definition at line 3729 of file NetworkOPs.cpp.

◆ addAccountHistoryJob()

void ripple::NetworkOPsImp::addAccountHistoryJob ( SubAccountHistoryInfoWeak  subInfo)
private

Definition at line 3409 of file NetworkOPs.cpp.

◆ setAccountHistoryJobTimer()

void ripple::NetworkOPsImp::setAccountHistoryJobTimer ( SubAccountHistoryInfoWeak  subInfo)
private

Definition at line 991 of file NetworkOPs.cpp.

◆ collect_metrics()

void ripple::NetworkOPsImp::collect_metrics ( )
private

Definition at line 4495 of file NetworkOPs.cpp.

◆ doFailHard()

static FailHard ripple::NetworkOPs::doFailHard ( bool  noMeansDont)
staticinherited

Definition at line 93 of file NetworkOPs.h.

Member Data Documentation

◆ states_

const std::array< char const *, 5 > ripple::NetworkOPsImp::states_ = stateNames
staticprivate

Definition at line 115 of file NetworkOPs.cpp.

◆ app_

Application& ripple::NetworkOPsImp::app_
private

Definition at line 711 of file NetworkOPs.cpp.

◆ m_journal

beast::Journal ripple::NetworkOPsImp::m_journal
private

Definition at line 712 of file NetworkOPs.cpp.

◆ m_localTX

std::unique_ptr<LocalTxs> ripple::NetworkOPsImp::m_localTX
private

Definition at line 714 of file NetworkOPs.cpp.

◆ mSubLock

std::recursive_mutex ripple::NetworkOPsImp::mSubLock
private

Definition at line 716 of file NetworkOPs.cpp.

◆ mMode

std::atomic<OperatingMode> ripple::NetworkOPsImp::mMode
private

Definition at line 718 of file NetworkOPs.cpp.

◆ needNetworkLedger_

std::atomic<bool> ripple::NetworkOPsImp::needNetworkLedger_ {false}
private

Definition at line 720 of file NetworkOPs.cpp.

◆ amendmentBlocked_

std::atomic<bool> ripple::NetworkOPsImp::amendmentBlocked_ {false}
private

Definition at line 721 of file NetworkOPs.cpp.

◆ amendmentWarned_

std::atomic<bool> ripple::NetworkOPsImp::amendmentWarned_ {false}
private

Definition at line 722 of file NetworkOPs.cpp.

◆ unlBlocked_

std::atomic<bool> ripple::NetworkOPsImp::unlBlocked_ {false}
private

Definition at line 723 of file NetworkOPs.cpp.

◆ waitHandlerCounter_

ClosureCounter<void, boost::system::error_code const&> ripple::NetworkOPsImp::waitHandlerCounter_
private

Definition at line 725 of file NetworkOPs.cpp.

◆ heartbeatTimer_

boost::asio::steady_timer ripple::NetworkOPsImp::heartbeatTimer_
private

Definition at line 726 of file NetworkOPs.cpp.

◆ clusterTimer_

boost::asio::steady_timer ripple::NetworkOPsImp::clusterTimer_
private

Definition at line 727 of file NetworkOPs.cpp.

◆ accountHistoryTxTimer_

boost::asio::steady_timer ripple::NetworkOPsImp::accountHistoryTxTimer_
private

Definition at line 728 of file NetworkOPs.cpp.

◆ mConsensus

RCLConsensus ripple::NetworkOPsImp::mConsensus
private

Definition at line 730 of file NetworkOPs.cpp.

◆ mLastConsensusPhase

ConsensusPhase ripple::NetworkOPsImp::mLastConsensusPhase
private

Definition at line 732 of file NetworkOPs.cpp.

◆ m_ledgerMaster

LedgerMaster& ripple::NetworkOPsImp::m_ledgerMaster
private

Definition at line 734 of file NetworkOPs.cpp.

◆ mSubAccount

SubInfoMapType ripple::NetworkOPsImp::mSubAccount
private

Definition at line 736 of file NetworkOPs.cpp.

◆ mSubRTAccount

SubInfoMapType ripple::NetworkOPsImp::mSubRTAccount
private

Definition at line 737 of file NetworkOPs.cpp.

◆ mRpcSubMap

subRpcMapType ripple::NetworkOPsImp::mRpcSubMap
private

Definition at line 739 of file NetworkOPs.cpp.

◆ mSubAccountHistory

SubAccountHistoryMapType ripple::NetworkOPsImp::mSubAccountHistory
private

Definition at line 741 of file NetworkOPs.cpp.

◆ mStreamMaps

std::array<SubMapType, SubTypes::sLastEntry + 1> ripple::NetworkOPsImp::mStreamMaps
private

Definition at line 757 of file NetworkOPs.cpp.

◆ mLastFeeSummary

ServerFeeSummary ripple::NetworkOPsImp::mLastFeeSummary
private

Definition at line 759 of file NetworkOPs.cpp.

◆ m_job_queue

JobQueue& ripple::NetworkOPsImp::m_job_queue
private

Definition at line 761 of file NetworkOPs.cpp.

◆ m_standalone

const bool ripple::NetworkOPsImp::m_standalone
private

Definition at line 764 of file NetworkOPs.cpp.

◆ minPeerCount_

const std::size_t ripple::NetworkOPsImp::minPeerCount_
private

Definition at line 767 of file NetworkOPs.cpp.

◆ mCond

std::condition_variable ripple::NetworkOPsImp::mCond
private

Definition at line 770 of file NetworkOPs.cpp.

◆ mMutex

std::mutex ripple::NetworkOPsImp::mMutex
private

Definition at line 771 of file NetworkOPs.cpp.

◆ mDispatchState

DispatchState ripple::NetworkOPsImp::mDispatchState = DispatchState::none
private

Definition at line 772 of file NetworkOPs.cpp.

◆ mTransactions

std::vector<TransactionStatus> ripple::NetworkOPsImp::mTransactions
private

Definition at line 773 of file NetworkOPs.cpp.

◆ accounting_

StateAccounting ripple::NetworkOPsImp::accounting_ {}
private

Definition at line 775 of file NetworkOPs.cpp.

◆ m_statsMutex

std::mutex ripple::NetworkOPsImp::m_statsMutex
private

Definition at line 829 of file NetworkOPs.cpp.

◆ m_stats

Stats ripple::NetworkOPsImp::m_stats
private

Definition at line 830 of file NetworkOPs.cpp.