Struct exonum::node::NodeHandler [] [src]

pub struct NodeHandler {
    pub state: State,
    pub api_state: SharedNodeState,
    pub system_state: Box<SystemStateProvider>,
    pub channel: NodeSender,
    pub blockchain: Blockchain,
    pub peer_discovery: Vec<SocketAddr>,
    // some fields omitted
}

Handler that that performs consensus algorithm.

Fields

State of the NodeHandler.

Shared api state.

System state.

Channel for messages and timeouts.

Blockchain.

Known peer addresses.

Methods

impl NodeHandler
[src]

[src]

Redirects message to the corresponding handle_... function.

[src]

Handles the Connected event. Node's Connect message is sent as response if received Connect message is correct.

[src]

Handles the Disconnected event. Node will try to connect to that address again if it was in the validators list.

[src]

Handles the UnableConnectToPeer event. Node will try to connect to that address again if it was in the validators list.

[src]

Handles the Connect message and connects to a peer as result.

[src]

Handles the Status message. Node sends BlockRequest as response if height in the message is higher than node's height.

[src]

Handles the PeersRequest message. Node sends Connect messages of other peers as result.

[src]

Handles NodeTimeout::Status, broadcasts the Status message if it isn't outdated as result.

[src]

Handles NodeTimeout::PeerExchange. Node sends the PeersRequest to a random peer.

[src]

Handles NodeTimeout::UpdateApiState. Node update internal ApiState.

[src]

Broadcasts the Status message to all peers.

impl NodeHandler
[src]

[src]

Validates consensus message, then redirects it to the corresponding handle_... function.

[src]

Handles the Propose message. For details see the message documentation.

[src]

Handles the Block message. For details see the message documentation.

[src]

Executes and commits block. This function is called when node has full propose information.

[src]

Handles the Prevote message. For details see the message documentation.

[src]

Locks to the propose by calling lock. This function is called when node receives +2/3 pre-votes.

[src]

Executes and commits block. This function is called when the node has +2/3 pre-commits.

[src]

Locks node to the specified round, so pre-votes for the lower round will be ignored.

[src]

Handles the Precommit message. For details see the message documentation.

[src]

Commits block, so new height is achieved.

[src]

Handles raw transaction. Transaction is ignored if it is already known, otherwise it is added to the transactions pool.

[src]

Handles external boxed transaction. Additionally transaction will be broadcast to the Node's peers.

[src]

Handle new round, after jump.

[src]

Handles round timeout. As result node sends Propose if it is a leader or Prevote if it is locked to some round.

[src]

Handles propose timeout. Node sends Propose and Prevote if it is a leader as result.

[src]

Handles request timeout by sending the corresponding request message to a peer.

[src]

Creates block with given transaction and returns its hash and corresponding changes.

[src]

Calls create_block with transactions from the corresponding Propose and returns the block hash.

[src]

Returns true if propose and all transactions are known, otherwise requests needed data and returns false.

[src]

Requests a block for the next height from all peers with a bigger height. Called when the node tries to catch up with other nodes' height.

[src]

Removes the specified request from the pending request list.

[src]

Broadcasts the Prevote message to all peers.

[src]

Broadcasts the Precommit message to all peers.

impl NodeHandler
[src]

[src]

Validates request, then redirects it to the corresponding handle_... function.

[src]

Handles ProposeRequest message. For details see the message documentation.

[src]

Handles TransactionsRequest message. For details see the message documentation.

[src]

Handles PrevotesRequest message. For details see the message documentation.

[src]

Handles BlockRequest message. For details see the message documentation.

impl NodeHandler
[src]

[src]

Creates NodeHandler using specified Configuration.

[src]

Return internal SharedNodeState

[src]

Returns value of the round_timeout field from the current ConsensusConfig.

[src]

Returns value of the status_timeout field from the current ConsensusConfig.

[src]

Returns value of the peers_timeout field from the current ConsensusConfig.

[src]

Returns value of the txs_block_limit field from the current ConsensusConfig.

[src]

Returns State of the node.

[src]

Performs node initialization, so it starts consensus process from the first round.

[src]

Sends the given message to a peer by its id.

[src]

Sends the given message to a peer by its public key.

[src]

Sends RawMessage to the specified address.

[src]

Broadcasts given message to all peers.

[src]

Performs connection to the specified network address.

[src]

Add timeout request.

[src]

Adds request timeout if it isn't already requested.

[src]

Adds NodeTimeout::Round timeout to the channel.

[src]

Adds NodeTimeout::Propose timeout to the channel.

[src]

Adds NodeTimeout::Status timeout to the channel.

[src]

Adds NodeTimeout::Request timeout with RequestData to the channel.

[src]

Adds NodeTimeout::PeerExchange timeout to the channel.

[src]

Adds NodeTimeout::UpdateApiState timeout to the channel.

[src]

Returns hash of the last block.

[src]

Returns start time of the requested round.

Trait Implementations

impl Debug for NodeHandler
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for NodeHandler

impl !Sync for NodeHandler