Skip to content

Commit 14e0a6d

Browse files
authored
docs: mention the --mb alias in the CLI (#1866)
Regenerate the help in the trin book, using the longer format.
1 parent 682b671 commit 14e0a6d

File tree

2 files changed

+82
-23
lines changed

2 files changed

+82
-23
lines changed

bin/trin/src/cli.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub struct TrinConfig {
136136
long = "storage.total",
137137
alias = "mb",
138138
help = "Maximum storage capacity (in megabytes), shared between enabled subnetworks",
139-
long_help = "Maximum storage capacity (in megabytes), shared between enabled subnetworks.\nCan't be used in combination with 'storage.{subnetwork}' flags (if storage of one subnetwork is specified explicitly, all have to be). If none of the flags is used, then `storage.total` is used with default value.\nThe actual storage can be higher than specified, due to overhead.",
139+
long_help = "Maximum storage capacity (in megabytes), shared between enabled subnetworks.\nCan't be used in combination with 'storage.{subnetwork}' flags (if storage of one subnetwork is specified explicitly, all have to be). If none of the flags is used, then `storage.total` is used with default value.\nThe actual storage can be higher than specified, due to overhead.\nThe flag --mb is an alias to storage.total.",
140140
default_value_if("storage.beacon", ArgPredicate::IsPresent, None),
141141
default_value_if("storage.history", ArgPredicate::IsPresent, None),
142142
default_value_if("storage.state", ArgPredicate::IsPresent, None),
@@ -197,16 +197,16 @@ pub struct TrinConfig {
197197
pub ws: bool,
198198

199199
#[arg(
200-
long = "ws-port",
201-
help = "The WebSocket port to listen on.",
200+
long = "ws-port",
201+
help = "The WebSocket port to listen on.",
202202
default_value_t = DEFAULT_WEB3_WS_PORT,
203203
requires = "ws"
204204
)]
205205
pub ws_port: u16,
206206

207207
#[arg(
208-
long = "utp-transfer-limit",
209-
help = "The limit of max background uTP transfers for any given channel (inbound or outbound) for each subnetwork",
208+
long = "utp-transfer-limit",
209+
help = "The limit of max background uTP transfers for any given channel (inbound or outbound) for each subnetwork",
210210
default_value_t = DEFAULT_UTP_TRANSFER_LIMIT,
211211
)]
212212
pub utp_transfer_limit: usize,

book/src/users/cli.md

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,121 @@ Below is the current list of all command line flags.
66

77
Note that these flags may change over time, so run `trin --help` to get the most up-to-date information for your version.
88

9+
<!--
10+
Generate the following text with: trin --help to get the long version, instead of trin -h
11+
-->
912
```text
10-
Usage: trin [OPTIONS] [COMMAND]
13+
Run an eth portal client
1114
12-
Commands:
13-
create-dashboard
14-
help Print this message or the help of the given subcommand(s)
15+
Usage: trin [OPTIONS]
1516
1617
Options:
1718
--web3-transport <WEB3_TRANSPORT>
18-
select transport protocol to serve json-rpc endpoint [default: ipc]
19+
select transport protocol to serve json-rpc endpoint
20+
21+
[default: ipc]
22+
1923
--web3-http-address <WEB3_HTTP_ADDRESS>
20-
address to accept json-rpc http connections [default: http://127.0.0.1:8545/]
24+
address to accept json-rpc http connections
25+
26+
[default: http://127.0.0.1:8545/]
27+
2128
--web3-ipc-path <WEB3_IPC_PATH>
22-
path to json-rpc endpoint over IPC [default: /tmp/trin-jsonrpc.ipc]
29+
path to json-rpc endpoint over IPC
30+
31+
[default: /tmp/trin-jsonrpc.ipc]
32+
2333
--discovery-port <DISCOVERY_PORT>
24-
The UDP port to listen on. [default: 9009]
34+
The UDP port to listen on.
35+
36+
[default: 9009]
37+
2538
--bootnodes <BOOTNODES>
26-
One or more comma-delimited base64-encoded ENR's or multiaddr strings of peers to initially add to the local routing table [default: default]
39+
One or more comma-delimited base64-encoded ENR's or multiaddr strings of peers to initially add to the local routing table
40+
41+
[default: default]
42+
2743
--external-address <EXTERNAL_ADDR>
2844
(Only use this if you are behind a NAT) The address which will be advertised to peers (in an ENR). Changing it does not change which port or address trin binds to. Port number is required, ex: 127.0.0.1:9001
45+
2946
--no-stun
3047
Do not use STUN to determine an external IP. Leaves ENR entry for IP blank. Some users report better connections over VPN.
48+
3149
--no-upnp
3250
Do not use UPnP to determine an external port.
51+
3352
--unsafe-private-key <PRIVATE_KEY>
3453
Hex encoded 32 byte private key (with 0x prefix) (considered unsafe as it's stored in terminal history - keyfile support coming soon)
54+
3555
--trusted-block-root <TRUSTED_BLOCK_ROOT>
3656
Hex encoded block root from a trusted checkpoint
57+
3758
--network <NETWORK>
38-
Choose mainnet or angelfood [default: mainnet]
59+
Choose mainnet or angelfood
60+
61+
[default: mainnet]
62+
3963
--portal-subnetworks <PORTAL_SUBNETWORKS>
40-
Comma-separated list of which portal subnetworks to activate [default: history]
64+
Comma-separated list of which portal subnetworks to activate
65+
66+
[default: beacon,history]
67+
4168
--storage.total <storage.total>
42-
Maximum storage capacity (in megabytes), shared between enabled subnetworks [default: 1000]
69+
Maximum storage capacity (in megabytes), shared between enabled subnetworks.
70+
Can't be used in combination with 'storage.{subnetwork}' flags (if storage of one subnetwork is specified explicitly, all have to be). If none of the flags is used, then `storage.total` is used with default value.
71+
The actual storage can be higher than specified, due to overhead.
72+
The flag --mb is an alias to storage.total.
73+
74+
[default: 1000]
75+
4376
--storage.beacon <storage.beacon>
44-
Maximum storage capacity (in megabytes) used by beacon subnetwork
77+
Maximum storage capacity (in megabytes) used by beacon subnetwork.
78+
Can't be used in combination with 'storage.total' flag.
79+
The actual storage can be higher than specified, due to overhead.
80+
4581
--storage.history <storage.history>
46-
Maximum storage capacity (in megabytes) used by history subnetwork
82+
Maximum storage capacity (in megabytes) used by history subnetwork.
83+
Can't be used in combination with 'storage.total' flag.
84+
The actual storage can be higher than specified, due to overhead.
85+
4786
--storage.state <storage.state>
48-
Maximum storage capacity (in megabytes) used by state subnetwork
87+
Maximum storage capacity (in megabytes) used by state subnetwork.
88+
Can't be used in combination with 'storage.total' flag.
89+
The actual storage can be higher than specified, due to overhead.
90+
4991
--enable-metrics-with-url <ENABLE_METRICS_WITH_URL>
5092
Enable prometheus metrics reporting (provide local IP/Port from which your Prometheus server is configured to fetch metrics)
93+
5194
--data-dir <DATA_DIR>
5295
The directory for storing application data. If used together with --ephemeral, new child directory will be created. Can be alternatively set via TRIN_DATA_PATH env variable.
96+
5397
-e, --ephemeral
5498
Use new data directory, located in OS temporary directory. If used together with --data-dir, new directory will be created there instead.
99+
55100
--disable-poke
56101
Disables the poke mechanism, which propagates content at the end of a successful content query. Disabling is useful for network analysis purposes.
102+
57103
--ws
58104
Used to enable WebSocket rpc.
105+
59106
--ws-port <WS_PORT>
60-
The WebSocket port to listen on. [default: 8546]
107+
The WebSocket port to listen on.
108+
109+
[default: 8546]
110+
61111
--utp-transfer-limit <UTP_TRANSFER_LIMIT>
62-
The limit of max background uTP transfers for any given channel (inbound or outbound) for each subnetwork [default: 50]
112+
The limit of max background uTP transfers for any given channel (inbound or outbound) for each subnetwork
113+
114+
[default: 50]
115+
116+
--max-radius <MAX_RADIUS>
117+
The maximum radius our node will use. The default is 5% of the network size. The max is 100%
118+
119+
[default: 5]
120+
63121
-h, --help
64-
Print help (see more with '--help')
122+
Print help (see a summary with '-h')
123+
65124
-V, --version
66125
Print version
67126
```

0 commit comments

Comments
 (0)