Kagome
Polkadot Runtime Engine in C++17
sync_protocol.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_NETWORK_SYNCPROTOCOL
7 #define KAGOME_NETWORK_SYNCPROTOCOL
8 
10 
11 #include <memory>
12 
13 #include <libp2p/connection/stream.hpp>
14 #include <libp2p/host/host.hpp>
15 
17 #include "log/logger.hpp"
19 
20 namespace kagome::network {
21 
26 
32  class SyncProtocol : public virtual ProtocolBase {
33  public:
40  virtual void request(const PeerId &peer_id,
41  BlocksRequest block_request,
42  std::function<void(outcome::result<BlocksResponse>)>
43  &&response_handler) = 0;
44  };
45 
46 } // namespace kagome::network
47 
48 #endif // KAGOME_NETWORK_SYNCPROTOCOL
Class for communication via /{chainType}/sync/2 according to sync protocol specification https://spec...
libp2p::peer::PeerInfo PeerInfo
libp2p::peer::Protocol Protocol
libp2p::peer::PeerId PeerId
virtual void request(const PeerId &peer_id, BlocksRequest block_request, std::function< void(outcome::result< BlocksResponse >)> &&response_handler)=0
Make async request to peer and return response in callback.
libp2p::connection::Stream Stream