mithril_aggregator/
lib.rs

1#![warn(missing_docs)]
2//! Mithril aggregator
3//! The Aggregator is responsible for:
4//! * registering signers
5//! * producing aggregate multi-signatures
6//! * creating, storing & serving the certificate chain
7//! * creating, storing & serving certified snapshots
8//!
9//! This crate is divided in two parts: a HTTP server that exposes an API to
10//! communicate with signers and a Runtime that tracks the blockchain to provide
11//! signed certificates.
12//! You can find more information on how it works reading the [documentation website](https://mithril.network/doc/mithril/mithril-network/aggregator).
13
14mod artifact_builder;
15mod commands;
16mod configuration;
17pub mod database;
18pub mod dependency_injection;
19pub mod entities;
20pub mod event_store;
21mod file_uploaders;
22mod http_server;
23mod immutable_file_digest_mapper;
24mod message_adapters;
25pub mod metrics;
26mod multi_signer;
27mod runtime;
28pub mod services;
29mod store;
30#[doc(hidden)]
31pub mod test;
32mod tools;
33
34pub use crate::artifact_builder::ArtifactBuilder;
35pub use crate::configuration::{
36    ConfigurationSource, DefaultConfiguration, ExecutionEnvironment, ServeCommandConfiguration,
37    SnapshotUploaderType, ZstandardCompressionParameters,
38};
39pub use crate::multi_signer::{MultiSigner, MultiSignerImpl};
40pub use commands::{CommandType, MainOpts};
41pub use dependency_injection::ServeCommandDependenciesContainer;
42pub use file_uploaders::{DumbUploader, FileUploader};
43pub use message_adapters::FromRegisterSignerAdapter;
44pub use metrics::*;
45pub use runtime::{
46    AggregatorConfig, AggregatorRunner, AggregatorRunnerTrait, AggregatorRuntime, RuntimeError,
47};
48pub use services::{
49    MithrilSignerRegistrationFollower, MithrilSignerRegistrationLeader,
50    MithrilSignerRegistrationVerifier, SignerRecorder, SignerRegisterer, SignerRegistrationError,
51    SignerRegistrationRound, SignerRegistrationRoundOpener, SignerRegistrationVerifier,
52    SignerSynchronizer,
53};
54pub use store::{EpochSettingsStorer, ProtocolParametersRetriever, VerificationKeyStorer};
55pub use tools::{
56    CExplorerSignerRetriever, SignersImporter, SignersImporterPersister, SignersImporterRetriever,
57    SingleSignatureAuthenticator,
58};
59
60pub use immutable_file_digest_mapper::ImmutableFileDigestMapper;
61
62#[cfg(test)]
63pub(crate) use dependency_injection::tests::initialize_dependencies;
64
65// Memory allocator (to handle properly memory fragmentation)
66#[cfg(all(not(target_env = "msvc"), feature = "jemallocator"))]
67use tikv_jemallocator::Jemalloc;
68
69#[cfg(all(not(target_env = "msvc"), feature = "jemallocator"))]
70#[global_allocator]
71static GLOBAL: Jemalloc = Jemalloc;