|
TARAXA
|
#include <network.hpp>

Public Member Functions | |
| Network (const FullNodeConfig &config, const h256 &genesis_hash, const std::filesystem::path &network_file_path, std::shared_ptr< DbStorage > db, std::shared_ptr< PbftManager > pbft_mgr, std::shared_ptr< PbftChain > pbft_chain, std::shared_ptr< VoteManager > vote_mgr, std::shared_ptr< DagManager > dag_mgr, std::shared_ptr< TransactionManager > trx_mgr, std::shared_ptr< SlashingManager > slashing_manager, std::shared_ptr< pillar_chain::PillarChainManager > pillar_chain_mgr, std::shared_ptr< final_chain::FinalChain > final_chain) | |
| ~Network () | |
| Network (const Network &)=delete | |
| Network (Network &&)=delete | |
| Network & | operator= (const Network &)=delete |
| Network & | operator= (Network &&)=delete |
| void | start () |
| Starts threadpools for packets communication in general, specific packets processing and periodic events. | |
| bool | isStarted () |
| std::list< dev::p2p::NodeEntry > | getAllNodes () const |
| size_t | getPeerCount () |
| unsigned | getNodeCount () |
| Json::Value | getStatus () |
| bool | pbft_syncing () |
| uint64_t | syncTimeSeconds () const |
| void | setSyncStatePeriod (PbftPeriod period) |
| void | gossipDagBlock (const std::shared_ptr< DagBlock > &block, bool proposed, const SharedTransactions &trxs) |
| void | gossipVote (const std::shared_ptr< PbftVote > &vote, const std::shared_ptr< PbftBlock > &block, bool rebroadcast=false) |
| void | gossipVotesBundle (const std::vector< std::shared_ptr< PbftVote > > &votes, bool rebroadcast=false) |
| void | gossipPillarBlockVote (const std::shared_ptr< PillarVote > &vote, bool rebroadcast=false) |
| void | handleMaliciousSyncPeer (const dev::p2p::NodeID &id) |
| std::shared_ptr< network::tarcap::TaraxaPeer > | getMaxChainPeer () const |
| void | requestPillarBlockVotesBundle (PbftPeriod period, const blk_hash_t &pillar_block_hash) |
| Request pillar block votes bundle packet from random peer. | |
| bool | packetQueueOverLimit () const |
| Get packets queue status. | |
| template<typename PacketHandlerType > | |
| std::shared_ptr< PacketHandlerType > | getSpecificHandler (network::SubprotocolPacketType packet_type) const |
| dev::p2p::NodeID | getNodeId () const |
| std::shared_ptr< network::tarcap::TaraxaPeer > | getPeer (dev::p2p::NodeID const &id) const |
Private Member Functions | |
| void | registerPeriodicEvents (std::shared_ptr< TransactionManager > trx_mgr) |
| Register period events, e.g. sending status packet, transaction packet etc... | |
| void | addBootNodes (bool initial=false) |
Static Private Member Functions | |
| static std::pair< bool, bi::tcp::endpoint > | resolveHost (std::string const &addr, uint16_t port) |
Private Attributes | |
| const FullNodeConfig & | kConf |
| std::shared_ptr< network::tarcap::TimePeriodPacketsStats > | all_packets_stats_ |
| std::shared_ptr< network::tarcap::NodeStats > | node_stats_ |
| std::shared_ptr< network::tarcap::PbftSyncingState > | pbft_syncing_state_ |
| std::shared_ptr< PbftManager > | pbft_mgr_ |
| util::ThreadPool | tp_ |
| std::shared_ptr< dev::p2p::Host > | host_ |
| std::map< network::tarcap::TarcapVersion, std::shared_ptr< network::tarcap::TaraxaCapability >, std::greater< network::tarcap::TarcapVersion > > | tarcaps_ |
| std::shared_ptr< network::threadpool::PacketsThreadPool > | packets_tp_ |
| util::ThreadPool | periodic_events_tp_ |
| taraxa::Network::Network | ( | const FullNodeConfig & | config, |
| const h256 & | genesis_hash, | ||
| const std::filesystem::path & | network_file_path, | ||
| std::shared_ptr< DbStorage > | db, | ||
| std::shared_ptr< PbftManager > | pbft_mgr, | ||
| std::shared_ptr< PbftChain > | pbft_chain, | ||
| std::shared_ptr< VoteManager > | vote_mgr, | ||
| std::shared_ptr< DagManager > | dag_mgr, | ||
| std::shared_ptr< TransactionManager > | trx_mgr, | ||
| std::shared_ptr< SlashingManager > | slashing_manager, | ||
| std::shared_ptr< pillar_chain::PillarChainManager > | pillar_chain_mgr, | ||
| std::shared_ptr< final_chain::FinalChain > | final_chain | ||
| ) |
| taraxa::Network::~Network | ( | ) |
|
delete |
|
delete |
|
private |
| std::list< dev::p2p::NodeEntry > taraxa::Network::getAllNodes | ( | ) | const |
| std::shared_ptr< network::tarcap::TaraxaPeer > taraxa::Network::getMaxChainPeer | ( | ) | const |
| unsigned taraxa::Network::getNodeCount | ( | ) |
| dev::p2p::NodeID taraxa::Network::getNodeId | ( | ) | const |
| std::shared_ptr< network::tarcap::TaraxaPeer > taraxa::Network::getPeer | ( | dev::p2p::NodeID const & | id | ) | const |
| size_t taraxa::Network::getPeerCount | ( | ) |
| std::shared_ptr< PacketHandlerType > taraxa::Network::getSpecificHandler | ( | network::SubprotocolPacketType | packet_type | ) | const |
| Json::Value taraxa::Network::getStatus | ( | ) |
| void taraxa::Network::gossipDagBlock | ( | const std::shared_ptr< DagBlock > & | block, |
| bool | proposed, | ||
| const SharedTransactions & | trxs | ||
| ) |
| void taraxa::Network::gossipPillarBlockVote | ( | const std::shared_ptr< PillarVote > & | vote, |
| bool | rebroadcast = false |
||
| ) |
| void taraxa::Network::gossipVote | ( | const std::shared_ptr< PbftVote > & | vote, |
| const std::shared_ptr< PbftBlock > & | block, | ||
| bool | rebroadcast = false |
||
| ) |
| void taraxa::Network::gossipVotesBundle | ( | const std::vector< std::shared_ptr< PbftVote > > & | votes, |
| bool | rebroadcast = false |
||
| ) |
| void taraxa::Network::handleMaliciousSyncPeer | ( | const dev::p2p::NodeID & | id | ) |
| bool taraxa::Network::isStarted | ( | ) |
| bool taraxa::Network::packetQueueOverLimit | ( | ) | const |
Get packets queue status.
| bool taraxa::Network::pbft_syncing | ( | ) |
|
private |
Register period events, e.g. sending status packet, transaction packet etc...
| config | |
| trx_mgr |
| void taraxa::Network::requestPillarBlockVotesBundle | ( | taraxa::PbftPeriod | period, |
| const blk_hash_t & | pillar_block_hash | ||
| ) |
Request pillar block votes bundle packet from random peer.
| period | |
| pillar_block_hash |
|
staticprivate |
| void taraxa::Network::setSyncStatePeriod | ( | PbftPeriod | period | ) |
| void taraxa::Network::start | ( | ) |
Starts threadpools for packets communication in general, specific packets processing and periodic events.
| uint64_t taraxa::Network::syncTimeSeconds | ( | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |