Monero
net_node.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #pragma once
32 #include <boost/thread.hpp>
33 #include <boost/program_options/options_description.hpp>
34 #include <boost/program_options/variables_map.hpp>
35 #include <boost/serialization/version.hpp>
36 #include <boost/uuid/uuid.hpp>
37 #include <boost/serialization/map.hpp>
38 
39 #include "cryptonote_config.h"
40 #include "warnings.h"
41 #include "net/levin_server_cp2.h"
42 #include "p2p_protocol_defs.h"
43 #include "storages/levin_abstract_invoke2.h"
44 #include "net_peerlist.h"
45 #include "math_helper.h"
46 #include "net_node_common.h"
47 #include "common/command_line.h"
48 
51 
52 namespace nodetool
53 {
54  template<class base_type>
55  struct p2p_connection_context_t: base_type //t_payload_net_handler::connection_context //public net_utils::connection_context_base
56  {
57  p2p_connection_context_t(): peer_id(0), support_flags(0), m_in_timedsync(false) {}
58 
60  uint32_t support_flags;
62  };
63 
64  template<class t_payload_net_handler>
65  class node_server: public epee::levin::levin_commands_handler<p2p_connection_context_t<typename t_payload_net_handler::connection_context> >,
66  public i_p2p_endpoint<typename t_payload_net_handler::connection_context>,
67  public epee::net_utils::i_connection_filter
68  {
69  struct by_conn_id{};
70  struct by_peer_id{};
71  struct by_addr{};
72 
74 
77 
78  public:
79  typedef t_payload_net_handler payload_net_handler;
80 
81  node_server(t_payload_net_handler& payload_handler)
82  :m_payload_handler(payload_handler),
83  m_current_number_of_out_peers(0),
84  m_current_number_of_in_peers(0),
85  m_allow_local_ip(false),
86  m_hide_my_port(false),
87  m_no_igd(false),
88  m_offline(false),
89  m_save_graph(false),
90  is_closing(false),
91  m_net_server( epee::net_utils::e_connection_type_P2P ) // this is a P2P connection of the main p2p node server, because this is class node_server<>
92  {}
93  virtual ~node_server()
94  {}
95 
96  static void init_options(boost::program_options::options_description& desc);
97 
98  bool run();
99  bool init(const boost::program_options::variables_map& vm);
100  bool deinit();
101  bool send_stop_signal();
102  uint32_t get_this_peer_port(){return m_listening_port;}
103  t_payload_net_handler& get_payload_object();
104 
105  template <class Archive, class t_version_type>
106  void serialize(Archive &a, const t_version_type ver)
107  {
108  a & m_peerlist;
109  if (ver == 0)
110  {
111  // from v1, we do not store the peer id anymore
112  peerid_type peer_id = AUTO_VAL_INIT (peer_id);
113  a & peer_id;
114  }
115  }
116  // debug functions
117  bool log_peerlist();
118  bool log_connections();
119  virtual uint64_t get_connections_count();
120  size_t get_outgoing_connections_count();
121  size_t get_incoming_connections_count();
122  peerlist_manager& get_peerlist_manager(){return m_peerlist;}
123  void delete_out_connections(size_t count);
124  void delete_in_connections(size_t count);
125  virtual bool block_host(const epee::net_utils::network_address &adress, time_t seconds = P2P_IP_BLOCKTIME);
126  virtual bool unblock_host(const epee::net_utils::network_address &address);
127  virtual std::map<std::string, time_t> get_blocked_hosts() { CRITICAL_REGION_LOCAL(m_blocked_hosts_lock); return m_blocked_hosts; }
128  private:
129  const std::vector<std::string> m_seed_nodes_list =
130  { "seeds.moneroseeds.se"
131  , "seeds.moneroseeds.ae.org"
132  , "seeds.moneroseeds.ch"
133  , "seeds.moneroseeds.li"
134  };
135 
136  bool islimitup=false;
137  bool islimitdown=false;
138 
139  typedef COMMAND_REQUEST_STAT_INFO_T<typename t_payload_net_handler::stat_info> COMMAND_REQUEST_STAT_INFO;
140 
141  CHAIN_LEVIN_INVOKE_MAP2(p2p_connection_context); //move levin_commands_handler interface invoke(...) callbacks into invoke map
142  CHAIN_LEVIN_NOTIFY_MAP2(p2p_connection_context); //move levin_commands_handler interface notify(...) callbacks into nothing
143 
144  BEGIN_INVOKE_MAP2(node_server)
145  HANDLE_INVOKE_T2(COMMAND_HANDSHAKE, &node_server::handle_handshake)
146  HANDLE_INVOKE_T2(COMMAND_TIMED_SYNC, &node_server::handle_timed_sync)
147  HANDLE_INVOKE_T2(COMMAND_PING, &node_server::handle_ping)
148 #ifdef ALLOW_DEBUG_COMMANDS
149  HANDLE_INVOKE_T2(COMMAND_REQUEST_STAT_INFO, &node_server::handle_get_stat_info)
150  HANDLE_INVOKE_T2(COMMAND_REQUEST_NETWORK_STATE, &node_server::handle_get_network_state)
151  HANDLE_INVOKE_T2(COMMAND_REQUEST_PEER_ID, &node_server::handle_get_peer_id)
152 #endif
153  HANDLE_INVOKE_T2(COMMAND_REQUEST_SUPPORT_FLAGS, &node_server::handle_get_support_flags)
154  CHAIN_INVOKE_MAP_TO_OBJ_FORCE_CONTEXT(m_payload_handler, typename t_payload_net_handler::connection_context&)
155  END_INVOKE_MAP2()
156 
157  enum PeerType { anchor = 0, white, gray };
158 
159  //----------------- commands handlers ----------------------------------------------
160  int handle_handshake(int command, typename COMMAND_HANDSHAKE::request& arg, typename COMMAND_HANDSHAKE::response& rsp, p2p_connection_context& context);
161  int handle_timed_sync(int command, typename COMMAND_TIMED_SYNC::request& arg, typename COMMAND_TIMED_SYNC::response& rsp, p2p_connection_context& context);
162  int handle_ping(int command, COMMAND_PING::request& arg, COMMAND_PING::response& rsp, p2p_connection_context& context);
163 #ifdef ALLOW_DEBUG_COMMANDS
164  int handle_get_stat_info(int command, typename COMMAND_REQUEST_STAT_INFO::request& arg, typename COMMAND_REQUEST_STAT_INFO::response& rsp, p2p_connection_context& context);
165  int handle_get_network_state(int command, COMMAND_REQUEST_NETWORK_STATE::request& arg, COMMAND_REQUEST_NETWORK_STATE::response& rsp, p2p_connection_context& context);
166  int handle_get_peer_id(int command, COMMAND_REQUEST_PEER_ID::request& arg, COMMAND_REQUEST_PEER_ID::response& rsp, p2p_connection_context& context);
167 #endif
168  int handle_get_support_flags(int command, COMMAND_REQUEST_SUPPORT_FLAGS::request& arg, COMMAND_REQUEST_SUPPORT_FLAGS::response& rsp, p2p_connection_context& context);
169  bool init_config();
170  bool make_default_peer_id();
171  bool make_default_config();
172  bool store_config();
173  bool check_trust(const proof_of_trust& tr);
174 
175 
176  //----------------- levin_commands_handler -------------------------------------------------------------
177  virtual void on_connection_new(p2p_connection_context& context);
178  virtual void on_connection_close(p2p_connection_context& context);
179  virtual void callback(p2p_connection_context& context);
180  //----------------- i_p2p_endpoint -------------------------------------------------------------
181  virtual bool relay_notify_to_list(int command, const std::string& data_buff, const std::list<boost::uuids::uuid> &connections);
182  virtual bool relay_notify_to_all(int command, const std::string& data_buff, const epee::net_utils::connection_context_base& context);
183  virtual bool invoke_command_to_peer(int command, const std::string& req_buff, std::string& resp_buff, const epee::net_utils::connection_context_base& context);
184  virtual bool invoke_notify_to_peer(int command, const std::string& req_buff, const epee::net_utils::connection_context_base& context);
185  virtual bool drop_connection(const epee::net_utils::connection_context_base& context);
186  virtual void request_callback(const epee::net_utils::connection_context_base& context);
187  virtual void for_each_connection(std::function<bool(typename t_payload_net_handler::connection_context&, peerid_type, uint32_t)> f);
188  virtual bool for_connection(const boost::uuids::uuid&, std::function<bool(typename t_payload_net_handler::connection_context&, peerid_type, uint32_t)> f);
189  virtual bool add_host_fail(const epee::net_utils::network_address &address);
190  //----------------- i_connection_filter --------------------------------------------------------
191  virtual bool is_remote_host_allowed(const epee::net_utils::network_address &address);
192  //-----------------------------------------------------------------------------------------------
193  bool parse_peer_from_string(epee::net_utils::network_address& pe, const std::string& node_addr, uint16_t default_port = 0);
194  bool handle_command_line(
195  const boost::program_options::variables_map& vm
196  );
197  bool idle_worker();
198  bool handle_remote_peerlist(const std::list<peerlist_entry>& peerlist, time_t local_time, const epee::net_utils::connection_context_base& context);
199  bool get_local_node_data(basic_node_data& node_data);
200  //bool get_local_handshake_data(handshake_data& hshd);
201 
202  bool merge_peerlist_with_local(const std::list<peerlist_entry>& bs);
203  bool fix_time_delta(std::list<peerlist_entry>& local_peerlist, time_t local_time, int64_t& delta);
204 
205  bool connections_maker();
206  bool peer_sync_idle_maker();
207  bool do_handshake_with_peer(peerid_type& pi, p2p_connection_context& context, bool just_take_peerlist = false);
208  bool do_peer_timed_sync(const epee::net_utils::connection_context_base& context, peerid_type peer_id);
209 
210  bool make_new_connection_from_anchor_peerlist(const std::vector<anchor_peerlist_entry>& anchor_peerlist);
211  bool make_new_connection_from_peerlist(bool use_white_list);
212  bool try_to_connect_and_handshake_with_new_peer(const epee::net_utils::network_address& na, bool just_take_peerlist = false, uint64_t last_seen_stamp = 0, PeerType peer_type = white, uint64_t first_seen_stamp = 0);
213  size_t get_random_index_with_fixed_probability(size_t max_index);
214  bool is_peer_used(const peerlist_entry& peer);
215  bool is_peer_used(const anchor_peerlist_entry& peer);
216  bool is_addr_connected(const epee::net_utils::network_address& peer);
217  void add_upnp_port_mapping(uint32_t port);
218  void delete_upnp_port_mapping(uint32_t port);
219  template<class t_callback>
220  bool try_ping(basic_node_data& node_data, p2p_connection_context& context, const t_callback &cb);
221  bool try_get_support_flags(const p2p_connection_context& context, std::function<void(p2p_connection_context&, const uint32_t&)> f);
222  bool make_expected_connections_count(PeerType peer_type, size_t expected_connections);
223  void cache_connect_fail_info(const epee::net_utils::network_address& addr);
224  bool is_addr_recently_failed(const epee::net_utils::network_address& addr);
225  bool is_priority_node(const epee::net_utils::network_address& na);
226  std::set<std::string> get_seed_nodes(cryptonote::network_type nettype) const;
227  bool connect_to_seed();
228 
229  template <class Container>
230  bool connect_to_peerlist(const Container& peers);
231 
232  template <class Container>
233  bool parse_peers_and_add_to_container(const boost::program_options::variables_map& vm, const command_line::arg_descriptor<std::vector<std::string> > & arg, Container& container);
234 
235  bool set_max_out_peers(const boost::program_options::variables_map& vm, int64_t max);
236  bool set_max_in_peers(const boost::program_options::variables_map& vm, int64_t max);
237  bool set_tos_flag(const boost::program_options::variables_map& vm, int limit);
238 
239  bool set_rate_up_limit(const boost::program_options::variables_map& vm, int64_t limit);
240  bool set_rate_down_limit(const boost::program_options::variables_map& vm, int64_t limit);
241  bool set_rate_limit(const boost::program_options::variables_map& vm, int64_t limit);
242 
243  bool has_too_many_connections(const epee::net_utils::network_address &address);
244 
245  bool check_connection_and_handshake_with_peer(const epee::net_utils::network_address& na, uint64_t last_seen_stamp);
246  bool gray_peerlist_housekeeping();
247  bool check_incoming_connections();
248 
249  void kill() {
250  _info("Killing the net_node");
251  is_closing = true;
252  if(mPeersLoggerThread != nullptr)
253  mPeersLoggerThread->join(); // make sure the thread finishes
254  _info("Joined extra background net_node threads");
255  }
256 
257  //debug functions
258  std::string print_connections_container();
259 
260 
261  typedef epee::net_utils::boosted_tcp_server<epee::levin::async_protocol_handler<p2p_connection_context> > net_server;
262 
263  struct config
264  {
266  uint64_t m_peer_id;
267  uint32_t m_support_flags;
268 
269  BEGIN_KV_SERIALIZE_MAP()
270  KV_SERIALIZE(m_net_config)
271  KV_SERIALIZE(m_peer_id)
272  KV_SERIALIZE(m_support_flags)
273  END_KV_SERIALIZE_MAP()
274  };
275 
276  public:
277  config m_config; // TODO was private, add getters?
278  std::atomic<unsigned int> m_current_number_of_out_peers;
279  std::atomic<unsigned int> m_current_number_of_in_peers;
280 
281  void set_save_graph(bool save_graph)
282  {
283  m_save_graph = save_graph;
284  epee::net_utils::connection_basic::set_save_graph(save_graph);
285  }
286  private:
287  std::string m_config_folder;
288 
292  uint32_t m_external_port;
293  uint32_t m_ip_address;
296  bool m_no_igd;
297  bool m_offline;
298  std::atomic<bool> m_save_graph;
299  std::atomic<bool> is_closing;
300  std::unique_ptr<boost::thread> mPeersLoggerThread;
301  //critical_section m_connections_lock;
302  //connections_indexed_container m_connections;
303 
304  t_payload_net_handler& m_payload_handler;
306 
307  epee::math_helper::once_a_time_seconds<P2P_DEFAULT_HANDSHAKE_INTERVAL> m_peer_handshake_idle_maker_interval;
308  epee::math_helper::once_a_time_seconds<1> m_connections_maker_interval;
309  epee::math_helper::once_a_time_seconds<60*30, false> m_peerlist_store_interval;
310  epee::math_helper::once_a_time_seconds<60> m_gray_peerlist_housekeeping_interval;
311  epee::math_helper::once_a_time_seconds<900, false> m_incoming_connections_interval;
312 
313  std::string m_bind_ip;
314  std::string m_port;
315 #ifdef ALLOW_DEBUG_COMMANDS
316  uint64_t m_last_stat_request_time;
317 #endif
318  std::list<epee::net_utils::network_address> m_priority_peers;
319  std::vector<epee::net_utils::network_address> m_exclusive_peers;
320  std::vector<epee::net_utils::network_address> m_seed_nodes;
322  std::list<nodetool::peerlist_entry> m_command_line_peers;
323  uint64_t m_peer_livetime;
324  //keep connections to initiate some interactions
327 
328  std::map<epee::net_utils::network_address, time_t> m_conn_fails_cache;
329  epee::critical_section m_conn_fails_cache_lock;
330 
331  epee::critical_section m_blocked_hosts_lock;
332  std::map<std::string, time_t> m_blocked_hosts;
333 
334  epee::critical_section m_host_fails_score_lock;
335  std::map<std::string, uint64_t> m_host_fails_score;
336 
338  };
339 
340  const int64_t default_limit_up = 2048; // kB/s
341  const int64_t default_limit_down = 8192; // kB/s
351 
357 
361 
363 }
364 
365 POP_WARNINGS
#define tr(x)
Definition: common_defines.h:4
std::unique_ptr< boost::thread > mPeersLoggerThread
Definition: net_node.h:300
PUSH_WARNINGS
Definition: hash-ops.h:53
void init_options(boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
Definition: posix_daemonizer.inl:56
uint32_t m_listening_port
Definition: net_node.h:291
std::vector< epee::net_utils::network_address > m_exclusive_peers
Definition: net_node.h:319
bool m_hide_my_port
Definition: net_node.h:295
network_config m_net_config
Definition: net_node.h:265
boost::uuids::uuid uuid
Definition: net_node_common.h:40
static void init(std::string cache_filename)
Definition: blockchain_blackball.cpp:223
uint64_t m_peer_id
Definition: net_node.h:266
Definition: p2p_protocol_defs.h:312
const command_line::arg_descriptor< int > arg_tos_flag
Definition: net_node.cpp:62
Definition: p2p_protocol_defs.h:293
epee::net_utils::boosted_tcp_server< epee::levin::async_protocol_handler< p2p_connection_context > > net_server
Definition: net_node.h:261
bool m_in_timedsync
Definition: net_node.h:61
Definition: p2p_protocol_defs.h:173
Definition: blockchain_ancestry.cpp:70
epee::math_helper::once_a_time_seconds< 60 *30, false > m_peerlist_store_interval
Definition: net_node.h:309
Definition: cryptonote_config.h:151
const command_line::arg_descriptor< int64_t > arg_out_peers
Definition: net_node.cpp:60
Definition: net_node.h:157
COMMAND_HANDSHAKE_T< typename t_payload_net_handler::payload_type > COMMAND_HANDSHAKE
Definition: net_node.h:75
bool m_no_igd
Definition: net_node.h:296
const command_line::arg_descriptor< std::string, false, true, 2 > arg_p2p_bind_port
Definition: net_node.cpp:37
const int64_t default_limit_down
Definition: net_node.h:341
bool m_offline
Definition: net_node.h:297
epee::math_helper::once_a_time_seconds< 1 > m_connections_maker_interval
Definition: net_node.h:308
bool m_allow_local_ip
Definition: net_node.h:294
const command_line::arg_descriptor< std::string > arg_p2p_bind_ip
Definition: net_node.cpp:36
#define P2P_IP_BLOCKTIME
Definition: cryptonote_config.h:117
COMMAND_TIMED_SYNC_T< typename t_payload_net_handler::payload_type > COMMAND_TIMED_SYNC
Definition: net_node.h:76
epee::math_helper::once_a_time_seconds< 900, false > m_incoming_connections_interval
Definition: net_node.h:311
uint32_t m_ip_address
Definition: net_node.h:293
epee::critical_section m_blocked_hosts_lock
Definition: net_node.h:331
Definition: net_node.h:71
bool m_fallback_seed_nodes_added
Definition: net_node.h:321
const command_line::arg_descriptor< int64_t > arg_limit_rate_down
Definition: net_node.cpp:65
Definition: net_node.h:70
const command_line::arg_descriptor< std::vector< std::string > > arg_p2p_add_peer
Definition: net_node.cpp:52
epee::critical_section m_conn_fails_cache_lock
Definition: net_node.h:329
std::string m_config_folder
Definition: net_node.h:287
std::atomic< bool > is_closing
Definition: net_node.h:299
virtual std::map< std::string, time_t > get_blocked_hosts()
Definition: net_node.h:127
const int64_t default_limit_up
Definition: net_node.h:340
std::list< epee::net_utils::network_address > m_priority_peers
Definition: net_node.h:318
const command_line::arg_descriptor< int64_t > arg_limit_rate_up
Definition: net_node.cpp:64
virtual ~node_server()
Definition: net_node.h:93
peerlist_manager & get_peerlist_manager()
Definition: net_node.h:122
epee::math_helper::once_a_time_seconds< 60 > m_gray_peerlist_housekeeping_interval
Definition: net_node.h:310
std::map< epee::net_utils::network_address, time_t > m_conn_fails_cache
Definition: net_node.h:328
epee::critical_section m_host_fails_score_lock
Definition: net_node.h:334
Definition: p2p_protocol_defs.h:85
Definition: p2p_protocol_defs.h:151
const command_line::arg_descriptor< std::vector< std::string > > arg_p2p_add_priority_node
Definition: net_node.cpp:53
std::map< std::string, uint64_t > m_host_fails_score
Definition: net_node.h:335
peerlist_manager m_peerlist
Definition: net_node.h:305
std::string m_bind_ip
Definition: net_node.h:313
uint64_t peerid_type
Definition: p2p_protocol_defs.h:47
const command_line::arg_descriptor< std::vector< std::string > > arg_p2p_add_exclusive_node
Definition: net_node.cpp:54
uint32_t m_support_flags
Definition: net_node.h:267
#define false
Definition: stdbool.h:37
void kill()
Definition: net_node.h:249
Definition: net_peerlist.h:64
void serialize(Archive &a, const t_version_type ver)
Definition: net_node.h:106
Definition: net_node.h:69
const command_line::arg_descriptor< bool > arg_offline
Definition: cryptonote_core.cpp:102
uint32_t m_external_port
Definition: net_node.h:292
network_type
Definition: cryptonote_config.h:204
t_payload_net_handler & m_payload_handler
Definition: net_node.h:304
Definition: cryptonote_format_utils.h:41
const command_line::arg_descriptor< std::vector< std::string > > arg_p2p_seed_node
Definition: net_node.cpp:56
const command_line::arg_descriptor< bool > arg_save_graph
Definition: net_node.cpp:68
uint32_t support_flags
Definition: net_node.h:60
const command_line::arg_descriptor< bool > arg_p2p_hide_my_port
Definition: net_node.cpp:57
const command_line::arg_descriptor< bool > arg_no_igd
Definition: net_node.cpp:59
string a
Definition: MakeCryptoOps.py:15
bool m_have_address
Definition: net_node.h:289
cryptonote::network_type m_nettype
Definition: net_node.h:337
Definition: net_node.h:55
Definition: net_node.cpp:34
bool m_first_connection_maker_call
Definition: net_node.h:290
p2p_connection_context_t()
Definition: net_node.h:57
std::atomic< bool > m_save_graph
Definition: net_node.h:298
peerid_type peer_id
Definition: net_node.h:59
uint32_t get_this_peer_port()
Definition: net_node.h:102
t_payload_net_handler payload_net_handler
Definition: net_node.h:79
p2p_connection_context_t< typename t_payload_net_handler::connection_context > p2p_connection_context
Definition: net_node.h:73
DISABLE_VS_WARNINGS(4244 4345 4503) using namespace crypto
node_server(t_payload_net_handler &payload_handler)
Definition: net_node.h:81
std::map< std::string, time_t > m_blocked_hosts
Definition: net_node.h:332
Definition: p2p_protocol_defs.h:235
std::list< nodetool::peerlist_entry > m_command_line_peers
Definition: net_node.h:322
net_server m_net_server
Definition: net_node.h:325
COMMAND_REQUEST_STAT_INFO_T< typename t_payload_net_handler::stat_info > COMMAND_REQUEST_STAT_INFO
Definition: net_node.h:139
Definition: p2p_protocol_defs.h:304
const command_line::arg_descriptor< int64_t > arg_limit_rate
Definition: net_node.cpp:66
boost::uuids::uuid m_network_id
Definition: net_node.h:326
Definition: command_line.h:53
const command_line::arg_descriptor< uint32_t > arg_p2p_external_port
Definition: net_node.cpp:50
Definition: p2p_protocol_defs.h:131
const command_line::arg_descriptor< bool > arg_p2p_allow_local_ip
Definition: net_node.cpp:51
Definition: net_node_common.h:44
std::string m_port
Definition: net_node.h:314
uint64_t m_peer_livetime
Definition: net_node.h:323
Definition: net_node.h:65
const command_line::arg_descriptor< int64_t > arg_in_peers
Definition: net_node.cpp:61
std::vector< epee::net_utils::network_address > m_seed_nodes
Definition: net_node.h:320
Definition: p2p_protocol_defs.h:70
epee::math_helper::once_a_time_seconds< P2P_DEFAULT_HANDSHAKE_INTERVAL > m_peer_handshake_idle_maker_interval
Definition: net_node.h:307