Crate exonum_configuration [] [src]

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:

  1. Parse a StoredConfiguration from JSON string if necessary.
  2. Convert a StoredConfiguration into bytes as per its StorageValue implementation.
  3. 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 Option<Vote> used to store votes in the service schema.

Propose

Propose a new configuration.

ProposeData

Extended information about a proposal used for the storage.

Schema

Database schema used by the configuration service.

Service

Configuration service.

ServiceFactory

A configuration service creator for the NodeBuilder.

Vote

Vote for the new configuration.

Enums

ErrorCode

Error codes emitted by Propose and/or Vote transactions during execution.

Constants

SERVICE_ID

Service identifier for the configuration service.