Kagome
Polkadot Runtime Engine in C++17
|
#include <peer_manager.hpp>
Public Types | |
using | PeerId = libp2p::peer::PeerId |
using | PeerInfo = libp2p::peer::PeerInfo |
using | BlockInfo = primitives::BlockInfo |
using | AdvResult = outcome::result< std::pair< network::CollatorPublicKey const &, network::ParachainId >> |
Public Member Functions | |
virtual | ~PeerManager ()=default |
virtual void | connectToPeer (const PeerInfo &peer_info)=0 |
virtual void | reserveStreams (const PeerId &peer_id) const =0 |
virtual std::shared_ptr< StreamEngine > | getStreamEngine ()=0 |
virtual void | keepAlive (const PeerId &peer_id)=0 |
virtual void | startPingingPeer (const PeerId &peer_id)=0 |
virtual void | updatePeerState (const PeerId &peer_id, const Status &status)=0 |
virtual void | updatePeerState (const PeerId &peer_id, const BlockAnnounce &announce)=0 |
virtual outcome::result< std::pair< network::CollatorPublicKey const &, network::ParachainId > > | insert_advertisement (PeerState &peer_state, ParachainState ¶chain_state, primitives::BlockHash para_hash)=0 |
virtual ParachainState & | parachainState ()=0 |
virtual void | setCollating (const PeerId &peer_id, network::CollatorPublicKey const &collator_id, network::ParachainId para_id)=0 |
virtual void | updatePeerState (const PeerId &peer_id, const GrandpaNeighborMessage &neighbor_message)=0 |
virtual std::optional< std::reference_wrapper< PeerState > > | getPeerState (const PeerId &peer_id)=0 |
virtual size_t | activePeersNumber () const =0 |
virtual void | forEachPeer (std::function< void(const PeerId &)> func) const =0 |
virtual void | forOnePeer (const PeerId &peer_id, std::function< void(const PeerId &)> func) const =0 |
Manage active peers:
Definition at line 63 of file peer_manager.hpp.
using kagome::network::PeerManager::AdvResult = outcome::result< std::pair<network::CollatorPublicKey const &, network::ParachainId>> |
Definition at line 69 of file peer_manager.hpp.
Definition at line 67 of file peer_manager.hpp.
using kagome::network::PeerManager::PeerId = libp2p::peer::PeerId |
Definition at line 65 of file peer_manager.hpp.
using kagome::network::PeerManager::PeerInfo = libp2p::peer::PeerInfo |
Definition at line 66 of file peer_manager.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Apply {
func} | to an active peer with id { |
peer_id} |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
peer_id} | or none |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Return stream engine object.
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Store advertisement from a peer to later processing;
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
|
pure virtual |
Allows to update parachains states.
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Reserves stream slots of needed protocols for peer by {
peer_id} |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Updates collation state and stores parachain id. Should be called once for each peer per connection. If else -> reduce reputation.
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Starts outgoing pinging to peer with {
peer_id} |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Updates known data about peer with {
peer_id} | by { |
status} |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Updates known data about peer with {
peer_id} | by { |
announce} |
Implemented in kagome::network::PeerManagerImpl.
|
pure virtual |
Updates known data about peer with {
peer_id} | by { |
neighbor_message} |
Implemented in kagome::network::PeerManagerImpl.