1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
crate::ix!();
pub mod base_options {
use super::*;
lazy_static!{
pub static ref ARG_SET_CHAIN: ArgDescriptor = ArgDescriptor {
name: "-chain=<chain>",
help: formatdoc!{
"Use the chain <chain> (default:
main). Allowed values: main, test, signet,
regtest"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_REGTEST: ArgDescriptor = ArgDescriptor {
name: "-regtest",
help: formatdoc!{
"Enter regression test mode, which uses
a special chain in which blocks can be solved
instantly. This is intended for regression testing
tools and app development. Equivalent to
-chain=regtest."
},
flags: ArgsManagerFlags::ALLOW_ANY | ArgsManagerFlags::DEBUG_ONLY,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_TESTACTIVATIONHEIGHT: ArgDescriptor = ArgDescriptor {
name: "-testactivationheight=name@height.",
help: format!{
"Set the activation height of 'name'
(segwit, bip34, dersig,
cltv,csv). (regtest-only)"
},
flags: ArgsManagerFlags::ALLOW_ANY | ArgsManagerFlags::DEBUG_ONLY,
category: OptionsCategory::DEBUG_TEST
};
pub static ref ARG_TESTNET: ArgDescriptor = ArgDescriptor {
name: "-testnet",
help: formatdoc!{
"Use the test chain. Equivalent to -chain=test."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_SET_VBPARAMS: ArgDescriptor = ArgDescriptor {
name: "-vbparams=deployment:start:end[:min_activation_height]",
help: formatdoc!{
"Use given start/end times and
min_activation_height for specified version bits
deployment (regtest-only)"
},
flags: ArgsManagerFlags::ALLOW_ANY | ArgsManagerFlags::DEBUG_ONLY,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_SIGNET: ArgDescriptor = ArgDescriptor {
name: "-signet",
help: formatdoc!{
"Use the signet chain. Equivalent to
-chain=signet. Note that the network is defined by
the -signetchallenge parameter"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_SIGNET_CHALLENGE: ArgDescriptor = ArgDescriptor {
name: "-signetchallenge",
help: formatdoc!{
"Blocks must satisfy the given script
to be considered valid (only for signet networks;
defaults to the global default signet test network
challenge)"
},
flags: ArgsManagerFlags::ALLOW_STRING,
category: OptionsCategory::CHAINPARAMS
};
pub static ref ARG_SIGNET_SEEDNODE: ArgDescriptor = ArgDescriptor {
name: "-signetseednode",
help: formatdoc!{
"Specify a seed node for the signet
network, in the hostname[:port] format,
e.g. sig.net:1234 (may be used multiple times to
specify multiple seed nodes; defaults to the
global default signet test networkseed node(s))"
},
flags: ArgsManagerFlags::ALLOW_STRING,
category: OptionsCategory::CHAINPARAMS
};
}
}
lazy_static!{
pub static ref ARG_HELP: ArgDescriptor = ArgDescriptor {
name: "-?",
help: formatdoc!{
"Print this help message and exit"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_VERSION: ArgDescriptor = ArgDescriptor {
name: "-version",
help: formatdoc!{
"Print version and exit"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS,
};
pub static ref ARG_SET_CONF_FILE: ArgDescriptor = ArgDescriptor {
name: "-conf=<file>",
help: formatdoc!{
"Specify configuration file. Relative
paths will be prefixed by datadir
location. (default: {})",
BITCOIN_CONF_FILENAME
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_DATADIR: ArgDescriptor = ArgDescriptor {
name: "-datadir=<dir>",
help: formatdoc!{
"Specify data directory"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_GENERATE: ArgDescriptor = ArgDescriptor {
name: "-generate",
help: formatdoc!{
"Generate blocks immediately, equivalent
to RPC getnewaddress followed by RPC
generatetoaddress. Optional positional integer
arguments are number of blocks to generate
(default: {}) and maximum iterations to try
(default: {}), equivalent to RPC generatetoaddress
nblocks and maxtries arguments. Example:
bitcoin-cli -generate 4 1000",
DEFAULT_NBLOCKS,
DEFAULT_MAX_TRIES
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_ADDRINFO: ArgDescriptor = ArgDescriptor {
name: "-addrinfo",
help: formatdoc!{
"Get the number of addresses known to
the node, per network and total."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_GETINFO: ArgDescriptor = ArgDescriptor {
name: "-getinfo",
help: formatdoc!{
"Get general information from the remote
server. Note that unlike server-side RPC calls,
the results of -getinfo is the result of multiple
non-atomic requests. Some entries in the result
may represent results from different states
(e.g. wallet balance may be as of a different
block from the chain state reported)"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_NETINFO: ArgDescriptor = ArgDescriptor {
name: "-netinfo",
help: formatdoc!{
"Get network peer connection information
from the remote server. An optional
integer argument from 0 to 4 can be passed
for dif ferent peers listings (default:
0). Pass \"help\" for detailed help
documentation."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_COLOR: ArgDescriptor = ArgDescriptor {
name: "-color=<when>",
help: formatdoc!{
"Color setting for CLI output (default:
{}). Valid values: always, auto (add color codes
when standard output is connected to a terminal
and OS is not WIN32), never.",
DEFAULT_COLOR_SETTING
},
flags: ArgsManagerFlags::ALLOW_STRING,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_NAMED: ArgDescriptor = ArgDescriptor {
name: "-named",
help: formatdoc!{
"Pass named instead of positional
arguments (default: {})",
DEFAULT_NAMED
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS,
};
pub static ref ARG_SET_RPC_CLIENTTIMEOUT: ArgDescriptor = ArgDescriptor {
name: "-rpcclienttimeout=<n>",
help: formatdoc!{
"Timeout in seconds during HTTP requests,
or 0 for no timeout. (default: {})",
DEFAULT_HTTP_CLIENT_TIMEOUT
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_COOKIEFILE: ArgDescriptor = ArgDescriptor {
name: "-rpccookiefile=<loc>",
help: formatdoc!{
"Location of the auth cookie. Relative
paths will be prefixed by a net-specific datadir
location. (default: data dir)"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_CONNECT: ArgDescriptor = ArgDescriptor {
name: "-rpcconnect=<ip>",
help: formatdoc!{
"Send commands to node running on <ip>
(default: {})",
DEFAULT_RPCCONNECT
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_PASSWORD: ArgDescriptor = ArgDescriptor {
name: "-rpcpassword=<pw>",
help: formatdoc!{
"Password for JSON-RPC connections"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_PORT: ArgDescriptor = ArgDescriptor {
name: "-rpcport=<port>",
help: formatdoc!{
"Connect to JSON-RPC on <port> (default:
{}, testnet: {}, signet: {}, regtest: {})",
DEFAULT_BASE_PARAMS.rpc_port(),
TESTNET_BASE_PARAMS.rpc_port(),
SIGNET_BASE_PARAMS.rpc_port(),
REGTEST_BASE_PARAMS.rpc_port()
},
flags: ArgsManagerFlags::ALLOW_ANY | ArgsManagerFlags::NETWORK_ONLY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_USER: ArgDescriptor = ArgDescriptor {
name: "-rpcuser=<user>",
help: formatdoc!{
"Username for JSON-RPC connections"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_WAIT: ArgDescriptor = ArgDescriptor {
name: "-rpcwait",
help: formatdoc!{
"Wait for RPC server to start"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_WAITTIMEOUT: ArgDescriptor = ArgDescriptor {
name: "-rpcwaittimeout=<n>",
help: formatdoc!{
"Timeout in seconds to wait for the RPC
server to start, or 0 for no timeout. (default:
{})",
DEFAULT_WAIT_CLIENT_TIMEOUT
},
flags: ArgsManagerFlags::ALLOW_INT,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_SET_RPC_WALLET: ArgDescriptor = ArgDescriptor {
name: "-rpcwallet=<walletname>",
help: formatdoc!{
"Send RPC for non-default wallet on RPC
server (needs to exactly match corresponding
-wallet option passed to bi tcoind). This changes
the RPC endpoint used,
e.g. http://127.0.0.1:8332/wallet/<walletname>"
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_STDIN: ArgDescriptor = ArgDescriptor {
name: "-stdin",
help: formatdoc!{
"Read extra arguments from standard input,
one per line until EOF/Ctrl-D (recommended for
sensitive information such as passphras es). When
combined with -stdinrpcpass, the first line from
standard input is used for the RPC password."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_STDINRPCPASS: ArgDescriptor = ArgDescriptor {
name: "-stdinrpcpass",
help: formatdoc!{
"Read RPC password from standard input as
a single line. When combined with -stdin, the
first line from standard input is used for the RPC
password. When combined with
-stdinwalletpassphrase, -stdinrpcpass consumes the
first line, and -stdinwalletpassphrase consumes
the second ."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
pub static ref ARG_STDINWALLETPASSPHRASE: ArgDescriptor = ArgDescriptor {
name: "-stdinwalletpassphrase",
help: formatdoc!{
"Read wallet passphrase from standard
input as a single line. When combined with -stdin,
the first line from stan dard input is used for
the wallet passphrase."
},
flags: ArgsManagerFlags::ALLOW_ANY,
category: OptionsCategory::OPTIONS
};
}