6 #ifndef KAGOME_NETWORK_SYNCHRONIZER 7 #define KAGOME_NETWORK_SYNCHRONIZER 9 #include <libp2p/peer/peer_id.hpp> 21 std::function<void(outcome::result<primitives::BlockInfo>)>;
33 bool subscribe_to_block) = 0;
50 std::optional<uint32_t> limit,
62 #endif // KAGOME_NETWORK_SYNCHRONIZER
virtual ~Synchronizer()=default
virtual void syncState(const libp2p::peer::PeerId &peer_id, const primitives::BlockInfo &block, SyncResultHandler &&handler)=0
virtual void syncMissingJustifications(const libp2p::peer::PeerId &peer_id, primitives::BlockInfo target_block, std::optional< uint32_t > limit, SyncResultHandler &&handler)=0
libp2p::peer::PeerId PeerId
std::function< void(outcome::result< primitives::BlockInfo >)> SyncResultHandler
virtual bool syncByBlockHeader(const primitives::BlockHeader &header, const libp2p::peer::PeerId &peer_id, SyncResultHandler &&handler)=0
virtual bool hasIncompleteRequestOfStateSync() const =0
virtual bool syncByBlockInfo(const primitives::BlockInfo &block_info, const libp2p::peer::PeerId &peer_id, SyncResultHandler &&handler, bool subscribe_to_block)=0