[][src]Enum networking::NetworkRequest

pub enum NetworkRequest {
    Peers,
    BlocksByHash(HashSet<u256>),
    TransactionsByHash(HashSet<u256>),
    Headers {
        last_known_headers: Vec<u256>,
        max_responses: Option<usize>,
    },
    PushTransaction(Transaction),
    AdvertiseTransactions(HashSet<u256>),
    AdvertiseBlock(HashSet<u256>),
    Mempool,
}

NetworkRequest provides the inbound interface to the high level 'the rest of the network' abstraction.

Variants

Peers

Requests peer information

BlocksByHash(HashSet<u256>)

Requests all blocks with provided hashes

TransactionsByHash(HashSet<u256>)

Requests all transactions with provided hashes

Headers

Requests headers starting with the first header in the vec. If max_responses is not provided, the Service will attempt to return every header up to the current tip.

last_known_headers should be ordered from newest to oldest (i.e. from now toward Genesis block) if it contains more than one item

Fields of Headers

last_known_headers: Vec<u256>max_responses: Option<usize>
PushTransaction(Transaction)

Pushes a transaction to the network using unsolicited Tx Message

AdvertiseTransactions(HashSet<u256>)

Advertises to peers that each transaction is available using an inv message containing the Tx Hash.

AdvertiseBlock(HashSet<u256>)

Advertises to peers that a block is available using an inv message containing its hash

Mempool

Request a peer's view of the mempool. By default, the Service should aggregate responses from a small subset of peers.

Auto Trait Implementations

impl RefUnwindSafe for NetworkRequest

impl Send for NetworkRequest

impl Sync for NetworkRequest

impl Unpin for NetworkRequest

impl UnwindSafe for NetworkRequest

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> Instrument for T[src]

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

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.