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