Struct mithril_aggregator::Configuration
source · pub struct Configuration {Show 29 fields
pub environment: ExecutionEnvironment,
pub cardano_cli_path: PathBuf,
pub cardano_node_socket_path: PathBuf,
pub cardano_node_version: String,
pub network_magic: Option<u64>,
pub network: String,
pub chain_observer_type: ChainObserverType,
pub protocol_parameters: ProtocolParameters,
pub snapshot_uploader_type: SnapshotUploaderType,
pub snapshot_bucket_name: Option<String>,
pub snapshot_use_cdn_domain: bool,
pub server_ip: String,
pub server_port: u16,
pub run_interval: u64,
pub db_directory: PathBuf,
pub snapshot_directory: PathBuf,
pub data_stores_directory: PathBuf,
pub genesis_verification_key: HexEncodedGenesisVerificationKey,
pub reset_digests_cache: bool,
pub disable_digests_cache: bool,
pub store_retention_limit: Option<usize>,
pub era_reader_adapter_type: EraReaderAdapterType,
pub era_reader_adapter_params: Option<String>,
pub signed_entity_types: Option<String>,
pub snapshot_compression_algorithm: CompressionAlgorithm,
pub zstandard_parameters: Option<ZstandardCompressionParameters>,
pub cexplorer_pools_url: Option<String>,
pub signer_importer_run_interval: u64,
pub allow_unparsable_block: bool,
}
Expand description
Aggregator configuration
Fields§
§environment: ExecutionEnvironment
What kind of runtime environment the configuration is meant to.
cardano_cli_path: PathBuf
Cardano CLI tool path
cardano_node_socket_path: PathBuf
Path of the socket used by the Cardano CLI tool to communicate with the Cardano node
cardano_node_version: String
Cardano node version.
NOTE: This cannot be verified for now (see this issue). This is why it has to be manually given to the Aggregator
network_magic: Option<u64>
Cardano Network Magic number
useful for TestNet & DevNet
network: String
Cardano network
chain_observer_type: ChainObserverType
Cardano chain observer type
protocol_parameters: ProtocolParameters
Protocol parameters
snapshot_uploader_type: SnapshotUploaderType
Type of snapshot uploader to use
snapshot_bucket_name: Option<String>
Bucket name where the snapshots are stored if snapshot_uploader_type is Gcp
snapshot_use_cdn_domain: bool
Use CDN domain to construct snapshot urls if snapshot_uploader_type is Gcp
server_ip: String
Server listening IP
server_port: u16
Server listening port
run_interval: u64
Run Interval is the interval between two runtime cycles in ms
db_directory: PathBuf
Directory of the Cardano node store.
snapshot_directory: PathBuf
Directory to store snapshot
data_stores_directory: PathBuf
Directory to store aggregator data (Certificates, Snapshots, Protocol Parameters, …)
genesis_verification_key: HexEncodedGenesisVerificationKey
Genesis verification key
reset_digests_cache: bool
Should the immutable cache be reset or not
disable_digests_cache: bool
Use the digest caching strategy
store_retention_limit: Option<usize>
Max number of records in stores. When new records are added, oldest records are automatically deleted so there can always be at max the number of records specified by this setting.
era_reader_adapter_type: EraReaderAdapterType
Era reader adapter type
era_reader_adapter_params: Option<String>
Era reader adapter parameters
signed_entity_types: Option<String>
Signed entity types parameters (discriminants names in an ordered comma separated list).
snapshot_compression_algorithm: CompressionAlgorithm
Compression algorithm used for the snapshot archive artifacts.
zstandard_parameters: Option<ZstandardCompressionParameters>
Specific parameters when snapshot_compression_algorithm is set to zstandard.
cexplorer_pools_url: Option<String>
Url to CExplorer list of pools to import as signer in the database.
signer_importer_run_interval: u64
Time interval at which the signers in Self::cexplorer_pools_url will be imported (in minutes).
allow_unparsable_block: bool
If set no error is returned in case of unparsable block and an error log is written instead.
Will be ignored on (pre)production networks.
Implementations§
source§impl Configuration
impl Configuration
sourcepub fn new_sample() -> Self
pub fn new_sample() -> Self
Create a sample configuration mainly for tests
sourcepub fn get_server_url(&self) -> String
pub fn get_server_url(&self) -> String
Build the server URL from configuration.
sourcepub fn get_network(&self) -> StdResult<CardanoNetwork>
pub fn get_network(&self) -> StdResult<CardanoNetwork>
Check configuration and return a representation of the Cardano network.
sourcepub fn get_sqlite_dir(&self) -> PathBuf
pub fn get_sqlite_dir(&self) -> PathBuf
Return the file of the SQLite stores. If the directory does not exist, it is created.
sourcepub fn safe_epoch_retention_limit(&self) -> Option<u64>
pub fn safe_epoch_retention_limit(&self) -> Option<u64>
Same as the store retention limit but will never yield a value lower than 3.
This is in order to avoid pruning data that will be used in future epochs (like the protocol parameters).
sourcepub fn list_allowed_signed_entity_types_discriminants(
&self
) -> StdResult<Vec<SignedEntityTypeDiscriminants>>
pub fn list_allowed_signed_entity_types_discriminants( &self ) -> StdResult<Vec<SignedEntityTypeDiscriminants>>
Create the deduplicated list of allowed signed entity types discriminants.
By default, the list contains the MithrilStakeDistribution and the CardanoImmutableFilesFull.
The list can be extended with the configuration parameter signed_entity_types
.
The signed entity types are defined in the SignedEntityTypeDiscriminants enum.
The signed entity types are discarded if they are not declared in the SignedEntityType enum.
sourcepub fn list_allowed_signed_entity_types(
&self,
time_point: &TimePoint
) -> StdResult<Vec<SignedEntityType>>
pub fn list_allowed_signed_entity_types( &self, time_point: &TimePoint ) -> StdResult<Vec<SignedEntityType>>
Create the deduplicated list of allowed signed entity types.
By default, the list contains the MithrilStakeDistribution and the CardanoImmutableFilesFull.
The list can be extended with the configuration parameter signed_entity_types
.
The signed entity types are defined in the SignedEntityTypeDiscriminants enum.
The signed entity types are discarded if they are not declared in the SignedEntityType enum.
Trait Implementations§
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Configuration
impl Debug for Configuration
source§impl<'de> Deserialize<'de> for Configuration
impl<'de> Deserialize<'de> for Configuration
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Documenter for Configuration
impl Documenter for Configuration
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer ) -> Result<(), ErrorImpl>
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.