pub struct DependenciesBuilder {
Show 48 fields pub configuration: Configuration, pub root_logger: Logger, pub sqlite_connection: Option<Arc<SqliteConnection>>, pub sqlite_connection_event_store: Option<Arc<SqliteConnection>>, pub sqlite_connection_cardano_transaction_pool: Option<Arc<SqliteConnectionPool>>, pub stake_store: Option<Arc<StakePoolStore>>, pub snapshot_uploader: Option<Arc<dyn SnapshotUploader>>, pub multi_signer: Option<Arc<dyn MultiSigner>>, pub certificate_pending_store: Option<Arc<CertificatePendingStore>>, pub certificate_repository: Option<Arc<CertificateRepository>>, pub open_message_repository: Option<Arc<OpenMessageRepository>>, pub verification_key_store: Option<Arc<dyn VerificationKeyStorer>>, pub epoch_settings_store: Option<Arc<EpochSettingsStore>>, pub cardano_cli_runner: Option<Box<CardanoCliRunner>>, pub chain_observer: Option<Arc<dyn ChainObserver>>, pub chain_block_reader: Option<Arc<Mutex<dyn ChainBlockReader>>>, pub transaction_repository: Option<Arc<CardanoTransactionRepository>>, pub block_scanner: Option<Arc<dyn BlockScanner>>, pub immutable_digester: Option<Arc<dyn ImmutableDigester>>, pub immutable_file_observer: Option<Arc<dyn ImmutableFileObserver>>, pub immutable_cache_provider: Option<Arc<dyn ImmutableFileDigestCacheProvider>>, pub digester: Option<Arc<dyn ImmutableDigester>>, pub snapshotter: Option<Arc<dyn Snapshotter>>, pub certificate_verifier: Option<Arc<dyn CertificateVerifier>>, pub genesis_verifier: Option<Arc<ProtocolGenesisVerifier>>, pub mithril_registerer: Option<Arc<MithrilSignerRegisterer>>, pub era_checker: Option<Arc<EraChecker>>, pub era_reader_adapter: Option<Arc<dyn EraReaderAdapter>>, pub era_reader: Option<Arc<EraReader>>, pub event_transmitter: Option<Arc<TransmitterService<EventMessage>>>, pub event_transmitter_channel: (Option<UnboundedReceiver<EventMessage>>, Option<UnboundedSender<EventMessage>>), pub api_version_provider: Option<Arc<APIVersionProvider>>, pub stake_distribution_service: Option<Arc<dyn StakeDistributionService>>, pub ticker_service: Option<Arc<dyn TickerService>>, pub signer_store: Option<Arc<SignerStore>>, pub signable_seed_builder: Option<Arc<dyn SignableSeedBuilder>>, pub signable_builder_service: Option<Arc<dyn SignableBuilderService>>, pub signed_entity_service: Option<Arc<dyn SignedEntityService>>, pub certifier_service: Option<Arc<dyn CertifierService>>, pub epoch_service: Option<EpochServiceWrapper>, pub signed_entity_storer: Option<Arc<dyn SignedEntityStorer>>, pub message_service: Option<Arc<dyn MessageService>>, pub prover_service: Option<Arc<dyn ProverService>>, pub signed_entity_type_lock: Option<Arc<SignedEntityTypeLock>>, pub transactions_importer: Option<Arc<dyn TransactionsImporter>>, pub upkeep_service: Option<Arc<dyn UpkeepService>>, pub single_signer_authenticator: Option<Arc<SingleSignatureAuthenticator>>, pub metrics_service: Option<Arc<MetricsService>>,
}
Expand description

§Dependencies container builder

This is meant to create SHARED DEPENDENCIES, ie: dependencies instances that must be shared amongst several Tokio tasks. For example, database repositories are NOT shared dependencies and therefor can be created ad hoc whereas the database connection is a shared dependency.

Each shared dependency must implement a build and a get function. The build function creates the dependency, the get function creates the dependency at first call then return a clone of the Arc containing the dependency for all further calls.

Fields§

§configuration: Configuration

Configuration parameters

§root_logger: Logger

Application root logger

§sqlite_connection: Option<Arc<SqliteConnection>>

SQLite database connection

§sqlite_connection_event_store: Option<Arc<SqliteConnection>>

Event store SQLite database connection

§sqlite_connection_cardano_transaction_pool: Option<Arc<SqliteConnectionPool>>

Cardano transactions SQLite database connection pool

§stake_store: Option<Arc<StakePoolStore>>

Stake Store used by the StakeDistributionService It shall be a private dependency.

§snapshot_uploader: Option<Arc<dyn SnapshotUploader>>

Snapshot uploader service.

§multi_signer: Option<Arc<dyn MultiSigner>>

Multisigner service.

§certificate_pending_store: Option<Arc<CertificatePendingStore>>

Certificate pending store.

§certificate_repository: Option<Arc<CertificateRepository>>

Certificate repository.

§open_message_repository: Option<Arc<OpenMessageRepository>>

Open message repository.

§verification_key_store: Option<Arc<dyn VerificationKeyStorer>>

Verification key store.

§epoch_settings_store: Option<Arc<EpochSettingsStore>>

Epoch settings store.

§cardano_cli_runner: Option<Box<CardanoCliRunner>>

Cardano CLI Runner for the ChainObserver

§chain_observer: Option<Arc<dyn ChainObserver>>

Chain observer service.

§chain_block_reader: Option<Arc<Mutex<dyn ChainBlockReader>>>

Chain block reader

§transaction_repository: Option<Arc<CardanoTransactionRepository>>

Cardano transactions repository.

§block_scanner: Option<Arc<dyn BlockScanner>>

Cardano block scanner.

§immutable_digester: Option<Arc<dyn ImmutableDigester>>

Immutable file digester service.

§immutable_file_observer: Option<Arc<dyn ImmutableFileObserver>>

Immutable file observer service.

§immutable_cache_provider: Option<Arc<dyn ImmutableFileDigestCacheProvider>>

Immutable cache provider service.

§digester: Option<Arc<dyn ImmutableDigester>>

Digester service.

§snapshotter: Option<Arc<dyn Snapshotter>>

Snapshotter service.

§certificate_verifier: Option<Arc<dyn CertificateVerifier>>

Certificate verifier service.

§genesis_verifier: Option<Arc<ProtocolGenesisVerifier>>

Genesis signature verifier service.

§mithril_registerer: Option<Arc<MithrilSignerRegisterer>>

Signer registerer service

§era_checker: Option<Arc<EraChecker>>

Era checker service

§era_reader_adapter: Option<Arc<dyn EraReaderAdapter>>

Adapter for EraReader

§era_reader: Option<Arc<EraReader>>

Era reader service

§event_transmitter: Option<Arc<TransmitterService<EventMessage>>>

Event Transmitter Service

§event_transmitter_channel: (Option<UnboundedReceiver<EventMessage>>, Option<UnboundedSender<EventMessage>>)

Event transmitter Channel Sender endpoint

§api_version_provider: Option<Arc<APIVersionProvider>>

API Version provider

§stake_distribution_service: Option<Arc<dyn StakeDistributionService>>

Stake Distribution Service

§ticker_service: Option<Arc<dyn TickerService>>

Ticker Service

§signer_store: Option<Arc<SignerStore>>

Signer Store

§signable_seed_builder: Option<Arc<dyn SignableSeedBuilder>>

Signable Seed Builder

§signable_builder_service: Option<Arc<dyn SignableBuilderService>>

Signable Builder Service

§signed_entity_service: Option<Arc<dyn SignedEntityService>>

Signed Entity Service

§certifier_service: Option<Arc<dyn CertifierService>>

Certifier service

§epoch_service: Option<EpochServiceWrapper>

Epoch service.

§signed_entity_storer: Option<Arc<dyn SignedEntityStorer>>

Signed Entity storer

§message_service: Option<Arc<dyn MessageService>>

HTTP Message service

§prover_service: Option<Arc<dyn ProverService>>

Prover service

§signed_entity_type_lock: Option<Arc<SignedEntityTypeLock>>

Signed Entity Type Lock

§transactions_importer: Option<Arc<dyn TransactionsImporter>>

Transactions Importer

§upkeep_service: Option<Arc<dyn UpkeepService>>

Upkeep service

§single_signer_authenticator: Option<Arc<SingleSignatureAuthenticator>>

Single signer authenticator

§metrics_service: Option<Arc<MetricsService>>

Metrics service

Implementations§

source§

impl DependenciesBuilder

source

pub fn new(root_logger: Logger, configuration: Configuration) -> Self

Create a new clean dependency builder

source

pub async fn get_sqlite_connection(&mut self) -> Result<Arc<SqliteConnection>>

Get SQLite connection

source

pub async fn get_event_store_sqlite_connection( &mut self, ) -> Result<Arc<SqliteConnection>>

Get EventStore SQLite connection

source

pub async fn get_sqlite_connection_cardano_transaction_pool( &mut self, ) -> Result<Arc<SqliteConnectionPool>>

Get SQLite connection pool for the cardano transactions store

source

pub async fn get_stake_store(&mut self) -> Result<Arc<StakePoolStore>>

Return a StakePoolStore

source

pub async fn get_snapshot_uploader( &mut self, ) -> Result<Arc<dyn SnapshotUploader>>

source

pub async fn get_multi_signer(&mut self) -> Result<Arc<dyn MultiSigner>>

Get a configured multi signer

source

pub async fn get_certificate_pending_store( &mut self, ) -> Result<Arc<CertificatePendingStore>>

Get a configured CertificatePendingStore.

source

pub async fn get_certificate_repository( &mut self, ) -> Result<Arc<CertificateRepository>>

Get a configured CertificateRepository.

source

pub async fn get_open_message_repository( &mut self, ) -> Result<Arc<OpenMessageRepository>>

Get a configured OpenMessageRepository.

source

pub async fn get_verification_key_store( &mut self, ) -> Result<Arc<dyn VerificationKeyStorer>>

Get a configured VerificationKeyStorer.

source

pub async fn get_epoch_settings_store( &mut self, ) -> Result<Arc<EpochSettingsStore>>

Get a configured EpochSettingsStorer.

source

pub async fn get_chain_observer(&mut self) -> Result<Arc<dyn ChainObserver>>

Return a ChainObserver

source

pub async fn get_cardano_cli_runner(&mut self) -> Result<Box<CardanoCliRunner>>

source

pub async fn get_immutable_file_observer( &mut self, ) -> Result<Arc<dyn ImmutableFileObserver>>

Return a ImmutableFileObserver instance.

source

pub async fn get_immutable_cache_provider( &mut self, ) -> Result<Arc<dyn ImmutableFileDigestCacheProvider>>

source

pub fn root_logger(&self) -> Logger

Return a copy of the root logger.

source

pub async fn get_transaction_repository( &mut self, ) -> Result<Arc<CardanoTransactionRepository>>

Transaction repository.

source

pub async fn get_chain_block_reader( &mut self, ) -> Result<Arc<Mutex<dyn ChainBlockReader>>>

Chain reader

source

pub async fn get_block_scanner(&mut self) -> Result<Arc<dyn BlockScanner>>

Block scanner

source

pub async fn get_immutable_digester( &mut self, ) -> Result<Arc<dyn ImmutableDigester>>

Immutable digester.

source

pub async fn get_snapshotter(&mut self) -> Result<Arc<dyn Snapshotter>>

Snapshotter service.

source

pub async fn get_certificate_verifier( &mut self, ) -> Result<Arc<dyn CertificateVerifier>>

source

pub async fn get_genesis_verifier( &mut self, ) -> Result<Arc<ProtocolGenesisVerifier>>

source

pub async fn get_mithril_registerer( &mut self, ) -> Result<Arc<MithrilSignerRegisterer>>

source

pub async fn get_era_reader(&mut self) -> Result<Arc<EraReader>>

EraReader service

source

pub async fn get_era_checker(&mut self) -> Result<Arc<EraChecker>>

EraReader service

source

pub async fn get_event_transmitter_sender( &mut self, ) -> Result<UnboundedSender<EventMessage>>

Return the EventMessage channel sender.

source

pub async fn get_event_transmitter_receiver( &mut self, ) -> Result<UnboundedReceiver<EventMessage>>

Return the channel receiver setup for the EventStore. Since this receiver is not clonable, it must be called only once.

source

pub async fn get_event_transmitter( &mut self, ) -> Result<Arc<TransmitterService<EventMessage>>>

source

pub async fn get_api_version_provider( &mut self, ) -> Result<Arc<APIVersionProvider>>

source

pub async fn get_stake_distribution_service( &mut self, ) -> Result<Arc<dyn StakeDistributionService>>

source

pub async fn get_signer_store(&mut self) -> Result<Arc<SignerStore>>

SignerStore service

source

pub async fn get_signable_builder_service( &mut self, ) -> Result<Arc<dyn SignableBuilderService>>

source

pub async fn get_signable_seed_builder( &mut self, ) -> Result<Arc<dyn SignableSeedBuilder>>

source

pub async fn get_signed_entity_service( &mut self, ) -> Result<Arc<dyn SignedEntityService>>

source

pub async fn get_epoch_service(&mut self) -> Result<EpochServiceWrapper>

EpochService service

source

pub async fn get_signed_entity_storer( &mut self, ) -> Result<Arc<dyn SignedEntityStorer>>

source

pub async fn get_single_signature_authenticator( &mut self, ) -> Result<Arc<SingleSignatureAuthenticator>>

source

pub async fn get_metrics_service(&mut self) -> Result<Arc<MetricsService>>

source

pub async fn create_usage_reporter(&mut self) -> Result<UsageReporter>

Create a UsageReporter instance.

source

pub async fn build_dependency_container( &mut self, ) -> Result<DependencyContainer>

Return an unconfigured DependencyContainer

source

pub async fn create_event_store(&mut self) -> Result<EventStore>

Create dependencies for the EventStore task.

source

pub async fn create_aggregator_runner(&mut self) -> Result<AggregatorRuntime>

Create the AggregatorRunner

source

pub async fn create_http_routes( &mut self, ) -> Result<impl Filter<Extract = (impl Reply,), Error = Rejection> + Clone>

Create the HTTP route instance

source

pub async fn create_cardano_transactions_preloader( &mut self, ) -> Result<Arc<CardanoTransactionsPreloader>>

Create a CardanoTransactionsPreloader instance.

source

pub async fn create_genesis_container( &mut self, ) -> Result<GenesisToolsDependency>

Create dependencies for genesis commands

source

pub async fn create_signer_importer( &mut self, cexplorer_pools_url: &str, ) -> Result<SignersImporter>

Create a SignersImporter instance.

source

pub async fn build_ticker_service(&mut self) -> Result<Arc<dyn TickerService>>

Create TickerService instance.

source

pub async fn get_ticker_service(&mut self) -> Result<Arc<dyn TickerService>>

source

pub async fn build_certifier_service( &mut self, ) -> Result<Arc<dyn CertifierService>>

Create CertifierService service

source

pub async fn get_certifier_service( &mut self, ) -> Result<Arc<dyn CertifierService>>

source

pub async fn build_message_service(&mut self) -> Result<Arc<dyn MessageService>>

build HTTP message service

source

pub async fn get_message_service(&mut self) -> Result<Arc<dyn MessageService>>

source

pub async fn build_prover_service(&mut self) -> Result<Arc<dyn ProverService>>

Build Prover service

source

pub async fn get_prover_service(&mut self) -> Result<Arc<dyn ProverService>>

ProverService service

source

pub async fn vanish(self)

Remove the dependencies builder from memory to release Arc instances.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T