Crate exonum_build

Source
Expand description

This crate simplifies writing build scripts (build.rs) for Exonum and Exonum services.

Since Protobuf is the Exonum default serialization format, build.rs is mostly used to compile Protobuf files and generate a corresponding code. This code is used later by the Exonum core and services.

In order to use the crate, call ProtobufGenerator with the required params. See ProtobufGenerator docs for an example.

§File Sets

There are several predefined sets of Protobuf sources available for use, split according to the crate the sources are defined in. These sets are described by ProtoSources:

  • Crypto sources: cryptographic types used in services and the code.
  • Common sources: types that can be used by various parts of Exonum.
  • MerkleDB sources: types representing proofs of existence of element in database.
  • Core sources: types used in core and in system services such as supervisor.
File pathSetDescription
exonum/crypto/types.protoCryptoBasic types: Hash, PublicKey and Signature
exonum/common/bit_vec.protoCommonProtobuf mapping for BitVec
exonum/proof/list_proof.protoMerkleDBListProof and related helpers
exonum/proof/map_proof.protoMerkleDBMapProof and related helpers
exonum/blockchain.protoCoreBasic core types (e.g., Block)
exonum/key_value_sequence.protoCoreKey-value sequence used to store additional headers in Block
exonum/messages.protoCoreBase types for Ed25519-authenticated messages
exonum/proofs.protoCoreBlock and index proofs
exonum/runtime/auth.protoCoreAuthorization-related types
exonum/runtime/base.protoCoreBasic runtime types (e.g., artifact ID)
exonum/runtime/errors.protoCoreExecution errors
exonum/runtime/lifecycle.protoCoreAdvanced types used in service lifecycle

Each file is placed in the Protobuf package matching its path, similar to well-known Protobuf types. For example, exonum/runtime/auth.proto types are in the exonum.runtime package.

Structs§

Enums§

  • Enum representing various sources of Protobuf files.