Struct exonum::blockchain::ServiceContext
[−]
[src]
pub struct ServiceContext<'a, 'b> { /* fields omitted */ }
The current node state on which the blockchain is running, or in other words execution context.
Methods
impl<'a, 'b> ServiceContext<'a, 'b>
[src]
fn validator_state(&self) -> &Option<ValidatorState>
If the current node is validator returns its state.
For other nodes return None
.
fn snapshot(&self) -> &'b Snapshot
Returns the current database snapshot.
fn height(&self) -> u64
Returns the current blockchain height. This height is 'height of last committed block` + 1.
fn round(&self) -> u32
Returns the current node round.
fn validators(&self) -> &[ValidatorKeys]
Returns the current list of validators.
fn public_key(&self) -> &PublicKey
Returns current node's public key.
fn secret_key(&self) -> &SecretKey
Returns current node's secret key.
fn actual_consensus_config(&self) -> &ConsensusConfig
Returns the actual blockchain global configuration.
fn actual_service_config(&self, service: &Service) -> &Value
Returns service specific global variables as json value.
fn add_transaction(&mut self, tx: Box<Transaction>)
Adds transaction to the queue. After the services handle commit event these transactions will be broadcast by node.