Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
state_protocol.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_NETWORK_STATEPROTOCOL
7
#define KAGOME_NETWORK_STATEPROTOCOL
8
9
#include "
network/protocol_base.hpp
"
10
11
#include <memory>
12
13
#include <libp2p/connection/stream.hpp>
14
#include <libp2p/host/host.hpp>
15
16
#include "
application/chain_spec.hpp
"
17
#include "
log/logger.hpp
"
18
#include "
network/types/state_request.hpp
"
19
#include "
network/types/state_response.hpp
"
20
21
namespace
kagome::network
{
22
23
using
Stream
=
libp2p::connection::Stream
;
24
using
Protocol
=
libp2p::peer::Protocol
;
25
using
PeerId
=
libp2p::peer::PeerId
;
26
using
PeerInfo
=
libp2p::peer::PeerInfo
;
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
kagome::network::ProtocolBase
Definition:
protocol_base.hpp:25
protocol_base.hpp
chain_spec.hpp
state_request.hpp
logger.hpp
kagome::network::PeerInfo
libp2p::peer::PeerInfo PeerInfo
Definition:
protocol_base_impl.hpp:27
kagome::network::Protocol
libp2p::peer::Protocol Protocol
Definition:
protocol_base_impl.hpp:24
kagome::network::PeerId
libp2p::peer::PeerId PeerId
Definition:
protocol_base_impl.hpp:26
kagome::network::StateProtocol
Class for communication via /{chainType}/state/2 according to state protocol specification https://sp...
Definition:
state_protocol.hpp:33
state_response.hpp
kagome::network::Stream
libp2p::connection::Stream Stream
Definition:
protocol_base_impl.hpp:23
kagome::network
Definition:
author_api_impl.hpp:37
kagome::network::StateRequest
Definition:
state_request.hpp:17
kagome::network::StateProtocol::request
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.
core
network
protocols
state_protocol.hpp
Generated by
1.8.11