Kagome
Polkadot Runtime Engine in C++17
kagome::network::RouterLibp2p Class Reference

#include <router_libp2p.hpp>

Inheritance diagram for kagome::network::RouterLibp2p:
Collaboration diagram for kagome::network::RouterLibp2p:

Public Member Functions

 RouterLibp2p (std::shared_ptr< application::AppStateManager > app_state_manager, libp2p::Host &host, const application::AppConfiguration &app_config, const OwnPeerInfo &own_info, const BootstrapNodes &bootstrap_nodes, std::shared_ptr< libp2p::protocol::Ping > ping_proto, std::shared_ptr< network::ProtocolFactory > protocol_factory)
 
 ~RouterLibp2p () override=default
 
bool prepare ()
 
bool start ()
 
void stop ()
 
std::shared_ptr< BlockAnnounceProtocolgetBlockAnnounceProtocol () const override
 
std::shared_ptr< PropagateTransactionsProtocolgetPropagateTransactionsProtocol () const override
 
std::shared_ptr< StateProtocolgetStateProtocol () const override
 
std::shared_ptr< SyncProtocolgetSyncProtocol () const override
 
std::shared_ptr< GrandpaProtocolgetGrandpaProtocol () const override
 
std::shared_ptr< CollationProtocolgetCollationProtocol () const override
 
std::shared_ptr< ReqCollationProtocolgetReqCollationProtocol () const override
 
std::shared_ptr< libp2p::protocol::Ping > getPingProtocol () const override
 
- Public Member Functions inherited from kagome::network::Router
virtual ~Router ()=default
 

Private Member Functions

outcome::result< void > appendPeerIdToAddress (libp2p::multi::Multiaddress &address) const
 

Private Attributes

std::shared_ptr< application::AppStateManagerapp_state_manager_
 
libp2p::Host & host_
 
const application::AppConfigurationapp_config_
 
const OwnPeerInfoown_info_
 
log::Logger log_
 
std::shared_ptr< libp2p::protocol::Ping > ping_protocol_
 
std::shared_ptr< network::ProtocolFactoryprotocol_factory_
 
std::shared_ptr< BlockAnnounceProtocolblock_announce_protocol_
 
std::shared_ptr< GrandpaProtocolgrandpa_protocol_
 
std::shared_ptr< PropagateTransactionsProtocolpropagate_transaction_protocol_
 
std::shared_ptr< StateProtocolstate_protocol_
 
std::shared_ptr< SyncProtocolsync_protocol_
 
std::shared_ptr< CollationProtocolcollation_protocol_
 
std::shared_ptr< ReqCollationProtocolreq_collation_protocol_
 

Detailed Description

Definition at line 31 of file router_libp2p.hpp.

Constructor & Destructor Documentation

kagome::network::RouterLibp2p::RouterLibp2p ( std::shared_ptr< application::AppStateManager app_state_manager,
libp2p::Host &  host,
const application::AppConfiguration app_config,
const OwnPeerInfo own_info,
const BootstrapNodes bootstrap_nodes,
std::shared_ptr< libp2p::protocol::Ping >  ping_proto,
std::shared_ptr< network::ProtocolFactory protocol_factory 
)

Definition at line 9 of file router_libp2p.cpp.

kagome::network::RouterLibp2p::~RouterLibp2p ( )
overridedefault

Member Function Documentation

outcome::result< void > kagome::network::RouterLibp2p::appendPeerIdToAddress ( libp2p::multi::Multiaddress &  address) const
private

Appends /p2p/<peerid> part to ip4 and ip6 addresses which then passed to host->listen method. Used further by Kademlia. Non ip4 and ip6 addresses are left untouched

Parameters
addressmultiaddress
Returns
an error if any

Definition at line 196 of file router_libp2p.cpp.

std::shared_ptr< BlockAnnounceProtocol > kagome::network::RouterLibp2p::getBlockAnnounceProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 160 of file router_libp2p.cpp.

std::shared_ptr< CollationProtocol > kagome::network::RouterLibp2p::getCollationProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 164 of file router_libp2p.cpp.

std::shared_ptr< GrandpaProtocol > kagome::network::RouterLibp2p::getGrandpaProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 187 of file router_libp2p.cpp.

std::shared_ptr< libp2p::protocol::Ping > kagome::network::RouterLibp2p::getPingProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 191 of file router_libp2p.cpp.

std::shared_ptr< PropagateTransactionsProtocol > kagome::network::RouterLibp2p::getPropagateTransactionsProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 175 of file router_libp2p.cpp.

std::shared_ptr< ReqCollationProtocol > kagome::network::RouterLibp2p::getReqCollationProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 169 of file router_libp2p.cpp.

std::shared_ptr< StateProtocol > kagome::network::RouterLibp2p::getStateProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 179 of file router_libp2p.cpp.

std::shared_ptr< SyncProtocol > kagome::network::RouterLibp2p::getSyncProtocol ( ) const
overridevirtual

Implements kagome::network::Router.

Definition at line 183 of file router_libp2p.cpp.

bool kagome::network::RouterLibp2p::prepare ( )
See also
AppStateManager::takeControl

Definition at line 44 of file router_libp2p.cpp.

bool kagome::network::RouterLibp2p::start ( )
See also
AppStateManager::takeControl

Definition at line 108 of file router_libp2p.cpp.

void kagome::network::RouterLibp2p::stop ( )
See also
AppStateManager::takeControl

Definition at line 153 of file router_libp2p.cpp.

Member Data Documentation

const application::AppConfiguration& kagome::network::RouterLibp2p::app_config_
private

Definition at line 80 of file router_libp2p.hpp.

std::shared_ptr<application::AppStateManager> kagome::network::RouterLibp2p::app_state_manager_
private

Definition at line 78 of file router_libp2p.hpp.

std::shared_ptr<BlockAnnounceProtocol> kagome::network::RouterLibp2p::block_announce_protocol_
private

Definition at line 86 of file router_libp2p.hpp.

std::shared_ptr<CollationProtocol> kagome::network::RouterLibp2p::collation_protocol_
private

Definition at line 92 of file router_libp2p.hpp.

std::shared_ptr<GrandpaProtocol> kagome::network::RouterLibp2p::grandpa_protocol_
private

Definition at line 87 of file router_libp2p.hpp.

libp2p::Host& kagome::network::RouterLibp2p::host_
private

Definition at line 79 of file router_libp2p.hpp.

log::Logger kagome::network::RouterLibp2p::log_
private

Definition at line 82 of file router_libp2p.hpp.

const OwnPeerInfo& kagome::network::RouterLibp2p::own_info_
private

Definition at line 81 of file router_libp2p.hpp.

std::shared_ptr<libp2p::protocol::Ping> kagome::network::RouterLibp2p::ping_protocol_
private

Definition at line 83 of file router_libp2p.hpp.

std::shared_ptr<PropagateTransactionsProtocol> kagome::network::RouterLibp2p::propagate_transaction_protocol_
private

Definition at line 89 of file router_libp2p.hpp.

std::shared_ptr<network::ProtocolFactory> kagome::network::RouterLibp2p::protocol_factory_
private

Definition at line 84 of file router_libp2p.hpp.

std::shared_ptr<ReqCollationProtocol> kagome::network::RouterLibp2p::req_collation_protocol_
private

Definition at line 93 of file router_libp2p.hpp.

std::shared_ptr<StateProtocol> kagome::network::RouterLibp2p::state_protocol_
private

Definition at line 90 of file router_libp2p.hpp.

std::shared_ptr<SyncProtocol> kagome::network::RouterLibp2p::sync_protocol_
private

Definition at line 91 of file router_libp2p.hpp.


The documentation for this class was generated from the following files: