pub struct Config<A> {
pub address: A,
pub initial_height: u64,
pub timeout_values: TimeoutValues,
pub history_depth: u64,
pub wal_dir: PathBuf,
/* private fields */
}Expand description
The configuration for the consensus engine.
Fields§
§address: AThe address of the validator.
initial_height: u64The initial height.
timeout_values: TimeoutValuesThe timeout configuration.
history_depth: u64The number of completed heights to keep in memory.
wal_dir: PathBufThe directory to store the write-ahead log.
Implementations§
Source§impl<A: Default> Config<A>
impl<A: Default> Config<A>
Sourcepub fn new(address: A) -> Self
pub fn new(address: A) -> Self
Create a new consensus config with the default values for a single validator.
Sourcepub fn with_initial_height(self, height: u64) -> Self
pub fn with_initial_height(self, height: u64) -> Self
Set the initial height.
Sourcepub fn with_timeout_values(self, timeout_values: TimeoutValues) -> Self
pub fn with_timeout_values(self, timeout_values: TimeoutValues) -> Self
Set the timeout values.
Sourcepub fn with_history_depth(self, history_depth: u64) -> Self
pub fn with_history_depth(self, history_depth: u64) -> Self
Set the number of completed heights to keep in memory.
Sourcepub fn with_wal_dir(self, wal_dir: PathBuf) -> Self
pub fn with_wal_dir(self, wal_dir: PathBuf) -> Self
Set the WAL directory.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Config<A>where
A: Freeze,
impl<A> RefUnwindSafe for Config<A>where
A: RefUnwindSafe,
impl<A> Send for Config<A>where
A: Send,
impl<A> Sync for Config<A>where
A: Sync,
impl<A> Unpin for Config<A>where
A: Unpin,
impl<A> UnwindSafe for Config<A>where
A: UnwindSafe,
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