Trait sc_network_gossip::ValidatorContext
source · pub trait ValidatorContext<B: BlockT> {
// Required methods
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§
sourcefn 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.
sourcefn broadcast_message(&mut self, topic: B::Hash, message: Vec<u8>, force: bool)
fn broadcast_message(&mut self, topic: B::Hash, message: Vec<u8>, force: bool)
Broadcast a message to all peers that have not received it previously.
sourcefn 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.
sourcefn 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.