pub struct Config<B: Blocker<PublicKey = PublicKey>> {Show 19 fields
pub blocker: B,
pub partition_prefix: String,
pub blocks_freezer_table_initial_size: u32,
pub finalized_freezer_table_initial_size: u32,
pub me: PublicKey,
pub private_key: PrivateKey,
pub participants: Ordered<PublicKey>,
pub mailbox_size: usize,
pub deque_size: usize,
pub leader_timeout: Duration,
pub notarization_timeout: Duration,
pub nullify_retry: Duration,
pub fetch_timeout: Duration,
pub activity_timeout: u64,
pub skip_timeout: u64,
pub max_fetch_count: usize,
pub fetch_concurrent: usize,
pub fetch_rate_per_peer: Quota,
pub on_finalized: Option<FinalizedCallback>,
}Expand description
Configuration for the Simplex engine.
Fields§
§blocker: BThe blocker for managing peer connections.
partition_prefix: StringPrefix for storage partitions.
blocks_freezer_table_initial_size: u32Initial size for the blocks freezer table.
finalized_freezer_table_initial_size: u32Initial size for the finalized freezer table.
me: PublicKeyOur public key.
private_key: PrivateKeyOur private key for signing.
participants: Ordered<PublicKey>The set of participants in consensus.
mailbox_size: usizeSize of mailbox channels.
deque_size: usizeSize of message deques.
leader_timeout: DurationTimeout for leader proposal.
notarization_timeout: DurationTimeout for notarization.
nullify_retry: DurationRetry interval for nullify messages.
fetch_timeout: DurationTimeout for fetch requests.
activity_timeout: u64Activity timeout in views.
skip_timeout: u64Skip timeout in views.
max_fetch_count: usizeMaximum number of blocks to fetch at once.
fetch_concurrent: usizeNumber of concurrent fetch requests.
fetch_rate_per_peer: QuotaRate limit for fetch requests per peer.
on_finalized: Option<FinalizedCallback>Callback for finalized blocks.
Implementations§
Source§impl<B: Blocker<PublicKey = PublicKey>> Config<B>
impl<B: Blocker<PublicKey = PublicKey>> Config<B>
Sourcepub fn new(
blocker: B,
me: PublicKey,
private_key: PrivateKey,
participants: Vec<PublicKey>,
) -> Self
pub fn new( blocker: B, me: PublicKey, private_key: PrivateKey, participants: Vec<PublicKey>, ) -> Self
Creates a new configuration with sensible defaults.
Sourcepub fn on_finalized<F>(self, callback: F) -> Self
pub fn on_finalized<F>(self, callback: F) -> Self
Sets the callback for finalized blocks.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Config<B>where
B: Freeze,
impl<B> !RefUnwindSafe for Config<B>
impl<B> Send for Config<B>
impl<B> Sync for Config<B>where
B: Sync,
impl<B> Unpin for Config<B>where
B: Unpin,
impl<B> !UnwindSafe for Config<B>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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