pub struct NetworkConfig {Show 16 fields
pub discovery_config: Config,
pub discovery_address: LocalNode,
pub discovery_interval: Duration,
pub discovery_randomize: Option<Duration>,
pub gossip_address: Multiaddr,
pub unsafe_block_signer: Address,
pub keypair: Keypair,
pub gossip_config: Config,
pub scoring: PeerScoreLevel,
pub topic_scoring: bool,
pub monitor_peers: Option<PeerMonitoring>,
pub bootstore: Option<PathBuf>,
pub gater_config: GaterConfig,
pub bootnodes: Vec<Enr>,
pub rollup_config: RollupConfig,
pub gossip_signer: Option<BlockSigner>,
}Expand description
Configuration for kona’s P2P stack.
Fields§
§discovery_config: ConfigDiscovery Config.
discovery_address: LocalNodeThe local node’s advertised address to external peers. Note: This may be different from the node’s discovery listen address.
discovery_interval: DurationThe interval to find peers.
discovery_randomize: Option<Duration>The interval to remove peers from the discovery service.
gossip_address: MultiaddrThe gossip address.
unsafe_block_signer: AddressThe unsafe block signer.
keypair: KeypairThe keypair.
gossip_config: ConfigThe gossip config.
scoring: PeerScoreLevelThe peer score level.
topic_scoring: boolWhether to enable topic scoring.
monitor_peers: Option<PeerMonitoring>Peer score monitoring config.
bootstore: Option<PathBuf>An optional path to the bootstore.
gater_config: GaterConfigThe configuration for the connection gater.
bootnodes: Vec<Enr>An optional list of bootnode ENRs to start the node with.
rollup_config: RollupConfigThe RollupConfig.
gossip_signer: Option<BlockSigner>A signer for gossip payloads.
Implementations§
Source§impl NetworkConfig
impl NetworkConfig
Sourcepub fn new(
rollup_config: RollupConfig,
discovery_listen: LocalNode,
gossip_address: Multiaddr,
unsafe_block_signer: Address,
) -> Self
pub fn new( rollup_config: RollupConfig, discovery_listen: LocalNode, gossip_address: Multiaddr, unsafe_block_signer: Address, ) -> Self
Creates a new NetworkConfig with the given RollupConfig with the minimum required
fields. Generates a random keypair for the node.
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
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 Debug for NetworkConfig
impl Debug for NetworkConfig
Source§impl From<NetworkConfig> for NetworkBuilder
impl From<NetworkConfig> for NetworkBuilder
Source§fn from(config: NetworkConfig) -> Self
fn from(config: NetworkConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl !RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl !UnwindSafe for NetworkConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more