Electroneum
command_parser_executor.cpp
Go to the documentation of this file.
1 // Copyrights(c) 2017-2021, The Electroneum Project
2 // Copyrights(c) 2014-2019, The Monero Project
3 //
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without modification, are
7 // permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice, this list of
10 // conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 // of conditions and the following disclaimer in the documentation and/or other
14 // materials provided with the distribution.
15 //
16 // 3. Neither the name of the copyright holder nor the names of its contributors may be
17 // used to endorse or promote products derived from this software without specific
18 // prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 #include "common/dns_utils.h"
31 #include "common/command_line.h"
32 #include "version.h"
34 
35 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
36 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "daemon"
37 
38 namespace daemonize {
39 
41  uint32_t ip
42  , uint16_t port
43  , const boost::optional<tools::login>& login
44  , const epee::net_utils::ssl_options_t& ssl_options
45  , bool is_rpc
46  , cryptonote::core_rpc_server* rpc_server
47  )
48  : m_executor(ip, port, login, ssl_options, is_rpc, rpc_server)
49 {}
50 
51 bool t_command_parser_executor::print_peer_list(const std::vector<std::string>& args)
52 {
53  if (args.size() > 3)
54  {
55  std::cout << "use: print_pl [white] [gray] [<limit>]" << std::endl;
56  return true;
57  }
58 
59  bool white = false;
60  bool gray = false;
61  size_t limit = 0;
62  for (size_t i = 0; i < args.size(); ++i)
63  {
64  if (args[i] == "white")
65  {
66  white = true;
67  }
68  else if (args[i] == "gray")
69  {
70  gray = true;
71  }
72  else if (!epee::string_tools::get_xtype_from_string(limit, args[i]))
73  {
74  std::cout << "unexpected argument: " << args[i] << std::endl;
75  return true;
76  }
77  }
78 
79  const bool print_both = !white && !gray;
80  return m_executor.print_peer_list(white | print_both, gray | print_both, limit);
81 }
82 
83 bool t_command_parser_executor::print_peer_list_stats(const std::vector<std::string>& args)
84 {
85  if (!args.empty()) return false;
86 
87  return m_executor.print_peer_list_stats();
88 }
89 
90 bool t_command_parser_executor::save_blockchain(const std::vector<std::string>& args)
91 {
92  if (!args.empty()) return false;
93 
94  return m_executor.save_blockchain();
95 }
96 
97 bool t_command_parser_executor::show_hash_rate(const std::vector<std::string>& args)
98 {
99  if (!args.empty()) return false;
100 
101  return m_executor.show_hash_rate();
102 }
103 
104 bool t_command_parser_executor::hide_hash_rate(const std::vector<std::string>& args)
105 {
106  if (!args.empty()) return false;
107 
108  return m_executor.hide_hash_rate();
109 }
110 
111 bool t_command_parser_executor::show_difficulty(const std::vector<std::string>& args)
112 {
113  if (!args.empty()) return false;
114 
115  return m_executor.show_difficulty();
116 }
117 
118 bool t_command_parser_executor::show_status(const std::vector<std::string>& args)
119 {
120  if (!args.empty()) return false;
121 
122  return m_executor.show_status();
123 }
124 
125 bool t_command_parser_executor::print_connections(const std::vector<std::string>& args)
126 {
127  if (!args.empty()) return false;
128 
129  return m_executor.print_connections();
130 }
131 
132 bool t_command_parser_executor::print_net_stats(const std::vector<std::string>& args)
133 {
134  if (!args.empty()) return false;
135 
136  return m_executor.print_net_stats();
137 }
138 
139 bool t_command_parser_executor::print_blockchain_info(const std::vector<std::string>& args)
140 {
141  if(!args.size())
142  {
143  std::cout << "need block index parameter" << std::endl;
144  return false;
145  }
146  uint64_t start_index = 0;
147  uint64_t end_index = 0;
148  if(!epee::string_tools::get_xtype_from_string(start_index, args[0]))
149  {
150  std::cout << "wrong starter block index parameter" << std::endl;
151  return false;
152  }
153  if(args.size() >1 && !epee::string_tools::get_xtype_from_string(end_index, args[1]))
154  {
155  std::cout << "wrong end block index parameter" << std::endl;
156  return false;
157  }
158 
159  return m_executor.print_blockchain_info(start_index, end_index);
160 }
161 
162 bool t_command_parser_executor::set_log_level(const std::vector<std::string>& args)
163 {
164  if(args.size() > 1)
165  {
166  std::cout << "use: set_log [<log_level_number_0-4> | <categories>]" << std::endl;
167  return true;
168  }
169 
170  if (args.empty())
171  {
172  return m_executor.set_log_categories("+");
173  }
174 
175  uint16_t l = 0;
177  {
178  if(4 < l)
179  {
180  std::cout << "wrong number range, use: set_log <log_level_number_0-4>" << std::endl;
181  return true;
182  }
183  return m_executor.set_log_level(l);
184  }
185  else
186  {
187  return m_executor.set_log_categories(args.front());
188  }
189 }
190 
191 bool t_command_parser_executor::print_height(const std::vector<std::string>& args)
192 {
193  if (!args.empty()) return false;
194 
195  return m_executor.print_height();
196 }
197 
198 bool t_command_parser_executor::print_block(const std::vector<std::string>& args)
199 {
200  bool include_hex = false;
201 
202  // Assumes that optional flags come after mandatory argument <transaction_hash>
203  for (unsigned int i = 1; i < args.size(); ++i) {
204  if (args[i] == "+hex")
205  include_hex = true;
206  else
207  {
208  std::cout << "unexpected argument: " << args[i] << std::endl;
209  return true;
210  }
211  }
212  if (args.empty())
213  {
214  std::cout << "expected: print_block (<block_hash> | <block_height>) [+hex]" << std::endl;
215  return false;
216  }
217 
218  const std::string& arg = args.front();
219  try
220  {
221  uint64_t height = boost::lexical_cast<uint64_t>(arg);
222  return m_executor.print_block_by_height(height, include_hex);
223  }
224  catch (const boost::bad_lexical_cast&)
225  {
226  crypto::hash block_hash;
227  if (parse_hash256(arg, block_hash))
228  {
229  return m_executor.print_block_by_hash(block_hash, include_hex);
230  }
231  }
232 
233  return false;
234 }
235 
236 bool t_command_parser_executor::print_transaction(const std::vector<std::string>& args)
237 {
238  bool include_hex = false;
239  bool include_json = false;
240 
241  // Assumes that optional flags come after mandatory argument <transaction_hash>
242  for (unsigned int i = 1; i < args.size(); ++i) {
243  if (args[i] == "+hex")
244  include_hex = true;
245  else if (args[i] == "+json")
246  include_json = true;
247  else
248  {
249  std::cout << "unexpected argument: " << args[i] << std::endl;
250  return true;
251  }
252  }
253  if (args.empty())
254  {
255  std::cout << "expected: print_tx <transaction_hash> [+hex] [+json]" << std::endl;
256  return true;
257  }
258 
259  const std::string& str_hash = args.front();
260  crypto::hash tx_hash;
261  if (parse_hash256(str_hash, tx_hash))
262  {
263  m_executor.print_transaction(tx_hash, include_hex, include_json);
264  }
265 
266  return true;
267 }
268 
269 bool t_command_parser_executor::is_key_image_spent(const std::vector<std::string>& args)
270 {
271  if (args.empty())
272  {
273  std::cout << "expected: is_key_image_spent <key_image>" << std::endl;
274  return true;
275  }
276 
277  const std::string& str = args.front();
280  if (parse_hash256(str, hash))
281  {
282  memcpy(&ki, &hash, sizeof(ki));
283  m_executor.is_key_image_spent(ki);
284  }
285 
286  return true;
287 }
288 
289 bool t_command_parser_executor::print_transaction_pool_long(const std::vector<std::string>& args)
290 {
291  if (!args.empty()) return false;
292 
293  return m_executor.print_transaction_pool_long();
294 }
295 
296 bool t_command_parser_executor::print_transaction_pool_short(const std::vector<std::string>& args)
297 {
298  if (!args.empty()) return false;
299 
300  return m_executor.print_transaction_pool_short();
301 }
302 
303 bool t_command_parser_executor::print_transaction_pool_stats(const std::vector<std::string>& args)
304 {
305  if (!args.empty()) return false;
306 
307  return m_executor.print_transaction_pool_stats();
308 }
309 
310 bool t_command_parser_executor::start_mining(const std::vector<std::string>& args)
311 {
312  if(!args.size())
313  {
314  std::cout << "Please specify a wallet address to mine for: start_mining <addr> [<threads>|auto]" << std::endl;
315  return true;
316  }
317 
321  {
323  {
325  {
326  bool dnssec_valid;
327  std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(args.front(), dnssec_valid,
328  [](const std::string &url, const std::vector<std::string> &addresses, bool dnssec_valid){return addresses[0];});
330  {
332  {
334  {
335  std::cout << "target account address has wrong format" << std::endl;
336  return true;
337  }
338  else
339  {
340  nettype = cryptonote::STAGENET;
341  }
342  }
343  else
344  {
345  nettype = cryptonote::TESTNET;
346  }
347  }
348  }
349  else
350  {
351  nettype = cryptonote::STAGENET;
352  }
353  }
354  else
355  {
356  nettype = cryptonote::TESTNET;
357  }
358  }
359  if (info.is_subaddress)
360  {
361  tools::fail_msg_writer() << "subaddress for mining reward is not yet supported!" << std::endl;
362  return true;
363  }
364  if(nettype != cryptonote::MAINNET)
365  std::cout << "Mining to a " << (nettype == cryptonote::TESTNET ? "testnet" : "stagenet") << " address, make sure this is intentional!" << std::endl;
366  uint64_t threads_count = 1;
367  bool do_background_mining = false;
368  bool ignore_battery = false;
369  if(args.size() > 4)
370  {
371  return false;
372  }
373 
374  if(args.size() == 4)
375  {
376  if(args[3] == "true" || command_line::is_yes(args[3]) || args[3] == "1")
377  {
378  ignore_battery = true;
379  }
380  else if(args[3] != "false" && !command_line::is_no(args[3]) && args[3] != "0")
381  {
382  return false;
383  }
384  }
385 
386  if(args.size() >= 3)
387  {
388  if(args[2] == "true" || command_line::is_yes(args[2]) || args[2] == "1")
389  {
390  do_background_mining = true;
391  }
392  else if(args[2] != "false" && !command_line::is_no(args[2]) && args[2] != "0")
393  {
394  return false;
395  }
396  }
397 
398  if(args.size() >= 2)
399  {
400  if (args[1] == "auto" || args[1] == "autodetect")
401  {
402  threads_count = 0;
403  }
404  else
405  {
406  bool ok = epee::string_tools::get_xtype_from_string(threads_count, args[1]);
407  threads_count = (ok && 0 < threads_count) ? threads_count : 1;
408  }
409  }
410 
411  m_executor.start_mining(info.address, threads_count, nettype, do_background_mining, ignore_battery);
412 
413  return true;
414 }
415 
416 bool t_command_parser_executor::stop_mining(const std::vector<std::string>& args)
417 {
418  if (!args.empty()) return false;
419 
420  return m_executor.stop_mining();
421 }
422 
423 bool t_command_parser_executor::mining_status(const std::vector<std::string>& args)
424 {
425  return m_executor.mining_status();
426 }
427 
428 bool t_command_parser_executor::stop_daemon(const std::vector<std::string>& args)
429 {
430  if (!args.empty()) return false;
431 
432  return m_executor.stop_daemon();
433 }
434 
435 bool t_command_parser_executor::print_status(const std::vector<std::string>& args)
436 {
437  if (!args.empty()) return false;
438 
439  return m_executor.print_status();
440 }
441 
442 bool t_command_parser_executor::set_limit(const std::vector<std::string>& args)
443 {
444  if(args.size()>1) return false;
445  if(args.size()==0) {
446  return m_executor.get_limit();
447  }
448  int64_t limit;
449  try {
450  limit = std::stoll(args[0]);
451  }
452  catch(const std::exception& ex) {
453  std::cout << "failed to parse argument" << std::endl;
454  return false;
455  }
456 
457  return m_executor.set_limit(limit, limit);
458 }
459 
460 bool t_command_parser_executor::set_limit_up(const std::vector<std::string>& args)
461 {
462  if(args.size()>1) return false;
463  if(args.size()==0) {
464  return m_executor.get_limit_up();
465  }
466  int64_t limit;
467  try {
468  limit = std::stoll(args[0]);
469  }
470  catch(const std::exception& ex) {
471  std::cout << "failed to parse argument" << std::endl;
472  return false;
473  }
474 
475  return m_executor.set_limit(0, limit);
476 }
477 
478 bool t_command_parser_executor::set_limit_down(const std::vector<std::string>& args)
479 {
480  if(args.size()>1) return false;
481  if(args.size()==0) {
482  return m_executor.get_limit_down();
483  }
484  int64_t limit;
485  try {
486  limit = std::stoll(args[0]);
487  }
488  catch(const std::exception& ex) {
489  std::cout << "failed to parse argument" << std::endl;
490  return false;
491  }
492 
493  return m_executor.set_limit(limit, 0);
494 }
495 
496 bool t_command_parser_executor::out_peers(const std::vector<std::string>& args)
497 {
498  if (args.empty()) return false;
499 
500  unsigned int limit;
501  try {
502  limit = std::stoi(args[0]);
503  }
504 
505  catch(const std::exception& ex) {
506  _erro("stoi exception");
507  return false;
508  }
509 
510  return m_executor.out_peers(limit);
511 }
512 
513 bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
514 {
515  if (args.empty()) return false;
516 
517  unsigned int limit;
518  try {
519  limit = std::stoi(args[0]);
520  }
521 
522  catch(const std::exception& ex) {
523  _erro("stoi exception");
524  return false;
525  }
526 
527  return m_executor.in_peers(limit);
528 }
529 
530 bool t_command_parser_executor::start_save_graph(const std::vector<std::string>& args)
531 {
532  if (!args.empty()) return false;
533  return m_executor.start_save_graph();
534 }
535 
536 bool t_command_parser_executor::stop_save_graph(const std::vector<std::string>& args)
537 {
538  if (!args.empty()) return false;
539  return m_executor.stop_save_graph();
540 }
541 
542 bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& args)
543 {
544  int version;
545  if (args.size() == 0) {
546  version = 0;
547  }
548  else if (args.size() == 1) {
549  try {
550  version = std::stoi(args[0]);
551  }
552  catch(const std::exception& ex) {
553  return false;
554  }
555  if (version <= 0 || version > 255)
556  return false;
557  }
558  else {
559  return false;
560  }
561  return m_executor.hard_fork_info(version);
562 }
563 
564 bool t_command_parser_executor::show_bans(const std::vector<std::string>& args)
565 {
566  if (!args.empty()) return false;
567  return m_executor.print_bans();
568 }
569 
570 bool t_command_parser_executor::ban(const std::vector<std::string>& args)
571 {
572  if (args.size() != 1 && args.size() != 2) return false;
573  std::string ip = args[0];
574  time_t seconds = P2P_IP_BLOCKTIME;
575  if (args.size() > 1)
576  {
577  try
578  {
579  if(args[1] == "-1"){
580  seconds = std::numeric_limits<time_t>::max();
581  }
582  else{
583  seconds = std::stoi(args[1]);
584  }
585  }
586  catch (const std::exception &e)
587  {
588  return false;
589  }
590  if (seconds == 0)
591  {
592  return false;
593  }
594  }
595  return m_executor.ban(ip, seconds);
596 }
597 
598 bool t_command_parser_executor::unban(const std::vector<std::string>& args)
599 {
600  if (args.size() != 1) return false;
601  std::string ip = args[0];
602  return m_executor.unban(ip);
603 }
604 
605 bool t_command_parser_executor::flush_txpool(const std::vector<std::string>& args)
606 {
607  if (args.size() > 1) return false;
608 
609  std::string txid;
610  if (args.size() == 1)
611  {
613  if (!parse_hash256(args[0], hash))
614  {
615  std::cout << "failed to parse tx id" << std::endl;
616  return true;
617  }
618  txid = args[0];
619  }
620  return m_executor.flush_txpool(txid);
621 }
622 
623 bool t_command_parser_executor::output_histogram(const std::vector<std::string>& args)
624 {
625  std::vector<uint64_t> amounts;
626  uint64_t min_count = 3;
627  uint64_t max_count = 0;
628  size_t n_raw = 0;
629 
630  for (size_t n = 0; n < args.size(); ++n)
631  {
632  if (args[n][0] == '@')
633  {
634  amounts.push_back(boost::lexical_cast<uint64_t>(args[n].c_str() + 1));
635  }
636  else if (n_raw == 0)
637  {
638  min_count = boost::lexical_cast<uint64_t>(args[n]);
639  n_raw++;
640  }
641  else if (n_raw == 1)
642  {
643  max_count = boost::lexical_cast<uint64_t>(args[n]);
644  n_raw++;
645  }
646  else
647  {
648  std::cout << "Invalid syntax: more than two non-amount parameters" << std::endl;
649  return true;
650  }
651  }
652  return m_executor.output_histogram(amounts, min_count, max_count);
653 }
654 
655 bool t_command_parser_executor::print_coinbase_tx_sum(const std::vector<std::string>& args)
656 {
657  if(!args.size())
658  {
659  std::cout << "need block height parameter" << std::endl;
660  return false;
661  }
662  uint64_t height = 0;
663  uint64_t count = 0;
665  {
666  std::cout << "wrong starter block height parameter" << std::endl;
667  return false;
668  }
669  if(args.size() >1 && !epee::string_tools::get_xtype_from_string(count, args[1]))
670  {
671  std::cout << "wrong count parameter" << std::endl;
672  return false;
673  }
674 
675  return m_executor.print_coinbase_tx_sum(height, count);
676 }
677 
678 bool t_command_parser_executor::alt_chain_info(const std::vector<std::string>& args)
679 {
680  if(args.size() > 1)
681  {
682  std::cout << "usage: alt_chain_info [block_hash]" << std::endl;
683  return false;
684  }
685 
686  return m_executor.alt_chain_info(args.size() == 1 ? args[0] : "");
687 }
688 
689 bool t_command_parser_executor::print_blockchain_dynamic_stats(const std::vector<std::string>& args)
690 {
691  if(args.size() != 1)
692  {
693  std::cout << "Exactly one parameter is needed" << std::endl;
694  return false;
695  }
696 
697  uint64_t nblocks = 0;
698  if(!epee::string_tools::get_xtype_from_string(nblocks, args[0]) || nblocks == 0)
699  {
700  std::cout << "wrong number of blocks" << std::endl;
701  return false;
702  }
703 
704  return m_executor.print_blockchain_dynamic_stats(nblocks);
705 }
706 
707 bool t_command_parser_executor::update(const std::vector<std::string>& args)
708 {
709  if(args.size() != 1)
710  {
711  std::cout << "Exactly one parameter is needed: check, download, or update" << std::endl;
712  return false;
713  }
714 
715  return m_executor.update(args.front());
716 }
717 
718 bool t_command_parser_executor::relay_tx(const std::vector<std::string>& args)
719 {
720  if (args.size() != 1) return false;
721 
722  std::string txid;
724  if (!parse_hash256(args[0], hash))
725  {
726  std::cout << "failed to parse tx id" << std::endl;
727  return true;
728  }
729  txid = args[0];
730  return m_executor.relay_tx(txid);
731 }
732 
733 bool t_command_parser_executor::sync_info(const std::vector<std::string>& args)
734 {
735  if (args.size() != 0) return false;
736 
737  return m_executor.sync_info();
738 }
739 
740 bool t_command_parser_executor::pop_blocks(const std::vector<std::string>& args)
741 {
742  if (args.size() != 1)
743  {
744  std::cout << "Exactly one parameter is needed" << std::endl;
745  return false;
746  }
747 
748  try
749  {
750  uint64_t nblocks = boost::lexical_cast<uint64_t>(args[0]);
751  if (nblocks < 1)
752  {
753  std::cout << "number of blocks must be greater than 0" << std::endl;
754  return false;
755  }
756  return m_executor.pop_blocks(nblocks);
757  }
758  catch (const boost::bad_lexical_cast&)
759  {
760  std::cout << "number of blocks must be a number greater than 0" << std::endl;
761  }
762  return false;
763 }
764 
765 bool t_command_parser_executor::version(const std::vector<std::string>& args)
766 {
767  std::cout << "Electroneum '" << ELECTRONEUM_RELEASE_NAME << "' (v" << ELECTRONEUM_VERSION_FULL << ")" << std::endl;
768  return true;
769 }
770 
771 bool t_command_parser_executor::prune_blockchain(const std::vector<std::string>& args)
772 {
773  if (args.size() > 1) return false;
774 
775  if (args.empty() || args[0] != "confirm")
776  {
777  std::cout << "Warning: pruning from within electroneumd will not shrink the database file size." << std::endl;
778  std::cout << "Instead, parts of the file will be marked as free, so the file will not grow" << std::endl;
779  std::cout << "until that newly free space is used up. If you want a smaller file size now," << std::endl;
780  std::cout << "exit electroneumd and run electroneum-blockchain-prune (you will temporarily need more" << std::endl;
781  std::cout << "disk space for the database conversion though). If you are OK with the database" << std::endl;
782  std::cout << "file keeping the same size, re-run this command with the \"confirm\" parameter." << std::endl;
783  return true;
784  }
785 
786  return m_executor.prune_blockchain();
787 }
788 
789 bool t_command_parser_executor::check_blockchain_pruning(const std::vector<std::string>& args)
790 {
791  return m_executor.check_blockchain_pruning();
792 }
793 
794 bool t_command_parser_executor::set_validator_key(const std::vector<std::string>& args)
795 {
796  if(args.size() != 1) return false;
797 
798  std::string key(args[0]);
799 
800  bool is_validator_key_valid = std::count_if(key.begin(), key.end(), [](int c) {return !std::isxdigit(c);}) == 0;
801  if(!is_validator_key_valid || key.size() != 64) {
802  std::cout << "Failed to parse validator key (wrong format)." << std::endl;
803  return true;
804  }
805 
806  return m_executor.set_validator_key(key);
807 }
808 
809 bool t_command_parser_executor::generate_ed25519_keypair(const std::vector<std::string>& args)
810 {
811  if(args.size() != 0) return false;
812 
813  return m_executor.generate_ed25519_keypair();
814 }
815 
816 bool t_command_parser_executor::sign_message(const std::vector<std::string>& args)
817 {
818  if(args.size() != 2) return false;
819 
820  std::string key(args[0]);
821  return m_executor.sign_message(key, args[1]);
822 }
823 
824 } // namespace daemonize
uint64_t height
Definition: blockchain.cpp:91
bool show_bans(const std::vector< std::string > &args)
bool alt_chain_info(const std::vector< std::string > &args)
bool print_transaction_pool_long(const std::vector< std::string > &args)
bool version(const std::vector< std::string > &args)
bool print_peer_list(const std::vector< std::string > &args)
bool prune_blockchain(const std::vector< std::string > &args)
bool update(const std::vector< std::string > &args)
bool print_blockchain_info(const std::vector< std::string > &args)
bool generate_ed25519_keypair(const std::vector< std::string > &args)
bool set_validator_key(const std::vector< std::string > &args)
bool print_height(const std::vector< std::string > &args)
bool relay_tx(const std::vector< std::string > &args)
bool sync_info(const std::vector< std::string > &args)
bool print_peer_list_stats(const std::vector< std::string > &args)
t_command_parser_executor(uint32_t ip, uint16_t port, const boost::optional< tools::login > &login, const epee::net_utils::ssl_options_t &ssl_options, bool is_rpc, cryptonote::core_rpc_server *rpc_server=NULL)
bool stop_save_graph(const std::vector< std::string > &args)
bool set_limit_up(const std::vector< std::string > &args)
bool pop_blocks(const std::vector< std::string > &args)
bool ban(const std::vector< std::string > &args)
bool flush_txpool(const std::vector< std::string > &args)
bool out_peers(const std::vector< std::string > &args)
bool print_coinbase_tx_sum(const std::vector< std::string > &args)
bool check_blockchain_pruning(const std::vector< std::string > &args)
bool start_save_graph(const std::vector< std::string > &args)
bool show_difficulty(const std::vector< std::string > &args)
bool print_transaction_pool_short(const std::vector< std::string > &args)
bool output_histogram(const std::vector< std::string > &args)
bool print_transaction(const std::vector< std::string > &args)
bool is_key_image_spent(const std::vector< std::string > &args)
bool in_peers(const std::vector< std::string > &args)
bool hide_hash_rate(const std::vector< std::string > &args)
bool print_net_stats(const std::vector< std::string > &args)
bool print_blockchain_dynamic_stats(const std::vector< std::string > &args)
bool set_limit(const std::vector< std::string > &args)
bool mining_status(const std::vector< std::string > &args)
bool show_hash_rate(const std::vector< std::string > &args)
bool unban(const std::vector< std::string > &args)
bool print_connections(const std::vector< std::string > &args)
bool stop_daemon(const std::vector< std::string > &args)
bool stop_mining(const std::vector< std::string > &args)
bool sign_message(const std::vector< std::string > &args)
bool print_status(const std::vector< std::string > &args)
bool print_transaction_pool_stats(const std::vector< std::string > &args)
bool save_blockchain(const std::vector< std::string > &args)
bool show_status(const std::vector< std::string > &args)
bool set_log_level(const std::vector< std::string > &args)
bool set_limit_down(const std::vector< std::string > &args)
bool hard_fork_info(const std::vector< std::string > &args)
bool print_block(const std::vector< std::string > &args)
bool start_mining(const std::vector< std::string > &args)
bool set_limit(int64_t limit_down, int64_t limit_up)
bool ban(const std::string &ip, time_t seconds)
bool is_key_image_spent(const crypto::key_image &ki)
bool output_histogram(const std::vector< uint64_t > &amounts, uint64_t min_count, uint64_t max_count)
bool print_block_by_height(uint64_t height, bool include_hex)
bool print_transaction(crypto::hash transaction_hash, bool include_hex, bool include_json)
bool print_blockchain_info(uint64_t start_block_index, uint64_t end_block_index)
bool alt_chain_info(const std::string &tip)
bool set_validator_key(const std::string &key)
bool sign_message(const std::string privateKey, const std::string message)
bool print_blockchain_dynamic_stats(uint64_t nblocks)
bool start_mining(cryptonote::account_public_address address, uint64_t num_threads, cryptonote::network_type nettype, bool do_background_mining=false, bool ignore_battery=false)
bool print_coinbase_tx_sum(uint64_t height, uint64_t count)
bool print_peer_list(bool white=true, bool gray=true, size_t limit=0)
bool update(const std::string &command)
bool set_log_categories(const std::string &categories)
bool flush_txpool(const std::string &txid)
bool relay_tx(const std::string &txid)
bool print_block_by_hash(crypto::hash block_hash, bool include_hex)
bool parse_hash256(const std::string &str_hash, crypto::hash &hash)
#define P2P_IP_BLOCKTIME
void * memcpy(void *a, const void *b, size_t c)
const char * key
Definition: hmac_keccak.cpp:39
#define _erro(x)
Definition: misc_log_ex.h:113
bool is_no(const std::string &str)
bool is_yes(const std::string &str)
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS hash
Definition: hash.h:50
bool get_account_address_from_str(address_parse_info &info, network_type nettype, std::string const &str)
PUSH_WARNINGS bool get_xtype_from_string(OUT XType &val, const std::string &str_id)
Definition: string_tools.h:125
mdb_size_t count(MDB_cursor *cur)
::std::string string
Definition: gtest-port.h:1097
std::string get_account_address_as_str_from_url(const std::string &url, bool &dnssec_valid, std::function< std::string(const std::string &, const std::vector< std::string > &, bool)> dns_confirm)
Definition: dns_utils.cpp:479
scoped_message_writer fail_msg_writer()
boost::endian::big_uint16_t port
Definition: socks.cpp:60
boost::endian::big_uint32_t ip
Definition: socks.cpp:61
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91
unsigned short uint16_t
Definition: stdint.h:125
signed __int64 int64_t
Definition: stdint.h:135
unsigned int uint32_t
Definition: stdint.h:126
unsigned __int64 uint64_t
Definition: stdint.h:136
const char *const ELECTRONEUM_RELEASE_NAME
const char *const ELECTRONEUM_VERSION_FULL