[][src]Struct snarkos_network::context::context::Context

pub struct Context {
    pub local_address: RwLock<SocketAddr>,
    pub memory_pool_interval: u8,
    pub min_peers: u16,
    pub max_peers: u16,
    pub is_bootnode: bool,
    pub bootnodes: Vec<String>,
    pub peer_book: RwLock<PeerBook>,
    pub handshakes: RwLock<Handshakes>,
    pub connections: RwLock<Connections>,
    pub pings: RwLock<Pings>,
}

The network context for this node. All variables are public to allow server components to acquire read/write access.

Fields

local_address: RwLock<SocketAddr>

The ip address/socket of this node.

memory_pool_interval: u8

Frequency the server requests memory pool transactions.

min_peers: u16

Mininmum number of peers to connect to

max_peers: u16

Maximum number of peers to connect to

is_bootnode: bool

If enabled, node will not connect to bootnodes on startup.

bootnodes: Vec<String>

Hardcoded nodes and user-specified nodes this node should connect to on startup.

peer_book: RwLock<PeerBook>

Manages connected, gossiped, and disconnected peers

handshakes: RwLock<Handshakes>

Handshakes to make connected peers

connections: RwLock<Connections>

Connected peer channels for reading/writing messages

pings: RwLock<Pings>

Ping/pongs with connected peers

Implementations

impl Context[src]

pub fn new(
    local_address: SocketAddr,
    memory_pool_interval: u8,
    min_peers: u16,
    max_peers: u16,
    is_bootnode: bool,
    bootnodes: Vec<String>
) -> Self
[src]

Construct a new network Context.

Auto Trait Implementations

impl !RefUnwindSafe for Context

impl Send for Context

impl Sync for Context

impl Unpin for Context

impl !UnwindSafe for Context

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,