pub struct NetworkBuilder { /* private fields */ }Expand description
Constructs a NetworkDriver for the OP Stack Consensus Layer.
Implementations§
Source§impl NetworkBuilder
impl NetworkBuilder
Sourcepub const fn new(
rollup_config: RollupConfig,
unsafe_block_signer: Address,
gossip_addr: Multiaddr,
keypair: Keypair,
discovery_address: LocalNode,
discovery_config: Config,
) -> Self
pub const fn new( rollup_config: RollupConfig, unsafe_block_signer: Address, gossip_addr: Multiaddr, keypair: Keypair, discovery_address: LocalNode, discovery_config: Config, ) -> Self
Creates a new NetworkBuilder.
Sourcepub fn with_gater_config(self, config: GaterConfig) -> Self
pub fn with_gater_config(self, config: GaterConfig) -> Self
Sets the configuration for the connection gater.
Sourcepub fn with_signer(self, signer: Option<BlockSigner>) -> Self
pub fn with_signer(self, signer: Option<BlockSigner>) -> Self
Sets the signer for the NetworkBuilder.
Sourcepub fn with_bootstore(self, bootstore: Option<PathBuf>) -> Self
pub fn with_bootstore(self, bootstore: Option<PathBuf>) -> Self
Sets the bootstore path for the Discv5Builder.
Sourcepub fn with_discovery_randomize(self, randomize: Option<Duration>) -> Self
pub fn with_discovery_randomize(self, randomize: Option<Duration>) -> Self
Sets the interval at which to randomize discovery peers.
Sourcepub fn with_bootnodes(self, bootnodes: Vec<Enr>) -> Self
pub fn with_bootnodes(self, bootnodes: Vec<Enr>) -> Self
Sets the initial bootnodes to add to the bootstore.
Sourcepub fn with_peer_scoring(self, level: PeerScoreLevel) -> Self
pub fn with_peer_scoring(self, level: PeerScoreLevel) -> Self
Sets the peer scoring based on the given PeerScoreLevel.
Sourcepub fn with_topic_scoring(self, topic_scoring: bool) -> Self
pub fn with_topic_scoring(self, topic_scoring: bool) -> Self
Sets topic scoring for the GossipDriverBuilder.
Sourcepub fn with_peer_monitoring(
self,
peer_monitoring: Option<PeerMonitoring>,
) -> Self
pub fn with_peer_monitoring( self, peer_monitoring: Option<PeerMonitoring>, ) -> Self
Sets the peer monitoring for the GossipDriverBuilder.
Sourcepub fn with_discovery_interval(self, interval: Duration) -> Self
pub fn with_discovery_interval(self, interval: Duration) -> Self
Sets the discovery interval for the Discv5Builder.
Sourcepub fn with_discovery_address(self, address: LocalNode) -> Self
pub fn with_discovery_address(self, address: LocalNode) -> Self
Sets the address for the Discv5Builder.
Sourcepub fn with_gossip_config(self, config: Config) -> Self
pub fn with_gossip_config(self, config: Config) -> Self
Sets the gossipsub config for the GossipDriverBuilder.
Sourcepub fn with_discovery_config(self, config: Discv5Config) -> Self
pub fn with_discovery_config(self, config: Discv5Config) -> Self
Sets the Discv5Config for the Discv5Builder.
Sourcepub fn with_gossip_address(self, addr: Multiaddr) -> Self
pub fn with_gossip_address(self, addr: Multiaddr) -> Self
Sets the gossip address for the GossipDriverBuilder.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the timeout for the GossipDriverBuilder.
Sourcepub fn build(self) -> Result<NetworkDriver, NetworkBuilderError>
pub fn build(self) -> Result<NetworkDriver, NetworkBuilderError>
Builds the NetworkDriver.
Trait Implementations§
Source§impl Debug for NetworkBuilder
impl Debug for NetworkBuilder
Source§impl From<NetworkConfig> for NetworkBuilder
impl From<NetworkConfig> for NetworkBuilder
Source§fn from(config: NetworkConfig) -> Self
fn from(config: NetworkConfig) -> Self
Auto Trait Implementations§
impl Freeze for NetworkBuilder
impl !RefUnwindSafe for NetworkBuilder
impl Send for NetworkBuilder
impl Sync for NetworkBuilder
impl Unpin for NetworkBuilder
impl !UnwindSafe for NetworkBuilder
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
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>
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>
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