Monero
Loading...
Searching...
No Matches
command_line_args.h
Go to the documentation of this file.
1// Copyright (c) 2014-2022, 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#ifndef DAEMON_COMMAND_LINE_ARGS_H
30#define DAEMON_COMMAND_LINE_ARGS_H
31
32#include "common/command_line.h"
33#include "cryptonote_config.h"
35
36namespace daemon_args
37{
38 std::string const WINDOWS_SERVICE_NAME = "Monero Daemon";
39
41 "config-file"
42 , "Specify configuration file"
43 , (daemonizer::get_default_data_dir() / std::string(CRYPTONOTE_NAME ".conf")).string()
45 , [](std::array<bool, 2> testnet_stagenet, bool defaulted, std::string val)->std::string {
46 if (testnet_stagenet[0] && defaulted)
47 return (daemonizer::get_default_data_dir() / "testnet" /
48 std::string(CRYPTONOTE_NAME ".conf")).string();
49 else if (testnet_stagenet[1] && defaulted)
50 return (daemonizer::get_default_data_dir() / "stagenet" /
51 std::string(CRYPTONOTE_NAME ".conf")).string();
52 return val;
53 }
54 };
56 "log-file"
57 , "Specify log file"
58 , (daemonizer::get_default_data_dir() / std::string(CRYPTONOTE_NAME ".log")).string()
60 , [](std::array<bool, 2> testnet_stagenet, bool defaulted, std::string val)->std::string {
61 if (testnet_stagenet[0] && defaulted)
62 return (daemonizer::get_default_data_dir() / "testnet" /
63 std::string(CRYPTONOTE_NAME ".log")).string();
64 else if (testnet_stagenet[1] && defaulted)
65 return (daemonizer::get_default_data_dir() / "stagenet" /
66 std::string(CRYPTONOTE_NAME ".log")).string();
67 return val;
68 }
69 };
71 "max-log-file-size"
72 , "Specify maximum log file size [B]"
73 , MAX_LOG_FILE_SIZE
74 };
76 "max-log-files"
77 , "Specify maximum number of rotated log files to be saved (no limit by setting to 0)"
78 , MAX_LOG_FILES
79 };
81 "log-level"
82 , ""
83 , ""
84 };
86 "daemon_command"
87 , "Hidden"
88 };
90 "os-version"
91 , "OS for which this executable was compiled"
92 };
94 "max-concurrency"
95 , "Max number of threads to use for a parallel job"
96 , 0
97 };
98
100 "proxy",
101 "Network communication through proxy: <socks-ip:port> i.e. \"127.0.0.1:9050\"",
102 "",
103 };
105 "proxy-allow-dns-leaks",
106 "Allow DNS leaks outside of proxy",
107 false,
108 };
110 "public-node"
111 , "Allow other users to use the node as a remote (restricted RPC mode, view-only commands) and advertise it over P2P"
112 , false
113 };
114
116 "zmq-rpc-bind-ip"
117 , "IP for ZMQ RPC server to listen on"
118 , "127.0.0.1"
119 };
120
122 "zmq-rpc-bind-port"
123 , "Port for ZMQ RPC server to listen on"
124 , std::to_string(config::ZMQ_RPC_DEFAULT_PORT)
126 , [](std::array<bool, 2> testnet_stagenet, bool defaulted, std::string val)->std::string {
127 if (testnet_stagenet[0] && defaulted)
128 return std::to_string(config::testnet::ZMQ_RPC_DEFAULT_PORT);
129 if (testnet_stagenet[1] && defaulted)
130 return std::to_string(config::stagenet::ZMQ_RPC_DEFAULT_PORT);
131 return val;
132 }
133 };
135 "zmq-pub"
136 , "Address for ZMQ pub - tcp://ip:port or ipc://path"
137 };
138
140 "no-zmq"
141 , "Disable ZMQ RPC server"
142 };
143
144} // namespace daemon_args
145
146#endif // DAEMON_COMMAND_LINE_ARGS_H
#define CRYPTONOTE_NAME
Definition cryptonote_config.h:165
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition cryptonote_config.h:290
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition cryptonote_config.h:275
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition cryptonote_config.h:232
const command_line::arg_descriptor< bool, false > arg_testnet_on
Definition cryptonote_core.cpp:75
const command_line::arg_descriptor< bool, false > arg_stagenet_on
Definition cryptonote_core.cpp:80
Definition command_line_args.h:37
const command_line::arg_descriptor< std::string, false, true, 2 > arg_log_file
Definition command_line_args.h:55
const command_line::arg_descriptor< std::size_t > arg_max_log_files
Definition command_line_args.h:75
std::string const WINDOWS_SERVICE_NAME
Definition command_line_args.h:38
const command_line::arg_descriptor< std::vector< std::string > > arg_zmq_pub
Definition command_line_args.h:134
const command_line::arg_descriptor< std::string > arg_log_level
Definition command_line_args.h:80
const command_line::arg_descriptor< std::string, false, true, 2 > arg_config_file
Definition command_line_args.h:40
const command_line::arg_descriptor< bool > arg_public_node
Definition command_line_args.h:109
const command_line::arg_descriptor< bool > arg_os_version
Definition command_line_args.h:89
const command_line::arg_descriptor< std::vector< std::string > > arg_command
Definition command_line_args.h:85
const command_line::arg_descriptor< bool > arg_zmq_rpc_disabled
Definition command_line_args.h:139
const command_line::arg_descriptor< std::string, false, true, 2 > arg_zmq_rpc_bind_port
Definition command_line_args.h:121
const command_line::arg_descriptor< std::string > arg_zmq_rpc_bind_ip
Definition command_line_args.h:115
const command_line::arg_descriptor< bool > arg_proxy_allow_dns_leaks
Definition command_line_args.h:104
const command_line::arg_descriptor< unsigned > arg_max_concurrency
Definition command_line_args.h:93
const command_line::arg_descriptor< std::string > arg_proxy
Definition command_line_args.h:99
const command_line::arg_descriptor< std::size_t > arg_max_log_file_size
Definition command_line_args.h:70
boost::filesystem::path get_default_data_dir()
Definition posix_daemonizer.inl:66
Definition command_line.h:53