Electroneum
core_rpc_server_commands_defs.h
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 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31 
32 #pragma once
33 
37 #include "crypto/hash.h"
38 #include "rpc/rpc_handler.h"
39 #include "common/varint.h"
40 #include "common/perf_timer.h"
41 
42 namespace {
43  template<typename T>
44  std::string compress_integer_array(const std::vector<T> &v) {
45  std::string s;
46  s.resize(v.size() * (sizeof(T) * 8 / 7 + 1));
47  char *ptr = (char *) s.data();
48  for (const T &t: v)
49  tools::write_varint(ptr, t);
50  s.resize(ptr - s.data());
51  return s;
52  }
53 
54  template<typename T>
55  std::vector<T> decompress_integer_array(const std::string &s) {
56  std::vector<T> v;
57  v.reserve(s.size());
58  int read = 0;
59  const std::string::const_iterator end = s.end();
60  for (std::string::const_iterator i = s.begin(); i != end; std::advance(i, read)) {
61  T t;
62  read = tools::read_varint(std::string::const_iterator(i), s.end(), t);
63  CHECK_AND_ASSERT_THROW_MES(read > 0 && read <= 256, "Error decompressing data");
64  v.push_back(t);
65  }
66  return v;
67  }
68 }
69 
70 namespace cryptonote {
71  //-----------------------------------------------
72 #define CORE_RPC_STATUS_OK "OK"
73 #define CORE_RPC_STATUS_BUSY "BUSY"
74 #define CORE_RPC_STATUS_NOT_MINING "NOT MINING"
75 
76 // When making *any* change here, bump minor
77 // If the change is incompatible, then bump major and set minor to 0
78 // This ensures CORE_RPC_VERSION always increases, that every change
79 // has its own version, and that clients can just test major to see
80 // whether they can talk to a given daemon without having to know in
81 // advance which version they will stop working with
82 // Don't go over 32767 for any of these
83 #define CORE_RPC_VERSION_MAJOR 2
84 #define CORE_RPC_VERSION_MINOR 6
85 #define MAKE_CORE_RPC_VERSION(major, minor) (((major)<<16)|(minor))
86 #define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)
87 
89  struct request_t {
92  };
93 
95 
96  struct response_t {
99  bool untrusted;
101 
108  };
109 
110  typedef epee::misc_utils::struct_init<response_t> response;
111  };
112 
114 
115  struct request_t {
116  std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
118  bool prune;
122  KV_SERIALIZE(start_height)
123  KV_SERIALIZE(prune)
124  KV_SERIALIZE_OPT(no_miner_tx, false)
126  };
127 
128  typedef epee::misc_utils::struct_init<request_t> request;
129 
131  std::vector<uint64_t> indices;
132 
134  KV_SERIALIZE(indices)
136  };
137 
139  std::vector<tx_output_indices> indices;
140 
142  KV_SERIALIZE(indices)
144  };
145 
146  struct response_t {
147  std::vector<block_complete_entry> blocks;
151  std::vector<block_output_indices> output_indices;
152  bool untrusted;
153 
156  KV_SERIALIZE(start_height)
157  KV_SERIALIZE(current_height)
159  KV_SERIALIZE(output_indices)
162  };
163 
164  typedef epee::misc_utils::struct_init<response_t> response;
165  };
166 
168  struct request_t {
169  std::vector<uint64_t> heights;
171  KV_SERIALIZE(heights)
173  };
174 
175  typedef epee::misc_utils::struct_init<request_t> request;
176 
177  struct response_t {
178  std::vector<block_complete_entry> blocks;
180  bool untrusted;
181 
187  };
188 
189  typedef epee::misc_utils::struct_init<response_t> response;
190  };
191 
193  struct request_t {
196  };
197 
199 
200  struct response_t {
201  std::vector<std::string> blks_hashes;
203  bool untrusted;
204 
206  KV_SERIALIZE(blks_hashes)
210  };
211 
212  typedef epee::misc_utils::struct_init<response_t> response;
213  };
215 
216  struct request_t {
217  std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
221  KV_SERIALIZE(start_height)
223  };
224 
225  typedef epee::misc_utils::struct_init<request_t> request;
226 
227  struct response_t {
228  std::vector<crypto::hash> m_block_ids;
232  bool untrusted;
233 
236  KV_SERIALIZE(start_height)
237  KV_SERIALIZE(current_height)
241  };
242 
243  typedef epee::misc_utils::struct_init<response_t> response;
244  };
245 
246  //-----------------------------------------------
248  struct request_t {
249  std::vector<std::string> amounts;
251 
253  KV_SERIALIZE(amounts)
256  };
257 
258  typedef epee::misc_utils::struct_init<request_t> request;
259 
260 
261  struct output {
264  std::string rct; // 64+64+64 characters long (<rct commit> + <encrypted mask> + <rct amount>)
265 
268  KV_SERIALIZE(global_index)
271  };
272 
273  struct amount_out {
275  std::vector<output> outputs;
277  KV_SERIALIZE(amount)
278  KV_SERIALIZE(outputs)
280 
281  };
282 
283  struct response_t {
284  std::vector<amount_out> amount_outs;
287  KV_SERIALIZE(amount_outs)
288  KV_SERIALIZE(Error)
290  };
291 
292  typedef epee::misc_utils::struct_init<response_t> response;
293  };
294  //-----------------------------------------------
296  struct request_t {
300 
303  KV_SERIALIZE(view_key)
304  KV_SERIALIZE(tx)
306  };
307 
308  typedef epee::misc_utils::struct_init<request_t> request;
309 
310 
311  struct response_t {
314 
319  };
320 
321  typedef epee::misc_utils::struct_init<response_t> response;
322  };
323  //-----------------------------------------------
325  struct request_t {
326  std::vector<std::string> txs_hashes;
328  bool prune;
329  bool split;
330 
332  KV_SERIALIZE(txs_hashes)
333  KV_SERIALIZE(decode_as_json)
334  KV_SERIALIZE_OPT(prune, false)
335  KV_SERIALIZE_OPT(split, false)
337  };
338 
339  typedef epee::misc_utils::struct_init<request_t> request;
340 
341  struct entry {
348  bool in_pool;
352  std::vector<uint64_t> output_indices;
353  bool relayed;
355 
357  KV_SERIALIZE(tx_hash)
358  KV_SERIALIZE(as_hex)
359  KV_SERIALIZE(pruned_as_hex)
360  KV_SERIALIZE(prunable_as_hex)
361  KV_SERIALIZE(prunable_hash)
362  KV_SERIALIZE(as_json)
363  KV_SERIALIZE(in_pool)
364  KV_SERIALIZE(double_spend_seen)
365  if (!this_ref.in_pool) {
366  KV_SERIALIZE(block_height)
367  KV_SERIALIZE(block_timestamp)
368  KV_SERIALIZE(output_indices)
369  } else {
370  KV_SERIALIZE(relayed)
371  }
372  KV_SERIALIZE(nonexistent_utxo_seen)
374  };
375 
376  struct response_t {
377  // older compatibility stuff
378  std::vector<std::string> txs_as_hex; //transactions blobs as hex (old compat)
379  std::vector<std::string> txs_as_json; //transactions decoded as json (old compat)
380 
381  // in both old and new
382  std::vector<std::string> missed_tx; //not found transactions
383 
384  // new style
385  std::vector<entry> txs;
387  bool untrusted;
388 
390  KV_SERIALIZE(txs_as_hex)
391  KV_SERIALIZE(txs_as_json)
392  KV_SERIALIZE(txs)
393  KV_SERIALIZE(missed_tx)
397  };
398 
399  typedef epee::misc_utils::struct_init<response_t> response;
400  };
401 
402  //-----------------------------------------------
404  UNSPENT = 0,
407  };
408  //-----------------------------------------------
411 
412  struct request_t {
413  std::vector<std::string> key_images;
414 
416  KV_SERIALIZE(key_images)
418  };
419 
420  typedef epee::misc_utils::struct_init<request_t> request;
421 
422 
423  struct response_t {
424  std::vector<u_int> spent_status;
426  bool untrusted;
427 
429  KV_SERIALIZE(spent_status)
433  };
434 
435  typedef epee::misc_utils::struct_init<response_t> response;
436  };
437 
438  //-----------------------------------------------
439 
440  struct public_output {
444 
446  KV_SERIALIZE(txid)
447  KV_SERIALIZE(relative_out_index)
448  KV_SERIALIZE(amount)
450  };
451 
454 
455  struct request_t { // pairs of tx hash and relative out index which identify chainstate UTXOs uniquely
456  std::vector<public_output> public_outputs;
457 
459  KV_SERIALIZE(public_outputs)
461  };
462 
463  typedef epee::misc_utils::struct_init<request_t> request;
464 
465 
466  struct response_t {
467  std::vector<u_int> spent_status;
469  bool untrusted;
470 
472  KV_SERIALIZE(spent_status)
476  };
477 
478  typedef epee::misc_utils::struct_init<response_t> response;
479  };
480 
481  //-----------------------------------------------
483  struct request_t {
488  };
489 
490  typedef epee::misc_utils::struct_init<request_t> request;
491 
492 
493  struct response_t {
494  std::vector<uint64_t> o_indexes;
496  bool untrusted;
498  KV_SERIALIZE(o_indexes)
502  };
503 
504  typedef epee::misc_utils::struct_init<response_t> response;
505  };
506 
507  //-----------------------------------------------
511 
513  KV_SERIALIZE(amount)
514  KV_SERIALIZE(index)
516  };
517 
519  struct request_t {
520  std::vector<get_outputs_out> outputs;
521  bool get_txid;
522 
524  KV_SERIALIZE(outputs)
525  KV_SERIALIZE_OPT(get_txid, true)
527  };
528 
529  typedef epee::misc_utils::struct_init<request_t> request;
530 
531  struct outkey {
534  bool unlocked;
537 
541  KV_SERIALIZE(unlocked)
545  };
546 
547  struct response_t {
548  std::vector<outkey> outs;
550  bool untrusted;
551 
553  KV_SERIALIZE(outs)
557  };
558 
559  typedef epee::misc_utils::struct_init<response_t> response;
560  };
561  //-----------------------------------------------
563  struct request_t {
564  std::vector<get_outputs_out> outputs;
565  bool get_txid;
566 
568  KV_SERIALIZE(outputs)
569  KV_SERIALIZE(get_txid)
571  };
572 
573  typedef epee::misc_utils::struct_init<request_t> request;
574 
575  struct outkey {
578  bool unlocked;
581 
584  KV_SERIALIZE(mask)
585  KV_SERIALIZE(unlocked)
587  KV_SERIALIZE(txid)
589  };
590 
591  struct response_t {
592  std::vector<outkey> outs;
594  bool untrusted;
595 
597  KV_SERIALIZE(outs)
601  };
602 
603  typedef epee::misc_utils::struct_init<response_t> response;
604  };
605  //-----------------------------------------------
607  struct request_t {
611 
613  KV_SERIALIZE(tx_as_hex)
614  KV_SERIALIZE_OPT(do_not_relay, false)
615  KV_SERIALIZE_OPT(do_sanity_checks, true)
617  };
618 
619  typedef epee::misc_utils::struct_init<request_t> request;
620 
621 
622  struct response_t {
626  bool low_mixin;
630  bool too_big;
631  bool overspend;
633  bool not_rct;
635  bool untrusted;
636 
639  KV_SERIALIZE(reason)
640  KV_SERIALIZE(not_relayed)
641  KV_SERIALIZE(low_mixin)
642  KV_SERIALIZE(double_spend)
643  KV_SERIALIZE(invalid_input)
644  KV_SERIALIZE(invalid_output)
645  KV_SERIALIZE(too_big)
646  KV_SERIALIZE(overspend)
647  KV_SERIALIZE(fee_too_low)
648  KV_SERIALIZE(not_rct)
649  KV_SERIALIZE(sanity_check_failed)
652  };
653 
654  typedef epee::misc_utils::struct_init<response_t> response;
655  };
656  //-----------------------------------------------
658  struct request_t {
663 
665  KV_SERIALIZE(miner_address)
666  KV_SERIALIZE(threads_count)
667  KV_SERIALIZE(do_background_mining)
668  KV_SERIALIZE(ignore_battery)
670  };
671 
672  typedef epee::misc_utils::struct_init<request_t> request;
673 
674  struct response_t {
676 
680  };
681 
682  typedef epee::misc_utils::struct_init<response_t> response;
683  };
684  //-----------------------------------------------
686  struct request_t {
687 
690  };
691 
693 
694  struct response_t {
710  bool mainnet;
711  bool testnet;
712  bool stagenet;
724  bool offline;
725  bool untrusted;
732 
737 
741  KV_SERIALIZE(target_height)
742  KV_SERIALIZE(difficulty)
743  KV_SERIALIZE(wide_difficulty)
744  KV_SERIALIZE(difficulty_top64)
745  KV_SERIALIZE(target)
746  KV_SERIALIZE(tx_count)
747  KV_SERIALIZE(tx_pool_size)
748  KV_SERIALIZE(alt_blocks_count)
749  KV_SERIALIZE(outgoing_connections_count)
750  KV_SERIALIZE(incoming_connections_count)
751  KV_SERIALIZE(rpc_connections_count)
752  KV_SERIALIZE(white_peerlist_size)
753  KV_SERIALIZE(grey_peerlist_size)
754  KV_SERIALIZE(mainnet)
755  KV_SERIALIZE(testnet)
756  KV_SERIALIZE(stagenet)
757  KV_SERIALIZE(nettype)
758  KV_SERIALIZE(top_block_hash)
759  KV_SERIALIZE(cumulative_difficulty)
760  KV_SERIALIZE(wide_cumulative_difficulty)
761  KV_SERIALIZE(cumulative_difficulty_top64)
762  KV_SERIALIZE(block_size_limit)
763  KV_SERIALIZE_OPT(block_weight_limit, (uint64_t) 0)
764  KV_SERIALIZE(block_size_median)
765  KV_SERIALIZE_OPT(block_weight_median, (uint64_t) 0)
766  KV_SERIALIZE(start_time)
767  KV_SERIALIZE(free_space)
768  KV_SERIALIZE(offline)
770  KV_SERIALIZE(bootstrap_daemon_address)
771  KV_SERIALIZE(height_without_bootstrap)
772  KV_SERIALIZE(was_bootstrap_ever_used)
773  KV_SERIALIZE(database_size)
774  KV_SERIALIZE(update_available)
776 
777  KV_SERIALIZE(daemon_release_name)
778  KV_SERIALIZE(daemon_version)
779  KV_SERIALIZE(daemon_version_full)
780  KV_SERIALIZE(daemon_version_tag)
782  };
783 
784  typedef epee::misc_utils::struct_init<response_t> response;
785  };
786 
787 
788  //-----------------------------------------------
790  struct request_t {
791 
794  };
795 
797 
798 
799  struct response_t {
806 
809  KV_SERIALIZE(start_time)
810  KV_SERIALIZE(total_packets_in)
811  KV_SERIALIZE(total_bytes_in)
812  KV_SERIALIZE(total_packets_out)
813  KV_SERIALIZE(total_bytes_out)
815  };
816 
817  typedef epee::misc_utils::struct_init<response_t> response;
818  };
819 
820  //-----------------------------------------------
822  struct request_t {
823 
826  };
827 
829 
830 
831  struct response_t {
833 
837  };
838 
839  typedef epee::misc_utils::struct_init<response_t> response;
840  };
841 
842  //-----------------------------------------------
844  struct request_t {
845 
848  };
849 
851 
852 
853  struct response_t {
855  bool active;
870 
873  KV_SERIALIZE(active)
874  KV_SERIALIZE(speed)
875  KV_SERIALIZE(threads_count)
877  KV_SERIALIZE(pow_algorithm)
878  KV_SERIALIZE(is_background_mining_enabled)
879  KV_SERIALIZE(bg_idle_threshold)
880  KV_SERIALIZE(bg_min_idle_seconds)
881  KV_SERIALIZE(bg_ignore_battery)
882  KV_SERIALIZE(bg_target)
883  KV_SERIALIZE(block_target)
884  KV_SERIALIZE(block_reward)
885  KV_SERIALIZE(difficulty)
886  KV_SERIALIZE(wide_difficulty)
887  KV_SERIALIZE(difficulty_top64)
889  };
890 
891  typedef epee::misc_utils::struct_init<response_t> response;
892  };
893 
894  //-----------------------------------------------
896  struct request_t {
897 
900  };
901 
903 
904 
905  struct response_t {
907 
911  };
912 
913  typedef epee::misc_utils::struct_init<response_t> response;
914  };
915 
916  //
918  typedef std::list<std::string> request;
919 
920  struct response_t {
923 
928  };
929 
930  typedef epee::misc_utils::struct_init<response_t> response;
931  };
932 
934  typedef std::vector<uint64_t> request;
935 
937  };
938 
939 
941  struct request_t {
942  uint64_t reserve_size; //max 255 bytes
945 
947  KV_SERIALIZE(reserve_size)
948  KV_SERIALIZE(wallet_address)
949  KV_SERIALIZE(prev_block)
951  };
952 
953  typedef epee::misc_utils::struct_init<request_t> request;
954 
955  struct response_t {
966  bool untrusted;
967 
969  KV_SERIALIZE(difficulty)
970  KV_SERIALIZE(wide_difficulty)
971  KV_SERIALIZE(difficulty_top64)
973  KV_SERIALIZE(reserved_offset)
974  KV_SERIALIZE(expected_reward)
975  KV_SERIALIZE(prev_hash)
976  KV_SERIALIZE(blocktemplate_blob)
977  KV_SERIALIZE(blockhashing_blob)
981  };
982 
983  typedef epee::misc_utils::struct_init<response_t> response;
984  };
985 
987  typedef std::vector<std::string> request;
988 
989  struct response_t {
991 
995  };
996 
997  typedef epee::misc_utils::struct_init<response_t> response;
998  };
999 
1001  struct request_t {
1006 
1008  KV_SERIALIZE(amount_of_blocks)
1009  KV_SERIALIZE(wallet_address)
1010  KV_SERIALIZE(prev_block)
1011  KV_SERIALIZE_OPT(starting_nonce, (uint32_t) 0)
1013  };
1014 
1015  typedef epee::misc_utils::struct_init<request_t> request;
1016 
1017  struct response_t {
1019  std::vector<std::string> blocks;
1021 
1027  };
1028 
1029  typedef epee::misc_utils::struct_init<response_t> response;
1030  };
1031 
1055 
1057  KV_SERIALIZE(major_version)
1058  KV_SERIALIZE(minor_version)
1059  KV_SERIALIZE(timestamp)
1060  KV_SERIALIZE(prev_hash)
1061  KV_SERIALIZE(nonce)
1062  KV_SERIALIZE(orphan_status)
1064  KV_SERIALIZE(depth)
1066  KV_SERIALIZE(difficulty)
1067  KV_SERIALIZE(wide_difficulty)
1068  KV_SERIALIZE(difficulty_top64)
1069  KV_SERIALIZE(cumulative_difficulty)
1070  KV_SERIALIZE(wide_cumulative_difficulty)
1071  KV_SERIALIZE(cumulative_difficulty_top64)
1072  KV_SERIALIZE(reward)
1073  KV_SERIALIZE(block_size)
1074  KV_SERIALIZE_OPT(block_weight, (uint64_t) 0)
1075  KV_SERIALIZE(num_txes)
1076  KV_SERIALIZE(pow_hash)
1077  KV_SERIALIZE_OPT(long_term_weight, (uint64_t) 0)
1078  KV_SERIALIZE(miner_tx_hash)
1080  };
1081 
1083  struct request_t {
1085 
1087  KV_SERIALIZE_OPT(fill_pow_hash, false);
1089  };
1090 
1091  typedef epee::misc_utils::struct_init<request_t> request;
1092 
1093  struct response_t {
1097 
1103  };
1104 
1105  typedef epee::misc_utils::struct_init<response_t> response;
1106 
1107  };
1108 
1110  struct request_t {
1113 
1116  KV_SERIALIZE_OPT(fill_pow_hash, false);
1118  };
1119 
1120  typedef epee::misc_utils::struct_init<request_t> request;
1121 
1122  struct response_t {
1126 
1132  };
1133 
1134  typedef epee::misc_utils::struct_init<response_t> response;
1135  };
1136 
1138  struct request_t {
1141 
1144  KV_SERIALIZE_OPT(fill_pow_hash, false);
1146  };
1147 
1148  typedef epee::misc_utils::struct_init<request_t> request;
1149 
1150  struct response_t {
1154 
1160  };
1161 
1162  typedef epee::misc_utils::struct_init<response_t> response;
1163  };
1164 
1166  struct request_t {
1170 
1174  KV_SERIALIZE_OPT(fill_pow_hash, false);
1176  };
1177 
1178  typedef epee::misc_utils::struct_init<request_t> request;
1179 
1180  struct response_t {
1184  std::vector<std::string> tx_hashes;
1188 
1191  KV_SERIALIZE(miner_tx_hash)
1192  KV_SERIALIZE(tx_hashes)
1194  KV_SERIALIZE(blob)
1198  };
1199 
1200  typedef epee::misc_utils::struct_init<response_t> response;
1201  };
1202 
1203  struct peer {
1211 
1212  peer() = default;
1213 
1214  peer(uint64_t id, const std::string &host, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
1215  : id(id), host(host), ip(0), port(0), rpc_port(rpc_port), last_seen(last_seen),
1216  pruning_seed(pruning_seed) {}
1217 
1218  peer(uint64_t id, uint32_t ip, uint16_t port, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
1219  : id(id), host(std::to_string(ip)), ip(ip), port(port), rpc_port(rpc_port), last_seen(last_seen),
1220  pruning_seed(pruning_seed) {}
1221 
1223  KV_SERIALIZE(id)
1224  KV_SERIALIZE(host)
1225  KV_SERIALIZE(ip)
1227  KV_SERIALIZE_OPT(rpc_port, (uint16_t) 0)
1228  KV_SERIALIZE(last_seen)
1229  KV_SERIALIZE_OPT(pruning_seed, (uint32_t) 0)
1231  };
1232 
1234  struct request_t {
1237  };
1238 
1240 
1241  struct response_t {
1243  std::vector<peer> white_list;
1244  std::vector<peer> gray_list;
1245 
1248  KV_SERIALIZE(white_list)
1249  KV_SERIALIZE(gray_list)
1251  };
1252 
1253  typedef epee::misc_utils::struct_init<response_t> response;
1254  };
1255 
1257  struct request_t {
1258  bool visible;
1259 
1261  KV_SERIALIZE(visible)
1263  };
1264 
1265  typedef epee::misc_utils::struct_init<request_t> request;
1266 
1267  struct response_t {
1272  };
1273 
1274  typedef epee::misc_utils::struct_init<response_t> response;
1275  };
1276 
1278  struct request_t {
1280 
1282  KV_SERIALIZE(level)
1284  };
1285 
1286  typedef epee::misc_utils::struct_init<request_t> request;
1287 
1288  struct response_t {
1293  };
1294 
1295  typedef epee::misc_utils::struct_init<response_t> response;
1296  };
1297 
1299  struct request_t {
1301 
1303  KV_SERIALIZE(categories)
1305  };
1306 
1307  typedef epee::misc_utils::struct_init<request_t> request;
1308 
1309  struct response_t {
1312 
1315  KV_SERIALIZE(categories)
1317  };
1318 
1319  typedef epee::misc_utils::struct_init<response_t> response;
1320  };
1321 
1322  struct tx_info {
1324  std::string tx_json; // TODO - expose this data directly
1334  bool relayed;
1340 
1342  KV_SERIALIZE(id_hash)
1343  KV_SERIALIZE(tx_json)
1344  KV_SERIALIZE(blob_size)
1345  KV_SERIALIZE_OPT(weight, (uint64_t) 0)
1346  KV_SERIALIZE(fee)
1347  KV_SERIALIZE(max_used_block_id_hash)
1348  KV_SERIALIZE(max_used_block_height)
1349  KV_SERIALIZE(kept_by_block)
1350  KV_SERIALIZE(last_failed_height)
1351  KV_SERIALIZE(last_failed_id_hash)
1352  KV_SERIALIZE(receive_time)
1353  KV_SERIALIZE(relayed)
1354  KV_SERIALIZE(last_relayed_time)
1355  KV_SERIALIZE(do_not_relay)
1356  KV_SERIALIZE(double_spend_seen)
1357  KV_SERIALIZE(tx_blob)
1358  KV_SERIALIZE(nonexistent_utxo_seen)
1360  };
1361 
1364  std::vector<std::string> txs_hashes;
1365 
1367  KV_SERIALIZE(id_hash)
1368  KV_SERIALIZE(txs_hashes)
1370  };
1371 
1373  struct request_t {
1376  };
1377 
1379 
1380  struct response_t {
1382  std::vector<tx_info> transactions;
1383  std::vector<spent_key_image_info> spent_key_images;
1385 
1388  KV_SERIALIZE(transactions)
1389  KV_SERIALIZE(spent_key_images)
1392  };
1393 
1394  typedef epee::misc_utils::struct_init<response_t> response;
1395  };
1396 
1398  struct request_t {
1401  };
1402 
1404 
1405  struct response_t {
1407  std::vector<crypto::hash> tx_hashes;
1409 
1415  };
1416 
1417  typedef epee::misc_utils::struct_init<response_t> response;
1418  };
1419 
1421  struct request_t {
1424  };
1425 
1427 
1428  struct response_t {
1430  std::vector<std::string> tx_hashes;
1432 
1435  KV_SERIALIZE(tx_hashes)
1438  };
1439 
1440  typedef epee::misc_utils::struct_init<response_t> response;
1441  };
1442 
1447  };
1448 
1450  struct request_t {
1453  };
1454 
1456 
1457  struct response_t {
1459  std::vector<tx_backlog_entry> backlog;
1461 
1467  };
1468 
1469  typedef epee::misc_utils::struct_init<response_t> response;
1470  };
1471 
1472  struct txpool_histo {
1475 
1477  KV_SERIALIZE(txs)
1478  KV_SERIALIZE(bytes)
1480  };
1481 
1482  struct txpool_stats {
1494  std::vector<txpool_histo> histo;
1497 
1498  txpool_stats() : bytes_total(0), bytes_min(0), bytes_max(0), bytes_med(0), fee_total(0), oldest(0),
1499  txs_total(0), num_failing(0), num_10m(0), num_not_relayed(0), histo_98pc(0),
1500  num_double_spends(0), num_nonexistent_utxos(0) {}
1501 
1503  KV_SERIALIZE(bytes_total)
1504  KV_SERIALIZE(bytes_min)
1505  KV_SERIALIZE(bytes_max)
1506  KV_SERIALIZE(bytes_med)
1507  KV_SERIALIZE(fee_total)
1508  KV_SERIALIZE(oldest)
1509  KV_SERIALIZE(txs_total)
1510  KV_SERIALIZE(num_failing)
1511  KV_SERIALIZE(num_10m)
1512  KV_SERIALIZE(num_not_relayed)
1513  KV_SERIALIZE(histo_98pc)
1515  KV_SERIALIZE(num_double_spends)
1516  KV_SERIALIZE(num_nonexistent_utxos)
1518  };
1519 
1521  struct request_t {
1524  };
1525 
1527 
1528  struct response_t {
1532 
1535  KV_SERIALIZE(pool_stats)
1538  };
1539 
1540  typedef epee::misc_utils::struct_init<response_t> response;
1541  };
1542 
1544  struct request_t {
1547  KV_SERIALIZE(etn_address)
1549  };
1550 
1551  typedef epee::misc_utils::struct_init<request_t> request;
1552 
1553  struct response_t {
1556 
1558  KV_SERIALIZE(balance)
1561  };
1562 
1563  typedef epee::misc_utils::struct_init<response_t> response;
1564  };
1565 
1567  struct request_t {
1571  bool desc;
1573  KV_SERIALIZE(etn_address)
1574  KV_SERIALIZE(start_out_id)
1575  KV_SERIALIZE(batch_size)
1576  KV_SERIALIZE_OPT(desc, false);
1578  };
1579 
1580  typedef epee::misc_utils::struct_init<request_t> request;
1581 
1582  struct response_t {
1586  std::vector<std::string> txs;
1587 
1590  KV_SERIALIZE(next_out_id)
1591  KV_SERIALIZE(last_page)
1592  KV_SERIALIZE(txs)
1594  };
1595 
1596  typedef epee::misc_utils::struct_init<response_t> response;
1597  };
1598 
1600  struct request_t {
1604  bool desc;
1606  KV_SERIALIZE(etn_address)
1607  KV_SERIALIZE(start_addr_tx_id)
1608  KV_SERIALIZE(batch_size)
1609  KV_SERIALIZE_OPT(desc, false);
1611  };
1612 
1613  typedef epee::misc_utils::struct_init<request_t> request;
1614 
1615  struct response_t {
1619  std::vector<std::string> txs;
1620 
1623  KV_SERIALIZE(next_addr_tx_id)
1624  KV_SERIALIZE(last_page)
1625  KV_SERIALIZE(txs)
1627  };
1628 
1629  typedef epee::misc_utils::struct_init<response_t> response;
1630  };
1631 
1633  struct request_t {
1636  };
1637 
1639 
1640  struct response_t {
1642  std::list<connection_info> connections;
1643 
1646  KV_SERIALIZE(connections)
1648  };
1649 
1650  typedef epee::misc_utils::struct_init<response_t> response;
1651  };
1652 
1654  struct request_t {
1658 
1660  KV_SERIALIZE(start_height)
1661  KV_SERIALIZE(end_height)
1662  KV_SERIALIZE_OPT(fill_pow_hash, false);
1664  };
1665 
1666  typedef epee::misc_utils::struct_init<request_t> request;
1667 
1668  struct response_t {
1670  std::vector<block_header_response> headers;
1672 
1675  KV_SERIALIZE(headers)
1678  };
1679 
1680  typedef epee::misc_utils::struct_init<response_t> response;
1681  };
1682 
1684  struct request_t {
1687  };
1688 
1690 
1691  struct response_t {
1693 
1697  };
1698 
1699  typedef epee::misc_utils::struct_init<response_t> response;
1700  };
1701 
1703  struct request_t {
1706  };
1707 
1709 
1710  struct response_t {
1712 
1716  };
1717 
1718  typedef epee::misc_utils::struct_init<response_t> response;
1719  };
1720 
1722  struct request_t {
1725  };
1726 
1728 
1729  struct response_t {
1734 
1737  KV_SERIALIZE(limit_up)
1738  KV_SERIALIZE(limit_down)
1741  };
1742 
1743  typedef epee::misc_utils::struct_init<response_t> response;
1744  };
1745 
1747  struct request_t {
1748  int64_t limit_down; // all limits (for get and set) are kB/s
1750 
1752  KV_SERIALIZE(limit_down)
1753  KV_SERIALIZE(limit_up)
1755  };
1756 
1757  typedef epee::misc_utils::struct_init<request_t> request;
1758 
1759  struct response_t {
1763 
1766  KV_SERIALIZE(limit_up)
1767  KV_SERIALIZE(limit_down)
1769  };
1770 
1771  typedef epee::misc_utils::struct_init<response_t> response;
1772  };
1773 
1775  struct request_t {
1778  KV_SERIALIZE(out_peers)
1780  };
1781 
1782  typedef epee::misc_utils::struct_init<request_t> request;
1783 
1784  struct response_t {
1786 
1790  };
1791 
1792  typedef epee::misc_utils::struct_init<response_t> response;
1793  };
1794 
1796  struct request_t {
1799  KV_SERIALIZE(in_peers)
1801  };
1802 
1803  typedef epee::misc_utils::struct_init<request_t> request;
1804 
1805  struct response_t {
1807 
1811  };
1812 
1813  typedef epee::misc_utils::struct_init<response_t> response;
1814  };
1815 
1817  struct request_t {
1820  };
1821 
1823 
1824  struct response_t {
1826 
1830  };
1831 
1832  typedef epee::misc_utils::struct_init<response_t> response;
1833  };
1834 
1836  struct request_t {
1839  };
1840 
1842 
1843  struct response_t {
1845 
1849  };
1850 
1851  typedef epee::misc_utils::struct_init<response_t> response;
1852  };
1853 
1855  struct request_t {
1857 
1861  };
1862 
1863  typedef epee::misc_utils::struct_init<request_t> request;
1864 
1865  struct response_t {
1867  bool enabled;
1876 
1879  KV_SERIALIZE(enabled)
1880  KV_SERIALIZE(window)
1881  KV_SERIALIZE(votes)
1883  KV_SERIALIZE(voting)
1885  KV_SERIALIZE(earliest_height)
1889  };
1890 
1891  typedef epee::misc_utils::struct_init<response_t> response;
1892  };
1893 
1895  struct ban {
1899 
1901  KV_SERIALIZE(host)
1902  KV_SERIALIZE(ip)
1903  KV_SERIALIZE(seconds)
1905  };
1906 
1907  struct request_t {
1910  };
1911 
1913 
1914  struct response_t {
1916  std::vector<ban> bans;
1917 
1920  KV_SERIALIZE(bans)
1922  };
1923 
1924  typedef epee::misc_utils::struct_init<response_t> response;
1925  };
1926 
1928  struct ban {
1931  bool ban;
1933 
1935  KV_SERIALIZE(host)
1936  KV_SERIALIZE(ip)
1937  KV_SERIALIZE(ban)
1938  KV_SERIALIZE(seconds)
1940  };
1941 
1942  struct request_t {
1943  std::vector<ban> bans;
1944 
1946  KV_SERIALIZE(bans)
1948  };
1949 
1950  typedef epee::misc_utils::struct_init<request_t> request;
1951 
1952  struct response_t {
1954 
1958  };
1959 
1960  typedef epee::misc_utils::struct_init<response_t> response;
1961  };
1962 
1964  struct request_t {
1965  std::vector<std::string> txids;
1966 
1968  KV_SERIALIZE(txids)
1970  };
1971 
1972  typedef epee::misc_utils::struct_init<request_t> request;
1973 
1974  struct response_t {
1976 
1980  };
1981 
1982  typedef epee::misc_utils::struct_init<response_t> response;
1983  };
1984 
1986  struct request_t {
1987  std::vector<uint64_t> amounts;
1990  bool unlocked;
1992 
1994  KV_SERIALIZE(amounts);
1995  KV_SERIALIZE(min_count);
1996  KV_SERIALIZE(max_count);
1997  KV_SERIALIZE(unlocked);
1998  KV_SERIALIZE(recent_cutoff);
2000  };
2001 
2002  typedef epee::misc_utils::struct_init<request_t> request;
2003 
2004  struct entry {
2009 
2011  KV_SERIALIZE(amount);
2012  KV_SERIALIZE(total_instances);
2013  KV_SERIALIZE(unlocked_instances);
2014  KV_SERIALIZE(recent_instances);
2016 
2017  entry(uint64_t amount, uint64_t total_instances, uint64_t unlocked_instances, uint64_t recent_instances) :
2018  amount(amount), total_instances(total_instances), unlocked_instances(unlocked_instances),
2019  recent_instances(recent_instances) {}
2020 
2021  entry() {}
2022  };
2023 
2024  struct response_t {
2026  std::vector<entry> histogram;
2028 
2031  KV_SERIALIZE(histogram)
2034  };
2035 
2036  typedef epee::misc_utils::struct_init<response_t> response;
2037  };
2038 
2040  struct request_t {
2043  };
2044 
2046 
2047  struct response_t {
2051 
2057  };
2058 
2059  typedef epee::misc_utils::struct_init<response_t> response;
2060  };
2061 
2063  struct request_t {
2066 
2071  };
2072 
2073  typedef epee::misc_utils::struct_init<request_t> request;
2074 
2075  struct response_t {
2079 
2082  KV_SERIALIZE(emission_amount)
2083  KV_SERIALIZE(fee_amount)
2085  };
2086 
2087  typedef epee::misc_utils::struct_init<response_t> response;
2088  };
2089 
2091  struct request_t {
2093 
2095  KV_SERIALIZE(grace_blocks)
2097  };
2098 
2099  typedef epee::misc_utils::struct_init<request_t> request;
2100 
2101  struct response_t {
2106 
2109  KV_SERIALIZE(fee)
2110  KV_SERIALIZE_OPT(quantization_mask, (uint64_t) 1)
2113  };
2114 
2115  typedef epee::misc_utils::struct_init<response_t> response;
2116  };
2117 
2119  struct request_t {
2122  };
2123 
2125 
2126  struct chain_info {
2133  std::vector<std::string> block_hashes;
2135 
2137  KV_SERIALIZE(block_hash)
2139  KV_SERIALIZE(length)
2140  KV_SERIALIZE(difficulty)
2141  KV_SERIALIZE(wide_difficulty)
2142  KV_SERIALIZE(difficulty_top64)
2143  KV_SERIALIZE(block_hashes)
2144  KV_SERIALIZE(main_chain_parent_block)
2146  };
2147 
2148  struct response_t {
2150  std::list<chain_info> chains;
2151 
2154  KV_SERIALIZE(chains)
2156  };
2157 
2158  typedef epee::misc_utils::struct_init<response_t> response;
2159  };
2160 
2162  struct request_t {
2165 
2167  KV_SERIALIZE(command);
2168  KV_SERIALIZE(path);
2170  };
2171 
2172  typedef epee::misc_utils::struct_init<request_t> request;
2173 
2174  struct response_t {
2176  bool update;
2182 
2185  KV_SERIALIZE(update)
2187  KV_SERIALIZE(user_uri)
2188  KV_SERIALIZE(auto_uri)
2190  KV_SERIALIZE(path)
2192  };
2193 
2194  typedef epee::misc_utils::struct_init<response_t> response;
2195  };
2196 
2198  struct request_t {
2199  std::vector<std::string> txids;
2200 
2202  KV_SERIALIZE(txids)
2204  };
2205 
2206  typedef epee::misc_utils::struct_init<request_t> request;
2207 
2208  struct response_t {
2210 
2214  };
2215 
2216  typedef epee::misc_utils::struct_init<response_t> response;
2217  };
2218 
2220  struct request_t {
2223  };
2224 
2226 
2227  struct peer {
2229 
2233  };
2234 
2235  struct span {
2243 
2245  KV_SERIALIZE(start_block_height)
2246  KV_SERIALIZE(nblocks)
2247  KV_SERIALIZE(connection_id)
2248  KV_SERIALIZE(rate)
2249  KV_SERIALIZE(speed)
2250  KV_SERIALIZE(size)
2251  KV_SERIALIZE(remote_address)
2253  };
2254 
2255  struct response_t {
2260  std::list<peer> peers;
2261  std::list<span> spans;
2263 
2267  KV_SERIALIZE(target_height)
2268  KV_SERIALIZE(next_needed_pruning_seed)
2269  KV_SERIALIZE(peers)
2270  KV_SERIALIZE(spans)
2271  KV_SERIALIZE(overview)
2273  };
2274 
2275  typedef epee::misc_utils::struct_init<response_t> response;
2276  };
2277 
2279  struct request_t {
2280  std::vector<uint64_t> amounts;
2284  bool binary;
2285  bool compress;
2286 
2288  KV_SERIALIZE(amounts)
2289  KV_SERIALIZE_OPT(from_height, (uint64_t) 0)
2290  KV_SERIALIZE_OPT(to_height, (uint64_t) 0)
2291  KV_SERIALIZE_OPT(cumulative, false)
2292  KV_SERIALIZE_OPT(binary, true)
2293  KV_SERIALIZE_OPT(compress, false)
2295  };
2296 
2297  typedef epee::misc_utils::struct_init<request_t> request;
2298 
2299  struct distribution {
2303  bool binary;
2304  bool compress;
2305 
2307  KV_SERIALIZE(amount)
2308  KV_SERIALIZE_N(data.start_height, "start_height")
2309  KV_SERIALIZE(binary)
2310  KV_SERIALIZE(compress)
2311  if (this_ref.binary) {
2312  if (is_store) {
2313  if (this_ref.compress) {
2314  const_cast<std::string &>(this_ref.compressed_data) = compress_integer_array(
2315  this_ref.data.distribution);
2316  KV_SERIALIZE(compressed_data)
2317  } else
2319  } else {
2320  if (this_ref.compress) {
2321  KV_SERIALIZE(compressed_data)
2322  const_cast<std::vector<uint64_t> &>(this_ref.data.distribution) = decompress_integer_array<uint64_t>(
2323  this_ref.compressed_data);
2324  } else
2326  }
2327  } else
2328  KV_SERIALIZE_N(data.distribution, "distribution")
2329  KV_SERIALIZE_N(data.base, "base")
2331  };
2332 
2333  struct response_t {
2335  std::vector<distribution> distributions;
2337 
2340  KV_SERIALIZE(distributions)
2343  };
2344 
2345  typedef epee::misc_utils::struct_init<response_t> response;
2346  };
2347 
2349  struct request_t {
2351 
2353  KV_SERIALIZE(nblocks);
2355  };
2356 
2357  typedef epee::misc_utils::struct_init<request_t> request;
2358 
2359  struct response_t {
2362 
2367  };
2368 
2369  typedef epee::misc_utils::struct_init<response_t> response;
2370  };
2371 
2373  struct request_t {
2376 
2378  KV_SERIALIZE(start_height);
2379  KV_SERIALIZE(end_height);
2381  };
2382 
2383  typedef epee::misc_utils::struct_init<request_t> request;
2384 
2385  struct response_t {
2387 
2391  };
2392 
2393  typedef epee::misc_utils::struct_init<response_t> response;
2394  };
2395 
2397  struct request_t {
2398  bool check;
2399 
2401  KV_SERIALIZE_OPT(check, false)
2403  };
2404 
2405  typedef epee::misc_utils::struct_init<request_t> request;
2406 
2407  struct response_t {
2408  bool pruned;
2411 
2414  KV_SERIALIZE(pruned)
2415  KV_SERIALIZE(pruning_seed)
2417  };
2418 
2419  typedef epee::misc_utils::struct_init<response_t> response;
2420  };
2421 
2423  struct request_t {
2425 
2427  KV_SERIALIZE(validator_key)
2429  };
2430 
2431  typedef epee::misc_utils::struct_init<request_t> request;
2432 
2433  struct response_t {
2435 
2439  };
2440 
2441  typedef epee::misc_utils::struct_init<response_t> response;
2442  };
2443 
2445  struct request_t {
2448  };
2449 
2451 
2452  struct response_t {
2456 
2462  };
2463 
2464  typedef epee::misc_utils::struct_init<response_t> response;
2465  };
2466 
2468  struct request_t {
2471 
2476  };
2477 
2478  typedef epee::misc_utils::struct_init<request_t> request;
2479 
2480  struct response_t {
2483 
2488  };
2489 
2490  typedef epee::misc_utils::struct_init<response_t> response;
2491  };
2492 
2494  struct request_t {
2496  int version = 0;
2497  std::vector<std::string> signatures;
2498  std::vector<std::string> pubkeys;
2499 
2501  KV_SERIALIZE(blob)
2503  KV_SERIALIZE(signatures)
2504  KV_SERIALIZE(pubkeys)
2506  };
2507 
2508  typedef epee::misc_utils::struct_init<request_t> request;
2509 
2510  struct response_t {
2513  };
2514 
2516  };
2517 
2518 }
epee::misc_utils::struct_init< request_t > request
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
Definition: misc_log_ex.h:173
const uint32_t T[512]
epee::misc_utils::struct_init< request_t > request
std::string publicKey
std::vector< std::uint64_t > distribution
Definition: rpc_handler.h:46
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
::std::string string
Definition: gtest-port.h:1097
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< response_t > response
provides the implementation of varint&#39;s
const char * key
Definition: hmac_keccak.cpp:39
STL namespace.
unsigned short uint16_t
Definition: stdint.h:125
peer(uint64_t id, const std::string &host, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
unsigned char uint8_t
Definition: stdint.h:124
#define KV_SERIALIZE(varialble)
epee::misc_utils::struct_init< request_t > request
uint64_t fee
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
std::string privateKey
epee::misc_utils::struct_init< request_t > request
Holds cryptonote related classes and helpers.
Definition: ban.cpp:40
return true
std::vector< txpool_histo > histo
mdb_size_t count(MDB_cursor *cur)
epee::misc_utils::struct_init< request_t > request
unsigned int uint32_t
Definition: stdint.h:126
epee::misc_utils::struct_init< request_t > request
unsigned __int64 uint64_t
Definition: stdint.h:136
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB(varialble)
#define false
Definition: stdbool.h:38
#define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble)
#define KV_SERIALIZE_N(varialble, val_name)
POD_CLASS public_key
Definition: crypto.h:76
version
Supported socks variants.
Definition: socks.h:57
std::string message("Message requiring signing")
boost::endian::big_uint32_t ip
Definition: socks.cpp:61
boost::endian::big_uint16_t port
Definition: socks.cpp:60
std::string blobdata
Definition: blobdatatype.h:39
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91
uint64_t weight
POD_CLASS signature
Definition: crypto.h:108
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, val_name)
Definition: blake256.h:37
epee::misc_utils::struct_init< request_t > request
signed __int64 int64_t
Definition: stdint.h:135
uint64_t time_in_pool
POD_CLASS hash
Definition: hash.h:50
epee::misc_utils::struct_init< request_t > request
const char * address
Definition: multisig.cpp:37
std::string to_string(t_connection_type type)
else if(0==res)
#define END_KV_SERIALIZE_MAP()
signed int int32_t
Definition: stdint.h:123
#define KV_SERIALIZE_OPT(variable, default_value)
epee::misc_utils::struct_init< request_t > request
error
Tracks LMDB error codes.
Definition: error.h:44
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
epee::misc_utils::struct_init< request_t > request
#define BEGIN_KV_SERIALIZE_MAP()
epee::misc_utils::struct_init< request_t > request
rapidjson::Document json
Definition: transport.cpp:49
std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value, void >::type write_varint(OutputIt &&dest, T i)
writes a varint to a stream.
Definition: varint.h:70
peer(uint64_t id, uint32_t ip, uint16_t port, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
uint8_t threshold
Definition: blockchain.cpp:92