9609{
9611
9612#ifdef WIN32
9613
9614 std::locale::global(boost::locale::generator().generate(""));
9615 boost::filesystem::path::imbue(std::locale());
9616#endif
9617
9618 po::options_description desc_params(
wallet_args::tr(
"Wallet options"));
9630
9646 po::positional_options_description positional_options;
9648
9649 boost::optional<po::variables_map> vm;
9650 bool should_terminate = false;
9652 argc, argv,
9653 "electroneum-wallet-cli [--wallet-file=<filename>|--generate-new-wallet=<filename>] [<COMMAND>]",
9654 sw::tr(
"This is the command line electroneum wallet. It needs to connect to a electroneum\ndaemon to work correctly.\nWARNING: Do not reuse your Electroneum keys on another fork, UNLESS this fork has key reuse mitigations built in. Doing so will harm your privacy."),
9655 desc_params,
9656 positional_options,
9658 "electroneum-wallet-cli.log"
9659 );
9660
9661 if (!vm)
9662 {
9663 return 1;
9664 }
9665
9666 if (should_terminate)
9667 {
9668 return 0;
9669 }
9670
9671
9672
9674 const bool r = w.
init(*vm);
9676
9678 if (!command.empty())
9679 {
9684 }
9685 else
9686 {
9689 {
9690
9691 return;
9692 }
9693#ifdef WIN32
9694 if (type == CTRL_C_EVENT)
9695#else
9696 if (type == SIGINT)
9697#endif
9698 {
9699
9701 }
9702 else
9703 {
9705 }
9706 });
9707
9708
9710
9711
9713 }
9714 return 0;
9716}
Manages wallet operations. This is the most abstracted wallet class.
bool init(const boost::program_options::variables_map &vm)
static const char * tr(const char *str)
bool process_command(const std::vector< std::string > &args)
#define CATCH_ENTRY_L0(lacation, return_val)
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
const command_line::arg_descriptor< std::string > arg_fallback_to_pow_checkpoint_hash
const command_line::arg_descriptor< uint64_t > arg_fallback_to_pow_checkpoint_height
const command_line::arg_descriptor< std::vector< std::string > > arg_command
const char * tr(const char *str)
std::pair< boost::optional< boost::program_options::variables_map >, bool > main(int argc, char **argv, const char *const usage, const char *const notice, boost::program_options::options_description desc_params, const boost::program_options::positional_options_description &positional_options, const std::function< void(const std::string &, bool)> &print, const char *default_log_name, bool log_to_console)