[−][src]Struct libp2p::gossipsub::GossipsubConfig
Configuration parameters that define the performance of the gossipsub network.
Fields
protocol_id: Cow<'static, [u8]>
The protocol id to negotiate this protocol (default is /meshsub/1.0.0
).
history_length: usize
Number of heartbeats to keep in the memcache
(default is 5).
history_gossip: usize
Number of past heartbeats to gossip about (default is 3).
mesh_n: usize
Target number of peers for the mesh network (D in the spec, default is 6).
mesh_n_low: usize
Minimum number of peers in mesh network before adding more (D_lo in the spec, default is 4).
mesh_n_high: usize
Maximum number of peers in mesh network before removing some (D_high in the spec, default is 12).
gossip_lazy: usize
Number of peers to emit gossip to during a heartbeat (D_lazy in the spec, default is 6).
heartbeat_initial_delay: Duration
Initial delay in each heartbeat (default is 5 seconds).
heartbeat_interval: Duration
Time between each heartbeat (default is 1 second).
fanout_ttl: Duration
Time to live for fanout peers (default is 60 seconds).
max_transmit_size: usize
The maximum byte size for each gossip (default is 2048 bytes).
hash_topics: bool
Flag determining if gossipsub topics are hashed or sent as plain strings (default is false).
no_source_id: bool
When set, all published messages will have a 0 source PeerId
(default is false).
manual_propagation: bool
When set to true
, prevents automatic forwarding of all received messages. This setting
allows a user to validate the messages before propagating them to their peers. If set to
true, the user must manually call propagate_message()
on the behaviour to forward message
once validated (default is false).
message_id_fn: fn(&GossipsubMessage) -> MessageId
A user-defined function allowing the user to specify the message id of a gossipsub message.
The default value is to concatenate the source peer id with a sequence number. Setting this
parameter allows the user to address packets arbitrarily. One example is content based
addressing, where this function may be set to hash(message)
. This would prevent messages
of the same content from being duplicated.
The function takes a GossipsubMessage
as input and outputs a String to be interpreted as
the message id.
Trait Implementations
impl Clone for GossipsubConfig
[src]
fn clone(&self) -> GossipsubConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GossipsubConfig
[src]
impl Default for GossipsubConfig
[src]
fn default() -> GossipsubConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for GossipsubConfig
impl Send for GossipsubConfig
impl Sync for GossipsubConfig
impl Unpin for GossipsubConfig
impl UnwindSafe for GossipsubConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,