6 #ifndef KAGOME_NETWORK_PROPAGATETRANSACTIONSPROTOCOL 7 #define KAGOME_NETWORK_PROPAGATETRANSACTIONSPROTOCOL 13 #include <libp2p/connection/stream.hpp> 14 #include <libp2p/host/host.hpp> 39 public std::enable_shared_from_this<PropagateTransactionsProtocol>,
50 std::shared_ptr<consensus::babe::Babe> babe,
51 std::shared_ptr<ExtrinsicObserver> extrinsic_observer,
52 std::shared_ptr<StreamEngine> stream_engine,
53 std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine>
54 extrinsic_events_engine,
55 std::shared_ptr<subscription::ExtrinsicEventKeyRepository>
58 bool start()
override;
68 std::function<
void(outcome::result<std::shared_ptr<Stream>>)> &&cb)
77 std::function<
void(outcome::result<void>)> &&cb);
81 std::function<
void(outcome::result<void>)> &&cb);
86 "PropagateTransactionsProtocol"s;
89 std::shared_ptr<consensus::babe::Babe>
babe_;
92 std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine>
94 std::shared_ptr<subscription::ExtrinsicEventKeyRepository>
104 #endif // KAGOME_NETWORK_PROPAGATETRANSACTIONSPROTOCOL static const auto kPropogateTransacionsProtocolName
void readPropagatedExtrinsics(std::shared_ptr< Stream > stream)
KAGOME_DECLARE_CACHE(BlockAnnounceProtocol, KAGOME_CACHE_UNIT(BlockAnnounce))
void readHandshake(std::shared_ptr< Stream > stream, Direction direction, std::function< void(outcome::result< void >)> &&cb)
metrics::RegistryPtr metrics_registry_
std::shared_ptr< consensus::babe::Babe > babe_
#define KAGOME_CACHE_UNIT(type)
void writeHandshake(std::shared_ptr< Stream > stream, Direction direction, std::function< void(outcome::result< void >)> &&cb)
std::unique_ptr< Registry > RegistryPtr
RegistryPtr createRegistry()
~PropagateTransactionsProtocol() override=default
std::shared_ptr< subscription::ExtrinsicEventKeyRepository > ext_event_key_repo_
libp2p::peer::PeerInfo PeerInfo
std::shared_ptr< StreamEngine > stream_engine_
std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > extrinsic_events_engine_
void newOutgoingStream(const PeerInfo &peer_info, std::function< void(outcome::result< std::shared_ptr< Stream >>)> &&cb) override
void onIncomingStream(std::shared_ptr< Stream > stream) override
const std::string & protocolName() const override
void propagateTransactions(gsl::span< const primitives::Transaction > txs)
std::shared_ptr< ExtrinsicObserver > extrinsic_observer_
const application::AppConfiguration & app_config_
PropagateTransactionsProtocol()=delete
A counter metric to represent a monotonically increasing value.
metrics::Counter * metric_propagated_tx_counter_