#include <peer_manager_impl.hpp>
|
| PeerManagerImpl (std::shared_ptr< application::AppStateManager > app_state_manager, libp2p::Host &host, std::shared_ptr< libp2p::protocol::Identify > identify, std::shared_ptr< libp2p::protocol::kademlia::Kademlia > kademlia, std::shared_ptr< libp2p::basic::Scheduler > scheduler, std::shared_ptr< StreamEngine > stream_engine, const application::AppConfiguration &app_config, std::shared_ptr< clock::SteadyClock > clock, const BootstrapNodes &bootstrap_nodes, const OwnPeerInfo &own_peer_info, std::shared_ptr< network::Router > router, std::shared_ptr< storage::BufferStorage > storage, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< ReputationRepository > reputation_repository) |
|
bool | prepare () |
|
bool | start () |
|
void | stop () |
|
void | connectToPeer (const PeerInfo &peer_info) override |
|
void | reserveStreams (const PeerId &peer_id) const override |
|
std::shared_ptr< StreamEngine > | getStreamEngine () override |
|
size_t | activePeersNumber () const override |
|
void | setCollating (const PeerId &peer_id, network::CollatorPublicKey const &collator_id, network::ParachainId para_id) override |
|
ParachainState & | parachainState () override |
|
outcome::result< std::pair< network::CollatorPublicKey const &, network::ParachainId > > | insert_advertisement (PeerState &peer_state, ParachainState ¶chain_state, primitives::BlockHash para_hash) override |
|
void | forEachPeer (std::function< void(const PeerId &)> func) const override |
|
void | forOnePeer (const PeerId &peer_id, std::function< void(const PeerId &)> func) const override |
|
void | keepAlive (const PeerId &peer_id) override |
|
void | startPingingPeer (const PeerId &peer_id) override |
|
void | updatePeerState (const PeerId &peer_id, const Status &status) override |
|
void | updatePeerState (const PeerId &peer_id, const BlockAnnounce &announce) override |
|
void | updatePeerState (const PeerId &peer_id, const GrandpaNeighborMessage &neighbor_message) override |
|
std::optional< std::reference_wrapper< PeerState > > | getPeerState (const PeerId &peer_id) override |
|
virtual | ~PeerManager ()=default |
|
Definition at line 52 of file peer_manager_impl.hpp.
kagome::network::PeerManagerImpl::PeerManagerImpl |
( |
std::shared_ptr< application::AppStateManager > |
app_state_manager, |
|
|
libp2p::Host & |
host, |
|
|
std::shared_ptr< libp2p::protocol::Identify > |
identify, |
|
|
std::shared_ptr< libp2p::protocol::kademlia::Kademlia > |
kademlia, |
|
|
std::shared_ptr< libp2p::basic::Scheduler > |
scheduler, |
|
|
std::shared_ptr< StreamEngine > |
stream_engine, |
|
|
const application::AppConfiguration & |
app_config, |
|
|
std::shared_ptr< clock::SteadyClock > |
clock, |
|
|
const BootstrapNodes & |
bootstrap_nodes, |
|
|
const OwnPeerInfo & |
own_peer_info, |
|
|
std::shared_ptr< network::Router > |
router, |
|
|
std::shared_ptr< storage::BufferStorage > |
storage, |
|
|
std::shared_ptr< crypto::Hasher > |
hasher, |
|
|
std::shared_ptr< ReputationRepository > |
reputation_repository |
|
) |
| |
size_t kagome::network::PeerManagerImpl::activePeersNumber |
( |
| ) |
const |
|
overridevirtual |
void kagome::network::PeerManagerImpl::align |
( |
| ) |
|
|
private |
void kagome::network::PeerManagerImpl::clearClosedPingingConnections |
( |
| ) |
|
|
private |
void kagome::network::PeerManagerImpl::connectToPeer |
( |
const PeerInfo & |
peer_info | ) |
|
|
overridevirtual |
void kagome::network::PeerManagerImpl::connectToPeer |
( |
const PeerId & |
peer_id | ) |
|
|
private |
void kagome::network::PeerManagerImpl::disconnectFromPeer |
( |
const PeerId & |
peer_id | ) |
|
|
private |
void kagome::network::PeerManagerImpl::forEachPeer |
( |
std::function< void(const PeerId &)> |
func | ) |
const |
|
overridevirtual |
void kagome::network::PeerManagerImpl::forOnePeer |
( |
const PeerId & |
peer_id, |
|
|
std::function< void(const PeerId &)> |
func |
|
) |
| const |
|
overridevirtual |
std::optional< std::reference_wrapper< PeerState > > kagome::network::PeerManagerImpl::getPeerState |
( |
const PeerId & |
peer_id | ) |
|
|
overridevirtual |
std::shared_ptr< StreamEngine > kagome::network::PeerManagerImpl::getStreamEngine |
( |
| ) |
|
|
overridevirtual |
bool kagome::network::PeerManagerImpl::isSelfPeer |
( |
const PeerId & |
peer_id | ) |
const |
|
private |
void kagome::network::PeerManagerImpl::keepAlive |
( |
const PeerId & |
peer_id | ) |
|
|
overridevirtual |
bool kagome::network::PeerManagerImpl::prepare |
( |
| ) |
|
void kagome::network::PeerManagerImpl::processDiscoveredPeer |
( |
const PeerId & |
peer_id | ) |
|
|
private |
void kagome::network::PeerManagerImpl::processFullyConnectedPeer |
( |
const PeerId & |
peer_id | ) |
|
|
private |
void kagome::network::PeerManagerImpl::reserveStreams |
( |
const PeerId & |
peer_id | ) |
const |
|
overridevirtual |
bool kagome::network::PeerManagerImpl::start |
( |
| ) |
|
void kagome::network::PeerManagerImpl::startPingingPeer |
( |
const PeerId & |
peer_id | ) |
|
|
overridevirtual |
void kagome::network::PeerManagerImpl::stop |
( |
| ) |
|
void kagome::network::PeerManagerImpl::storeActivePeers |
( |
| ) |
|
|
private |
Stores peers addresses to the state storage to warm up the following node start
Definition at line 760 of file peer_manager_impl.cpp.
void kagome::network::PeerManagerImpl::updatePeerState |
( |
const PeerId & |
peer_id, |
|
|
const Status & |
status |
|
) |
| |
|
overridevirtual |
void kagome::network::PeerManagerImpl::updatePeerState |
( |
const PeerId & |
peer_id, |
|
|
const BlockAnnounce & |
announce |
|
) |
| |
|
overridevirtual |
libp2p::event::Handle kagome::network::PeerManagerImpl::add_peer_handle_ |
|
private |
libp2p::basic::Scheduler::Handle kagome::network::PeerManagerImpl::align_timer_ |
|
private |
const BootstrapNodes& kagome::network::PeerManagerImpl::bootstrap_nodes_ |
|
private |
std::unordered_set<PeerId> kagome::network::PeerManagerImpl::connecting_peers_ |
|
private |
std::shared_ptr<crypto::Hasher> kagome::network::PeerManagerImpl::hasher_ |
|
private |
libp2p::Host& kagome::network::PeerManagerImpl::host_ |
|
private |
std::shared_ptr<libp2p::protocol::Identify> kagome::network::PeerManagerImpl::identify_ |
|
private |
std::shared_ptr<libp2p::protocol::kademlia::Kademlia> kagome::network::PeerManagerImpl::kademlia_ |
|
private |
constexpr std::chrono::seconds kagome::network::PeerManagerImpl::kTimeoutForConnecting {15} |
|
static |
const OwnPeerInfo& kagome::network::PeerManagerImpl::own_peer_info_ |
|
private |
libp2p::event::Handle kagome::network::PeerManagerImpl::peer_disconnected_handler_ |
|
private |
std::unordered_map<PeerId, PeerState> kagome::network::PeerManagerImpl::peer_states_ |
|
private |
std::unordered_set<PeerId> kagome::network::PeerManagerImpl::peers_in_queue_ |
|
private |
std::unordered_set<libp2p::network::ConnectionManager::ConnectionSPtr> kagome::network::PeerManagerImpl::pinging_connections_ |
|
private |
std::deque<std::reference_wrapper<const PeerId> > kagome::network::PeerManagerImpl::queue_to_connect_ |
|
private |
std::set<PeerId> kagome::network::PeerManagerImpl::recently_active_peers_ |
|
private |
std::shared_ptr<libp2p::basic::Scheduler> kagome::network::PeerManagerImpl::scheduler_ |
|
private |
std::shared_ptr<StreamEngine> kagome::network::PeerManagerImpl::stream_engine_ |
|
private |
The documentation for this class was generated from the following files: