pub trait P2PSubscriptions {
type GossipedTransaction: NetworkData<Transaction>;
// Required methods
fn subscribe_new_peers(&self) -> BoxStream<PeerId>;
fn gossiped_transaction_events(
&self,
) -> BoxStream<Self::GossipedTransaction>;
}
Required Associated Types§
Required Methods§
sourcefn subscribe_new_peers(&self) -> BoxStream<PeerId>
fn subscribe_new_peers(&self) -> BoxStream<PeerId>
Creates a stream that is filled with the peer_id when they subscribe to our transactions gossip.
sourcefn gossiped_transaction_events(&self) -> BoxStream<Self::GossipedTransaction>
fn gossiped_transaction_events(&self) -> BoxStream<Self::GossipedTransaction>
Creates a stream of next transactions gossiped from the network.