Electroneum
Namespaces | Classes | Functions | Variables
command_line Namespace Reference

Namespaces

 anonymous_namespace{command_line.cpp}
 

Classes

struct  arg_descriptor
 
struct  arg_descriptor< std::vector< T >, false >
 
struct  arg_descriptor< T, false >
 
struct  arg_descriptor< T, true >
 

Functions

std::string input_line (const std::string &prompt)
 
bool is_yes (const std::string &str)
 
template<typename T >
boost::program_options::typed_value< T, char > * make_semantic (const arg_descriptor< T, true > &)
 
template<typename T >
boost::program_options::typed_value< T, char > * make_semantic (const arg_descriptor< T, false > &arg)
 
template<typename T >
boost::program_options::typed_value< T, char > * make_semantic (const arg_descriptor< T, false > &arg, const T &def)
 
template<typename T >
boost::program_options::typed_value< std::vector< T >, char > * make_semantic (const arg_descriptor< std::vector< T >, false > &)
 
template<typename T , bool required>
void add_arg (boost::program_options::options_description &description, const arg_descriptor< T, required > &arg, bool unique=true)
 
template<typename T >
void add_arg (boost::program_options::options_description &description, const arg_descriptor< T, false > &arg, const T &def, bool unique=true)
 
template<>
void add_arg (boost::program_options::options_description &description, const arg_descriptor< bool, false > &arg, bool unique)
 
template<typename charT >
boost::program_options::basic_parsed_options< charT > parse_command_line (int argc, const charT *const argv[], const boost::program_options::options_description &desc, bool allow_unregistered=false)
 
template<typename F >
bool handle_error_helper (const boost::program_options::options_description &desc, F parser)
 
template<typename T , bool required>
bool has_arg (const boost::program_options::variables_map &vm, const arg_descriptor< T, required > &arg)
 
template<typename T , bool required>
T get_arg (const boost::program_options::variables_map &vm, const arg_descriptor< T, required > &arg)
 
template<>
bool has_arg< bool, false > (const boost::program_options::variables_map &vm, const arg_descriptor< bool, false > &arg)
 

Variables

const arg_descriptor< boolarg_help = {"help", "Produce help message"}
 
const arg_descriptor< boolarg_version = {"version", "Output version information"}
 
const arg_descriptor< std::string > arg_data_dir = {"data-dir", "Specify data directory"}
 
const arg_descriptor< std::string > arg_testnet_data_dir = {"testnet-data-dir", "Specify testnet data directory"}
 
const arg_descriptor< boolarg_test_drop_download = {"test-drop-download", "For net tests: in download, discard ALL blocks instead checking/saving them (very fast)"}
 
const arg_descriptor< uint64_t > arg_test_drop_download_height = {"test-drop-download-height", "Like test-drop-download but disards only after around certain height", 0}
 
const arg_descriptor< int > arg_test_dbg_lock_sleep = {"test-dbg-lock-sleep", "Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests."}
 
const arg_descriptor< bool, falsearg_testnet_on
 
const arg_descriptor< boolarg_dns_checkpoints
 
const command_line::arg_descriptor< uint64_t > arg_fast_block_sync
 
const command_line::arg_descriptor< uint64_t > arg_prep_blocks_threads
 
const command_line::arg_descriptor< uint64_t > arg_show_time_stats
 
const command_line::arg_descriptor< size_t > arg_block_sync_size
 
const command_line::arg_descriptor< std::string > arg_check_updates
 
const arg_descriptor< boolarg_disable_fluffy_blocks
 
const arg_descriptor< std::string > arg_validator_key
 

Function Documentation

◆ add_arg() [1/3]

template<typename T , bool required>
void command_line::add_arg ( boost::program_options::options_description &  description,
const arg_descriptor< T, required > &  arg,
bool  unique = true 
)

◆ add_arg() [2/3]

template<typename T >
void command_line::add_arg ( boost::program_options::options_description &  description,
const arg_descriptor< T, false > &  arg,
const T def,
bool  unique = true 
)

◆ add_arg() [3/3]

template<>
void command_line::add_arg ( boost::program_options::options_description &  description,
const arg_descriptor< bool, false > &  arg,
bool  unique 
)
inline

◆ get_arg()

template<typename T , bool required>
T command_line::get_arg ( const boost::program_options::variables_map &  vm,
const arg_descriptor< T, required > &  arg 
)

◆ handle_error_helper()

template<typename F >
bool command_line::handle_error_helper ( const boost::program_options::options_description &  desc,
F  parser 
)

◆ has_arg()

template<typename T , bool required>
bool command_line::has_arg ( const boost::program_options::variables_map &  vm,
const arg_descriptor< T, required > &  arg 
)

◆ has_arg< bool, false >()

template<>
bool command_line::has_arg< bool, false > ( const boost::program_options::variables_map &  vm,
const arg_descriptor< bool, false > &  arg 
)
inline

◆ input_line()

std::string command_line::input_line ( const std::string &  prompt)

◆ is_yes()

bool command_line::is_yes ( const std::string &  str)
Returns
True if str is is_iequal("y" || "yes" ||tr("yes"))`.

◆ make_semantic() [1/4]

template<typename T >
boost::program_options::typed_value<T, char>* command_line::make_semantic ( const arg_descriptor< T, true > &  )

◆ make_semantic() [2/4]

template<typename T >
boost::program_options::typed_value<T, char>* command_line::make_semantic ( const arg_descriptor< T, false > &  arg)

◆ make_semantic() [3/4]

template<typename T >
boost::program_options::typed_value<T, char>* command_line::make_semantic ( const arg_descriptor< T, false > &  arg,
const T def 
)

◆ make_semantic() [4/4]

template<typename T >
boost::program_options::typed_value<std::vector<T>, char>* command_line::make_semantic ( const arg_descriptor< std::vector< T >, false > &  )

◆ parse_command_line()

template<typename charT >
boost::program_options::basic_parsed_options<charT> command_line::parse_command_line ( int  argc,
const charT *const  argv[],
const boost::program_options::options_description &  desc,
bool  allow_unregistered = false 
)

Variable Documentation

◆ arg_block_sync_size

const arg_descriptor< size_t > command_line::arg_block_sync_size
Initial value:
= {
"block-sync-size"
, "How many blocks to sync at once during chain synchronization (0 = adaptive)."
, 0
}

◆ arg_check_updates

const arg_descriptor< std::string > command_line::arg_check_updates
Initial value:
= {
"check-updates"
, "Check for new versions of electroneum: [disabled|notify|download|update]"
, "notify"
}

◆ arg_data_dir

const arg_descriptor< std::string > command_line::arg_data_dir = {"data-dir", "Specify data directory"}

◆ arg_disable_fluffy_blocks

const arg_descriptor< bool > command_line::arg_disable_fluffy_blocks
Initial value:
= {
"disable-fluffy-blocks"
, "Disable relaying blocks as fluffy blocks where possible"
, false
}

◆ arg_dns_checkpoints

const arg_descriptor< bool > command_line::arg_dns_checkpoints
Initial value:
= {
"enforce-dns-checkpointing"
, "checkpoints from DNS server will be enforced"
, false
}

◆ arg_fast_block_sync

const arg_descriptor< uint64_t > command_line::arg_fast_block_sync
Initial value:
= {
"fast-block-sync"
, "Sync up most of the way by using embedded, known block hashes."
, 1
}

◆ arg_help

const arg_descriptor< bool > command_line::arg_help = {"help", "Produce help message"}

◆ arg_prep_blocks_threads

const arg_descriptor< uint64_t > command_line::arg_prep_blocks_threads
Initial value:
= {
"prep-blocks-threads"
, "Max number of threads to use when preparing block hashes in groups."
, 4
}

◆ arg_show_time_stats

const arg_descriptor< uint64_t > command_line::arg_show_time_stats
Initial value:
= {
"show-time-stats"
, "Show time-stats when processing blocks/txs and disk synchronization."
, 0
}

◆ arg_test_dbg_lock_sleep

const arg_descriptor< int > command_line::arg_test_dbg_lock_sleep = {"test-dbg-lock-sleep", "Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests."}

◆ arg_test_drop_download

const arg_descriptor< bool > command_line::arg_test_drop_download = {"test-drop-download", "For net tests: in download, discard ALL blocks instead checking/saving them (very fast)"}

◆ arg_test_drop_download_height

const arg_descriptor< uint64_t > command_line::arg_test_drop_download_height = {"test-drop-download-height", "Like test-drop-download but disards only after around certain height", 0}

◆ arg_testnet_data_dir

const arg_descriptor< std::string > command_line::arg_testnet_data_dir = {"testnet-data-dir", "Specify testnet data directory"}

◆ arg_testnet_on

const arg_descriptor< bool, false > command_line::arg_testnet_on
Initial value:
= {
"testnet"
, "Run on testnet. The wallet must be launched with --testnet flag."
, false
}

◆ arg_validator_key

const arg_descriptor< std::string > command_line::arg_validator_key
Initial value:
= {
"validator-key",
"Specify your Validator Private Key to digitally sign blocks when mining"
}

◆ arg_version

const arg_descriptor< bool > command_line::arg_version = {"version", "Output version information"}