Struct exonum::node::state::State [] [src]

pub struct State { /* fields omitted */ }

State of the NodeHandler.

Methods

impl State
[src]

[src]

Creates state with the given parameters.

[src]

Returns ValidatorState if the node is validator.

[src]

Returns validator id of the node if it is a validator. Returns None otherwise.

[src]

Updates the validator id. If there hasn't been ValidatorState for that id, then a new state will be created.

[src]

Checks if the node is a validator.

[src]

Checks if the node is a leader for the current height and round.

[src]

Returns node's whitelist.

Important traits for &'a mut [u8]
[src]

Returns public (consensus and service) keys of known validators.

[src]

Returns StoredConfiguration.

[src]

Returns validator id with a specified public key.

[src]

Returns ConsensusConfig.

[src]

Returns BTreeMap with service configs identified by name.

[src]

Replaces StoredConfiguration with a new one and updates validator id of the current node if the new config is different from the previous one.

[src]

Adjusts propose timeout (see TimeoutAdjuster for the details).

[src]

Returns adjusted (see TimeoutAdjuster for the details) value of the propose timeout.

[src]

Adds the public key, address, and Connect message of a validator.

[src]

Removes a peer by the socket address.

[src]

Returns the keys of known peers with their Connect messages.

[src]

Returns public key of a validator identified by id.

[src]

Returns the consensus public key of the current node.

[src]

Returns the consensus secret key of the current node.

[src]

Returns the service public key of the current node.

[src]

Returns the service secret key of the current node.

[src]

Returns the leader id for the specified round and current height.

[src]

Updates known round for a validator and returns a new actual round if at least one non byzantine validators are on a higher round. Otherwise returns None.

[src]

Returns the height for a validator identified by the public key.

[src]

Updates known height for a validator identified by the public key.

Important traits for Vec<u8>
[src]

Returns a list of nodes whose height is bigger than one of the current node.

[src]

Returns sufficient number of votes for current validators number.

[src]

Returns sufficient number of votes for the given validators number.

[src]

Returns current height.

[src]

Returns start time of the current height.

[src]

Returns the current round.

[src]

Returns a hash of the last block.

[src]

Locks the node to the specified round and propose hash.

Panics

Panics if the current "locked round" is bigger or equal to the new one.

[src]

Returns locked round number. Zero means that the node is not locked to any round.

[src]

Returns propose hash on which the node makes lock.

[src]

Returns mutable propose state identified by hash.

[src]

Returns propose state identified by hash.

[src]

Returns a block with the specified hash.

[src]

Updates mode's round.

[src]

Increments node's round by one.

[src]

Increments the node height by one and resets previous height data.

Important traits for Vec<u8>
[src]

Returns a list of queued consensus messages.

[src]

Add consensus message to the queue.

[src]

Returns non-committed transactions.

Important traits for Vec<u8>
[src]

Adds a transaction to the pool and returns list of proposes that don't contain unknown transactions now.

Transaction is ignored if the following criteria are fulfilled:

  • transactions pool size is exceeded
  • transaction isn't contained in unknown transaction list of any propose
  • transaction isn't a part of block

Important traits for &'a mut [u8]
[src]

Returns pre-votes for the specified round and propose hash.

Important traits for &'a mut [u8]
[src]

Returns pre-commits for the specified round and propose hash.

[src]

Returns true if this node has pre-vote for the specified round.

Panics

Panics if this method is called for a non-validator node.

[src]

Adds propose from this node to the proposes list for the current height. Such propose cannot contain unknown transactions. Returns hash of the propose.

[src]

Adds propose from other node. Returns ProposeState if it is a new propose.

[src]

Adds block to the list of blocks for the current height. Returns BlockState if it is a new block.

[src]

Adds pre-vote. Returns true there are +2/3 pre-votes.

Panics

A node panics if it has already sent a different Prevote for the same round.

[src]

Returns true if there are +2/3 pre-votes for the specified round and hash.

[src]

Returns ids of validators that that sent pre-votes for the specified propose.

[src]

Returns ids of validators that that sent pre-commits for the specified propose.

[src]

Adds pre-commit. Returns true there are +2/3 pre-commits.

Panics

A node panics if it has already sent a different Precommit for the same round.

[src]

Adds unknown (for this node) propose.

Important traits for Vec<u8>
[src]

Removes propose from the list of unknown proposes and returns its round and hash.

[src]

Returns true if the node has +2/3 pre-commits for the specified round and block hash.

[src]

Returns true if the node doesn't have proposes different from the locked one.

[src]

Adds data-request to the queue. Returns true if it is a new request.

[src]

Returns public key of a peer that has required information. Returned key is removed from the corresponding validators list, so next time request will be sent to a different peer.

[src]

Removes the specified request from the pending request list.

[src]

Returns the Connect message of the current node.

[src]

Updates the Connect message of the current node.

Trait Implementations

impl Debug for State
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for State

impl !Sync for State