pub struct P2PConfig<Z: NetworkZone> {
pub network: Network,
pub seeds: Vec<Z::Addr>,
pub offline: bool,
pub outbound_connections: usize,
pub extra_outbound_connections: usize,
pub max_inbound_connections: usize,
pub gray_peers_percent: f64,
pub p2p_port: u16,
pub rpc_port: u16,
pub address_book_config: AddressBookConfig<Z>,
}Expand description
P2P config.
Fields§
§network: NetworkThe Network we should connect to.
seeds: Vec<Z::Addr>Seed nodes to connect to find peers if our address book is empty.
offline: boolWhether to run in offline mode.
outbound_connections: usizeThe number of outbound connections to make and try keep.
extra_outbound_connections: usizeThe amount of extra connections we can make if we are under load from the rest of Cuprate.
max_inbound_connections: usizeThe maximum amount of inbound connections.
gray_peers_percent: f64The percent of outbound peers that should be gray aka never connected to before.
Only values 0..=1 are valid.
p2p_port: u16The port to listen on for inbound connections.
rpc_port: u16The public RPC port to tell peers about so wallets can use our node. 0 if we do not have a public RPC port.
address_book_config: AddressBookConfig<Z>The AddressBookConfig.
Trait Implementations§
Auto Trait Implementations§
impl<Z> Freeze for P2PConfig<Z>
impl<Z> RefUnwindSafe for P2PConfig<Z>
impl<Z> Send for P2PConfig<Z>
impl<Z> Sync for P2PConfig<Z>
impl<Z> Unpin for P2PConfig<Z>
impl<Z> UnsafeUnpin for P2PConfig<Z>
impl<Z> UnwindSafe for P2PConfig<Z>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.