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]
pub 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.
pub fn validator_id(&self) -> Option<ValidatorId>
[src]
If the current node is validator returns its identifier.
For other nodes return None
.
pub fn snapshot(&self) -> &Snapshot
[src]
Returns the current database snapshot.
pub fn height(&self) -> Height
[src]
Returns the current blockchain height. This height is "height of the last committed block".
pub fn validators(&self) -> &[ValidatorKeys]
[src]
Returns the current list of validators.
pub fn public_key(&self) -> &PublicKey
[src]
Returns current node's public key.
pub fn secret_key(&self) -> &SecretKey
[src]
Returns current node's secret key.
pub fn actual_consensus_config(&self) -> &ConsensusConfig
[src]
Returns the actual consensus configuration.
pub fn actual_service_config(&self, service: &Service) -> &Value
[src]
Returns service specific global variables as json value.
pub fn transaction_sender(&self) -> &TransactionSend
[src]
Returns reference to the transaction sender.
pub fn stored_configuration(&self) -> &StoredConfiguration
[src]
Returns the actual blockchain global configuration.