Commit d277e9c
committed
Improve flag visibility
The main goal of this PR is to improve the flag visibility by document the usage within arkd.
Now flags can be set with `--` syntax, while keeping compatibility with previous env var mechanic.
Flags are defined by cli and viper has been removed.
A comprehensive list of flags and its usage can be displayed as follows:
```bash
NAME:
arkd start - Starts the arkd server
USAGE:
arkd start [command options]
OPTIONS:
--datadir value Directory to store data (default: "/home/gustavo/.arkd") [$ARKD_DATADIR]
--port value Port (public) to listen on (default: 7070) [$ARKD_PORT]
--admin-port value Admin port (private) to listen on, fallback to service port if 0 (default: 7071) [$ARKD_ADMIN_PORT]
--log-level value Logging level (0-6, where 6 is trace) (default: 4) [$ARKD_LOG_LEVEL]
--session-duration value How long a batch session lasts (in seconds) before timing out once it started (default: 30) [$ARKD_SESSION_DURATION]
--db-type value Database type (postgres, sqlite, badger) (default: "postgres") [$ARKD_DB_TYPE]
--pg-db-url value Postgres connection url if ARKD_DB_TYPE is set to postgres [$ARKD_PG_DB_URL]
--event-db-type value Event database type (postgres, badger) (default: "postgres") [$ARKD_EVENT_DB_TYPE]
--pg-event-db-url value Postgres connection url if ARKD_EVENT_DB_TYPE is set to postgres [$ARKD_PG_EVENT_DB_URL]
--tx-builder-type value Transaction builder type (default: "covenantless") [$ARKD_TX_BUILDER_TYPE]
--live-store-type value Cache service type (redis, inmemory) (default: "redis") [$ARKD_LIVE_STORE_TYPE]
--redis-url value Redis db connection url if ARKD_LIVE_STORE_TYPE is set to redis [$ARKD_REDIS_URL]
--redis-num-of-retries value Maximum number of retries for Redis write operations in case of conflicts (default: 10) [$ARKD_REDIS_NUM_OF_RETRIES]
--vtxo-tree-expiry value VTXO tree expiry in seconds (default: 604672 (~7 days)) [$ARKD_VTXO_TREE_EXPIRY]
--unilateral-exit-delay value Unilateral exit delay in seconds (default: 86400 (~24 hours)) [$ARKD_UNILATERAL_EXIT_DELAY]
--public-unilateral-exit-delay value Public unilateral exit delay in seconds (default: 86400 (~24 hours)) [$ARKD_PUBLIC_UNILATERAL_EXIT_DELAY]
--boarding-exit-delay value Boarding exit delay in seconds (default: 7776000 (~3 months)) [$ARKD_BOARDING_EXIT_DELAY]
--esplora-url value Esplora API URL (default: "https://blockstream.info/api") [$ARKD_ESPLORA_URL]
--wallet-addr value The arkd wallet address to connect to in the form host:port [$ARKD_WALLET_ADDR]
--signer-addr value The signer address to connect to in the form host:port (default: value of `ARKD_WALLET_ADDR`) [$ARKD_SIGNER_ADDR]
--no-macaroons Disable Macaroons authentication (default: false) [$ARKD_NO_MACAROONS]
--no-tls Disable TLS (default: true) [$ARKD_NO_TLS]
--unlocker-type value Wallet unlocker type (env, file) to enable auto-unlock [$ARKD_UNLOCKER_TYPE]
--unlocker-file-path value Path to unlocker file [$ARKD_UNLOCKER_FILE_PATH]
--unlocker-password value Wallet unlocker password [$ARKD_UNLOCKER_PASSWORD]
--round-max-participants-count value Maximum number of participants per round (default: 128) [$ARKD_ROUND_MAX_PARTICIPANTS_COUNT]
--round-min-participants-count value Minimum number of participants per round (default: 1) [$ARKD_ROUND_MIN_PARTICIPANTS_COUNT]
--utxo-max-amount value The maximum allowed amount for boarding or collaborative exit (default: -1 unset) [$ARKD_UTXO_MAX_AMOUNT]
--utxo-min-amount value The minimum allowed amount for boarding or collaborative exit (default: -1 dust) [$ARKD_UTXO_MIN_AMOUNT]
--vtxo-max-amount value The maximum allowed amount for vtxos (default: -1 unset) [$ARKD_VTXO_MAX_AMOUNT]
--vtxo-min-amount value The minimum allowed amount for vtxos (default: -1 dust) [$ARKD_VTXO_MIN_AMOUNT]
--ban-duration value Ban duration in seconds (default: 300) [$ARKD_BAN_DURATION]
--ban-threshold value Number of crimes to trigger a ban (default: 3) [$ARKD_BAN_THRESHOLD]
--scheduler-type value Scheduler type (gocron, block) (default: "gocron") [$ARKD_SCHEDULER_TYPE]
--checkpoint-exit-delay value Checkpoint exit delay in seconds (default: 86400) [$ARKD_CHECKPOINT_EXIT_DELAY]
--tls-extra-ip value [ --tls-extra-ip value ] Extra IP addresses for TLS (comma-separated) [$ARKD_TLS_EXTRA_IP]
--tls-extra-domain value [ --tls-extra-domain value ] Extra domains for TLS (comma-separated) [$ARKD_TLS_EXTRA_DOMAIN]
--note-uri-prexi value Note URI prefix [$ARKD_NOTE_URI_PREFIX]
--scheduled-session-start-time value Scheduled session start time (Unix timestamp) (default: 0) [$ARKD_SCHEDULED_SESSION_START_TIME]
--scheduled-session-end-time value Scheduled session end time (Unix timestamp) (default: 0) [$ARKD_SCHEDULED_SESSION_END_TIME]
--scheduled-session-period value Scheduled session period in minutes (default: 0) [$ARKD_SCHEDULED_SESSION_PERIOD]
--scheduled-session-duration value Scheduled session duration in seconds (default: 0) [$ARKD_SCHEDULED_SESSION_DURATION]
--scheduled-session-min-round-participants-count value Min participants for scheduled sessions [$ARKD_SCHEDULED_SESSION_MIN_ROUND_PARTICIPANTS_COUNT]
--scheduled-session-max-round-participants-count value Max participants for scheduled sessions [$ARKD_SCHEDULED_SESSION_MAX_ROUND_PARTICIPANTS_COUNT]
--collector-endpoint value OpenTelemetry collector endpoint [$ARKD_COLLECTOR_ENDPOINT]
--otel-push-internal value OpenTelemetry push interval in seconds (default: 10) [$ARKD_OTEL_PUSH_INTERVAL]
--allow-csv-block-type Allow CSV block type (default: false) [$ARKD_ALLOW_CSV_BLOCK_TYPE]
--heartbeat-interval value Heartbeat interval in seconds (default: 60) [$ARKD_HEARTBEAT_INTERVAL]
--round-report-enabled Enable round report service (default: false) [$ARKD_ROUND_REPORT_ENABLED]
--settlement-min-expiry-gap value (default: 0 disabled) [$ARKD_SETTLEMENT_MIN_EXPIRY_GAP]
--vtxo-no-csv-validation-cutoff-date value (default: 0 disabled) [$ARKD_VTXO_NO_CSV_VALIDATION_CUTOFF_DATE]
--onchain-output-fee value (default: 0) [$ARKD_ONCHAIN_OUTPUT_FEE]
--alert-manager-url value [$ARKD_ALERT_MANAGER_URL]
--help, -h show help
```
Closes #782
Signed-off-by: Gustavo Chain <[email protected]>1 parent 7afe52a commit d277e9c
File tree
5 files changed
+501
-172
lines changed- cmd/arkd
- internal/config
5 files changed
+501
-172
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
0 commit comments