pub struct Command {
permissioned_seats: u16,
registered_seats: u16,
permissioned_file: Option<String>,
registered_file: Option<String>,
repetitions: u32,
registered_pool_size: Option<u32>,
ariadne_version: AriadneVersion,
output_to_terminal: bool,
target_dir: Option<String>,
}
Expand description
Runs Ariadne selection and calculates various statistics for the selected committee.
This command writes output data as CSV either to standard output or a file with name
<target-dir>/ariadne-simulation-<timestamp>.csv
.
The following statistics are calculated for each committee:
total_registered_stake
: total stake of the registered candidate pooltotal_committee_stake
: total stake of all selected committee membersdistinct_members
: number of unique members in the committeemax_single_member_seats
: highest number of committee seats occupied by the same membersafe_offline_members
: highest number of members that can be offline without affecting the consensus. This number is calculated by greedily taking members with highest stake until more than 33% of seats are offline.top_safe_offline_stake
: total stake of top stake candidates that can be offline without affecting the consensusbottom_safe_offline_stake
: total stake of lowest stake candidates that can be offline without affecting the consensus
Additionally, all input parameters are saved with the data.
Fields§
§permissioned_seats: u16
Number of permissioned seats
registered_seats: u16
Number of registered seats
permissioned_file: Option<String>
File containing permissioned candidates, defaults to no permissioned candidates
registered_file: Option<String>
File containing registered candidates, defaults to no registered candidates
repetitions: u32
Number of committees to select. Each committee will have a separate row in the output CSV file
registered_pool_size: Option<u32>
Number of registered candidates to be sampled from the registered_file
. Defaults to the size of registered_file
ariadne_version: AriadneVersion
Ariadne algorithm version
output_to_terminal: bool
Determines whether to output to standard output instead of a file
target_dir: Option<String>
Directory in which to save the output CSV file
Implementations§
Source§impl Command
impl Command
Sourcepub fn execute(self, rng: ChaCha20Rng)
pub fn execute(self, rng: ChaCha20Rng)
Executes the command using givern RNG
fn sample_registered( &self, potential_registered_candidates: Vec<(String, u128)>, rng: &mut ChaCha20Rng, ) -> (usize, Vec<(String, u128)>)
fn calculate_stats( &self, committee: &[String], registered_candidates: &[(String, u128)], ) -> SelectionStats
Trait Implementations§
Source§impl Args for Command
impl Args for Command
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command
] so it can instantiate self
via
[FromArgMatches::update_from_arg_matches_mut
] Read moreSource§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§impl Parser for Command
impl Parser for Command
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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> 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>
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>
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