Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
sync_protocol.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_NETWORK_SYNCPROTOCOL
7
#define KAGOME_NETWORK_SYNCPROTOCOL
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/sync_protocol_observer.hpp
"
19
20
namespace
kagome::network
{
21
22
using
Stream
=
libp2p::connection::Stream
;
23
using
Protocol
=
libp2p::peer::Protocol
;
24
using
PeerId
=
libp2p::peer::PeerId
;
25
using
PeerInfo
=
libp2p::peer::PeerInfo
;
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
sync_protocol_observer.hpp
kagome::network::ProtocolBase
Definition:
protocol_base.hpp:25
protocol_base.hpp
chain_spec.hpp
kagome::network::SyncProtocol
Class for communication via /{chainType}/sync/2 according to sync protocol specification https://spec...
Definition:
sync_protocol.hpp:32
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::SyncProtocol::request
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.
kagome::network::Stream
libp2p::connection::Stream Stream
Definition:
protocol_base_impl.hpp:23
kagome::network::BlocksRequest
Definition:
blocks_request.hpp:23
kagome::network
Definition:
author_api_impl.hpp:37
core
network
protocols
sync_protocol.hpp
Generated by
1.8.11