6 #ifndef KAGOME_NETWORK_PROTOCOLBASE 7 #define KAGOME_NETWORK_PROTOCOLBASE 11 #include <libp2p/connection/stream.hpp> 12 #include <libp2p/peer/peer_info.hpp> 13 #include <libp2p/peer/stream_protocols.hpp> 21 using Protocols = libp2p::StreamProtocols;
34 virtual const std::string &protocolName()
const = 0;
36 virtual bool start() = 0;
37 virtual bool stop() = 0;
39 virtual void onIncomingStream(std::shared_ptr<Stream> stream) = 0;
40 virtual void newOutgoingStream(
42 std::function<
void(outcome::result<std::shared_ptr<Stream>>)> &&cb) = 0;
47 #endif // KAGOME_NETWORK_PEERING_CONFIG
libp2p::peer::PeerInfo PeerInfo
libp2p::peer::Protocol Protocol
libp2p::StreamProtocols Protocols
libp2p::peer::PeerId PeerId
libp2p::connection::Stream Stream