Trait sc_network_gossip::ValidatorContext [−][src]
pub trait ValidatorContext<B: BlockT> { fn broadcast_topic(&mut self, topic: B::Hash, force: bool); fn broadcast_message(
&mut self,
topic: B::Hash,
message: Vec<u8>,
force: bool
); fn send_message(&mut self, who: &PeerId, message: Vec<u8>); fn send_topic(&mut self, who: &PeerId, topic: B::Hash, force: bool); }
Expand description
Validation context. Allows reacting to incoming messages by sending out further messages.
Required methods
fn broadcast_topic(&mut self, topic: B::Hash, force: bool)
fn broadcast_topic(&mut self, topic: B::Hash, force: bool)
Broadcast all messages with given topic to peers that do not have it yet.
Broadcast a message to all peers that have not received it previously.
fn send_message(&mut self, who: &PeerId, message: Vec<u8>)
fn send_message(&mut self, who: &PeerId, message: Vec<u8>)
Send addressed message to a peer.
fn send_topic(&mut self, who: &PeerId, topic: B::Hash, force: bool)
fn send_topic(&mut self, who: &PeerId, topic: B::Hash, force: bool)
Send all messages with given topic to a peer.