[][src]Module exonum::blockchain

The module containing building blocks for creating blockchains powered by the Exonum framework.

Services are the main extension point for the Exonum framework. To create your service on top of Exonum blockchain you need to perform the following steps:

  • Define your own information schema.
  • Create one or more transaction types using the TransactionSet auto derive macro from exonum_derive and implement the Transaction trait for them.
  • Create a data structure implementing the Service trait.
  • Write API handlers for the service, if required.

You may consult the service creation tutorial for a detailed instruction on how to create services.

Re-exports

pub use self::config::ConsensusConfig;
pub use self::config::StoredConfiguration;
pub use self::config::ValidatorKeys;

Modules

config

Exonum global variables which are stored in the blockchain as UTF-8 encoded JSON.

Structs

Block

Exonum block header data structure.

BlockProof

Block with its Precommit messages.

Blockchain

Exonum blockchain instance with a certain services set and data storage.

ExecutionError

Result of unsuccessful transaction execution.

GenesisConfig

The initial configuration which is committed into the genesis block.

Schema

Information schema for indices maintained by the Exonum core logic.

ServiceContext

The current node state on which the blockchain is running, or in other words execution context. This structure is passed to the after_commit method of the Service trait and is used for the interaction between service business logic and the current node state.

SharedNodeState

Shared part of the context, used to take some values from the Node State. As there is no way to directly access the node state, this entity is regularly updated with information about the node and transfers this information to API.

TransactionContext

Wrapper around database and tx hash.

TransactionError

Result of unsuccessful transaction execution encompassing both service and framework-wide error handling. This error indicates whether a panic or a user error has occurred.

TransactionMessage

Data transfer object for transaction. This structure is used to send api info about transaction, and take some new transaction into pool from user input.

TransactionResult

Extended version of ExecutionResult (with additional values set exclusively by Exonum framework) that can be obtained through Schema::transaction_results method.

TxLocation

Transaction location in a block. The given entity defines the block where the transaction was included and the position of this transaction in that block.

Enums

TransactionErrorType

Type of transaction error.

Constants

CORE_SERVICE

Id of core service table family.

Traits

Service

A trait that describes the business logic of a certain service.

Transaction

Transaction processing functionality for Signeds allowing to apply authenticated, atomic, constraint-preserving groups of changes to the blockchain storage.

TransactionSet

TransactionSet trait describes a type which is an enum of several transactions. The implementation of this trait is generated automatically by the #[derive(TransactionSet)] attribute. This attribute is used on the enum which has transactions as its variants.

Type Definitions

ExecutionResult

Returns a result of the Transaction execute method. This result may be either an empty unit type, in case of success, or an ExecutionError, if execution has failed. Errors consist of an error code and an optional description.