[−][src]Crate exonum_configuration
This crate implements a configuration service for Exonum blockchain framework.
Upon being plugged in, the service allows to modify Exonum blockchain configuration using proposals and voting for proposal, both of which are implemented as transactions signed by blockchain validators.
The service also provides HTTP API for public queries (get actual/following configuration, etc.) and private queries, intended for use only by validator nodes' maintainers (post configuration propose, post vote for a configuration propose).
See Exonum documentation for more details about the service.
Blockchain configuration
Blockchain configuration corresponds to StoredConfiguration
in the Exonum core library. The logic of the configuration service extensively uses
hashes of configuration, which are calculated as follows:
- Parse a
StoredConfiguration
from JSON string if necessary. - Convert a
StoredConfiguration
into bytes as per itsStorageValue
implementation. - Use
exonum::crypto::hash()
on the obtained bytes.
Examples
extern crate exonum; extern crate exonum_configuration as configuration; use exonum::helpers::fabric::NodeBuilder; fn main() { exonum::helpers::init_logger().unwrap(); NodeBuilder::new() .with_service(Box::new(configuration::ServiceFactory)) .run(); }
Structs
MaybeVote | A functional equivalent to |
Propose | Propose a new configuration. |
ProposeData | Extended information about a proposal used for the storage. |
Schema | Database schema used by the configuration service. |
Service | ConfigurationService config. |
ServiceFactory | A configuration service creator for the |
Vote | Vote for the new configuration. |
VoteAgainst | VoteAgainst for the new configuration. |
Enums
ConfigurationTransactions | Configuration Service transactions. |
ErrorCode | Error codes emitted by |
VotingDecision | A enum used to represent different kinds of vote, |
Constants
SERVICE_ID | Service identifier for the configuration service. |
SERVICE_NAME | Configuration service name. |