Struct exonum::blockchain::ServiceContext
[−]
[src]
pub struct ServiceContext { /* fields omitted */ }
The current node state on which the blockchain is running, or in other words execution context.
Methods
impl ServiceContext
[src]
fn new(
service_public_key: PublicKey,
service_secret_key: SecretKey,
api_sender: ApiSender,
fork: Fork
) -> ServiceContext
[src]
service_public_key: PublicKey,
service_secret_key: SecretKey,
api_sender: ApiSender,
fork: Fork
) -> ServiceContext
Creates the service context for the given node.
This method is necessary if you want to implement an alternative exonum node. For example, you can implement special node without consensus for regression testing of services business logic.
fn validator_id(&self) -> Option<ValidatorId>
[src]
If the current node is validator returns its identifier.
For other nodes return None
.
fn snapshot(&self) -> &Snapshot
[src]
Returns the current database snapshot.
fn height(&self) -> Height
[src]
Returns the current blockchain height. This height is "height of the last committed block".
fn validators(&self) -> &[ValidatorKeys]
[src]
Returns the current list of validators.
fn public_key(&self) -> &PublicKey
[src]
Returns current node's public key.
fn secret_key(&self) -> &SecretKey
[src]
Returns current node's secret key.
fn actual_consensus_config(&self) -> &ConsensusConfig
[src]
Returns the actual consensus configuration.
fn actual_service_config(&self, service: &Service) -> &Value
[src]
Returns service specific global variables as json value.
fn transaction_sender(&self) -> &TransactionSend
[src]
Returns reference to the transaction sender.
fn stored_configuration(&self) -> &StoredConfiguration
[src]
Returns the actual blockchain global configuration.