pub struct Litep2pNetworkSink { /* private fields */ }Expand description
NetworkSink backed by litep2p, for use by the consensus engine. Also provides methods for peer management and sync.
Implementations§
Source§impl Litep2pNetworkSink
impl Litep2pNetworkSink
pub fn add_peer(&self, vid: ValidatorId, pid: PeerId, addrs: Vec<Multiaddr>)
pub fn remove_peer(&self, vid: ValidatorId)
pub fn send_sync_request(&self, peer_id: PeerId, request: &SyncRequest)
pub fn send_sync_response(&self, request_id: RequestId, response: &SyncResponse)
Sourcepub fn broadcast_tx(&self, tx_bytes: Vec<u8>)
pub fn broadcast_tx(&self, tx_bytes: Vec<u8>)
Broadcast a raw transaction to all connected peers via the mempool gossip protocol.
Trait Implementations§
Source§impl Clone for Litep2pNetworkSink
impl Clone for Litep2pNetworkSink
Source§fn clone(&self) -> Litep2pNetworkSink
fn clone(&self) -> Litep2pNetworkSink
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl NetworkSink for Litep2pNetworkSink
impl NetworkSink for Litep2pNetworkSink
fn broadcast(&self, msg: ConsensusMessage)
fn send_to(&self, target: ValidatorId, msg: ConsensusMessage)
Source§fn on_epoch_change(&self, epoch: EpochNumber, new_validator_set: &ValidatorSet)
fn on_epoch_change(&self, epoch: EpochNumber, new_validator_set: &ValidatorSet)
Notify the network layer of a validator set change (epoch transition).
Default is no-op for test stubs.
Source§fn broadcast_evidence(&self, proof: &EquivocationProof)
fn broadcast_evidence(&self, proof: &EquivocationProof)
Broadcast equivocation evidence to all peers.
Default is no-op for test stubs.
Auto Trait Implementations§
impl Freeze for Litep2pNetworkSink
impl !RefUnwindSafe for Litep2pNetworkSink
impl Send for Litep2pNetworkSink
impl Sync for Litep2pNetworkSink
impl Unpin for Litep2pNetworkSink
impl UnsafeUnpin for Litep2pNetworkSink
impl !UnwindSafe for Litep2pNetworkSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more