Skip to content

Commit

Permalink
fix: 🐛 cleanup of CLI help information
Browse files Browse the repository at this point in the history
  • Loading branch information
ziegfried committed Jan 10, 2020
1 parent 3b47c92 commit 029b16d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 61 deletions.
72 changes: 35 additions & 37 deletions docs/cli.md
Expand Up @@ -25,23 +25,21 @@ OPTIONS
show CLI version
--abi-dir=abi-dir
Directory containing ABI
Directory containing ABI definitions (JSON files). This directory will be
searched recursively
--[no-]collect-blocks
Enables ethereum block watcher, ingesting blocks, transactions, event logs
and ABI-decoded information from method calls and event logs
--[no-]collect-internal-metrics
Enables collection of ethlogger-internal metrics (enabled by default unless
specified otherwise in the config file)
Enables collection of ethlogger-internal metrics
--[no-]collect-node-info
Enables collection of node info events (enabled by default unless specified
otherwise in the config file)
Enables collection of node info events
--[no-]collect-node-metrics
Enables collection of node metrics (enabled by default unless specified
otherwise in the config file)
Enables collection of node metrics
--debug
Enable debug log output
Expand All @@ -56,27 +54,27 @@ OPTIONS
--hec-events-index=hec-events-index
Splunk index to send events to. You can alternatively use separate HEC
tokens to correctly route your data.
tokens to correctly route your data
--hec-events-token=hec-events-token
HEC token to use for sending events. You can alternatively configure
different indexes to correctly route your data.
different indexes to correctly route your data
--hec-internal-index=hec-internal-index
Splunk index to send internal metrics to. You can alternatively use separate
HEC tokens to correctly route your data.
HEC tokens to correctly route your data
--hec-internal-token=hec-internal-token
HEC token to use for sending internal metrics. You can alternatively
configure different indexes to correctly route your data.
configure different indexes to correctly route your data
--hec-metrics-index=hec-metrics-index
Splunk index to send metrics to. You can alternatively use separate HEC
tokens to correctly route your data.
tokens to correctly route your data
--hec-metrics-token=hec-metrics-token
HEC token to use for sending metrics. You can alternatively configure
different indexes to correctly route your data.
different indexes to correctly route your data
--[no-]hec-reject-invalid-certs
Disable to allow HEC client to connect to HTTPS without rejecting invalid
Expand All @@ -88,14 +86,14 @@ OPTIONS
--hec-url=hec-url
URL to connect to Splunk HTTP Event Collector. You can either specify just
the base URL (without path) and the default path will automatically appended
or a full URL.
or a full URL
--network-name=network-name
The network name will be attached to all events sent to Splunk
--print-config
Causes ethlogger to simply print the configuration merged from config file
and CLI flags and exit
and CLI flags and exit.
--[no-]reject-invalid-certs
Disable to allow all HTTP clients (HEC and ETH) to connect to HTTPS without
Expand All @@ -104,7 +102,7 @@ OPTIONS
--start-at-block=genesis|latest|<number>
First block to start ingesting from. Possible values are "genesis",
"latest", an absolute block number or a negative number describing how many
blocks before the latest one to start at.
blocks before the latest one to start at
--trace
Enable trace output (very, very verbose). Output will include raw payloads
Expand All @@ -117,26 +115,26 @@ OPTIONS

<!-- ENVREF -->

| Environment Variable | Type | Description |
| --------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `COLLECT_BLOCKS` | `boolean` | Enables ethereum block watcher, ingesting blocks, transactions, event logs and ABI-decoded information from method calls and event logs |
| `COLLECT_NODE_METRICS` | `boolean` | Enables collection of node metrics (enabled by default unless specified otherwise in the config file) |
| `COLLECT_NODE_INFO` | `boolean` | Enables collection of node info events (enabled by default unless specified otherwise in the config file) |
| `COLLECT_INTERNAL_METRICS` | `boolean` | Enables collection of ethlogger-internal metrics (enabled by default unless specified otherwise in the config file) |
| `SPLUNK_HEC_URL` | `string` | URL to connect to Splunk HTTP Event Collector. You can either specify just the base URL (without path) and the default path will automatically appended or a full URL. |
| `SPLUNK_HEC_TOKEN` | `string` | Token to authenticate against Splunk HTTP Event Collector |
| `SPLUNK_HEC_REJECT_INVALID_CERTS` | `boolean` | Disable to allow HEC client to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `SPLUNK_EVENTS_INDEX` | `string` | Splunk index to send events to. You can alternatively use separate HEC tokens to correctly route your data. |
| `SPLUNK_METRICS_INDEX` | `string` | Splunk index to send metrics to. You can alternatively use separate HEC tokens to correctly route your data. |
| `SPLUNK_INTERNAL_INDEX` | `string` | Splunk index to send internal metrics to. You can alternatively use separate HEC tokens to correctly route your data. |
| `SPLUNK_EVENTS_HEC_TOKEN` | `string` | HEC token to use for sending events. You can alternatively configure different indexes to correctly route your data. |
| `SPLUNK_METRICS_HEC_TOKEN` | `string` | HEC token to use for sending metrics. You can alternatively configure different indexes to correctly route your data. |
| `SPLUNK_INTERNAL_HEC_TOKEN` | `string` | HEC token to use for sending internal metrics. You can alternatively configure different indexes to correctly route your data. |
| `ETH_RPC_URL` | `string` | URL to reach the target ethereum node. Supported format is currently only HTTP(s) for JSON RPC |
| `ETH_REJECT_INVALID_CERTS` | `boolean` | Disable to allow ethereum client to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `ABI_DIR` | `string` | Directory containing ABI |
| `START_AT_BLOCK` | `string` | First block to start ingesting from. Possible values are "genesis", "latest", an absolute block number or a negative number describing how many blocks before the latest one to start at. |
| `REJECT_INVALID_CERTS` | `boolean` | Disable to allow all HTTP clients (HEC and ETH) to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `NETWORK_NAME` | `string` | The network name will be attached to all events sent to Splunk |
| Environment Variable | Type | Description |
| --------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `COLLECT_BLOCKS` | `boolean` | Enables ethereum block watcher, ingesting blocks, transactions, event logs and ABI-decoded information from method calls and event logs |
| `COLLECT_NODE_METRICS` | `boolean` | Enables collection of node metrics |
| `COLLECT_NODE_INFO` | `boolean` | Enables collection of node info events |
| `COLLECT_INTERNAL_METRICS` | `boolean` | Enables collection of ethlogger-internal metrics |
| `SPLUNK_HEC_URL` | `string` | URL to connect to Splunk HTTP Event Collector. You can either specify just the base URL (without path) and the default path will automatically appended or a full URL |
| `SPLUNK_HEC_TOKEN` | `string` | Token to authenticate against Splunk HTTP Event Collector |
| `SPLUNK_HEC_REJECT_INVALID_CERTS` | `boolean` | Disable to allow HEC client to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `SPLUNK_EVENTS_INDEX` | `string` | Splunk index to send events to. You can alternatively use separate HEC tokens to correctly route your data |
| `SPLUNK_METRICS_INDEX` | `string` | Splunk index to send metrics to. You can alternatively use separate HEC tokens to correctly route your data |
| `SPLUNK_INTERNAL_INDEX` | `string` | Splunk index to send internal metrics to. You can alternatively use separate HEC tokens to correctly route your data |
| `SPLUNK_EVENTS_HEC_TOKEN` | `string` | HEC token to use for sending events. You can alternatively configure different indexes to correctly route your data |
| `SPLUNK_METRICS_HEC_TOKEN` | `string` | HEC token to use for sending metrics. You can alternatively configure different indexes to correctly route your data |
| `SPLUNK_INTERNAL_HEC_TOKEN` | `string` | HEC token to use for sending internal metrics. You can alternatively configure different indexes to correctly route your data |
| `ETH_RPC_URL` | `string` | URL to reach the target ethereum node. Supported format is currently only HTTP(s) for JSON RPC |
| `ETH_REJECT_INVALID_CERTS` | `boolean` | Disable to allow ethereum client to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `ABI_DIR` | `string` | Directory containing ABI definitions (JSON files). This directory will be searched recursively |
| `START_AT_BLOCK` | `string` | First block to start ingesting from. Possible values are "genesis", "latest", an absolute block number or a negative number describing how many blocks before the latest one to start at |
| `REJECT_INVALID_CERTS` | `boolean` | Disable to allow all HTTP clients (HEC and ETH) to connect to HTTPS without rejecting invalid (self-signed) certificates |
| `NETWORK_NAME` | `string` | The network name will be attached to all events sent to Splunk |

<!-- ENVREF-END -->
38 changes: 14 additions & 24 deletions src/cliflags.ts
Expand Up @@ -16,12 +16,12 @@ export const CLI_FLAGS = {

'print-config': flags.boolean({
description:
'Causes ethlogger to simply print the configuration merged from config file and CLI flags and exit',
'Causes ethlogger to simply print the configuration merged from config file and CLI flags and exit.',
}),
'health-check': flags.boolean({
hidden: true,
description:
'Performs health check for a running ethlogger process by examining the state file created by that process.',
'Performs health check for a running ethlogger process by examining the state file created by that process',
}),

'config-file': flags.string({
Expand All @@ -41,28 +41,25 @@ export const CLI_FLAGS = {
'collect-node-metrics': flags.boolean({
allowNo: true,
env: 'COLLECT_NODE_METRICS',
description:
'Enables collection of node metrics (enabled by default unless specified otherwise in the config file)',
description: 'Enables collection of node metrics',
}),
'collect-node-info': flags.boolean({
allowNo: true,
env: 'COLLECT_NODE_INFO',
description:
'Enables collection of node info events (enabled by default unless specified otherwise in the config file)',
description: 'Enables collection of node info events',
}),
'collect-internal-metrics': flags.boolean({
allowNo: true,
env: 'COLLECT_INTERNAL_METRICS',
description:
'Enables collection of ethlogger-internal metrics (enabled by default unless specified otherwise in the config file)',
description: 'Enables collection of ethlogger-internal metrics',
}),

'hec-url': flags.string({
env: 'SPLUNK_HEC_URL',
description:
'URL to connect to Splunk HTTP Event Collector. ' +
'You can either specify just the base URL (without path) ' +
'and the default path will automatically appended or a full URL.',
'and the default path will automatically appended or a full URL',
}),
'hec-token': flags.string({
env: 'SPLUNK_HEC_TOKEN',
Expand All @@ -77,40 +74,38 @@ export const CLI_FLAGS = {
'hec-events-index': flags.string({
env: 'SPLUNK_EVENTS_INDEX',
description:
'Splunk index to send events to. You can alternatively use separate HEC tokens to correctly route your data.',
'Splunk index to send events to. You can alternatively use separate HEC tokens to correctly route your data',
}),
'hec-metrics-index': flags.string({
env: 'SPLUNK_METRICS_INDEX',
description:
'Splunk index to send metrics to. You can alternatively use separate HEC tokens to correctly route your data.',
'Splunk index to send metrics to. You can alternatively use separate HEC tokens to correctly route your data',
}),
'hec-internal-index': flags.string({
env: 'SPLUNK_INTERNAL_INDEX',
description:
'Splunk index to send internal metrics to. You can alternatively use separate HEC tokens to correctly route your data.',
'Splunk index to send internal metrics to. You can alternatively use separate HEC tokens to correctly route your data',
}),

'hec-events-token': flags.string({
env: 'SPLUNK_EVENTS_HEC_TOKEN',
description:
'HEC token to use for sending events. You can alternatively configure different indexes to correctly route your data.',
'HEC token to use for sending events. You can alternatively configure different indexes to correctly route your data',
}),
'hec-metrics-token': flags.string({
env: 'SPLUNK_METRICS_HEC_TOKEN',
description:
'HEC token to use for sending metrics. You can alternatively configure different indexes to correctly route your data.',
'HEC token to use for sending metrics. You can alternatively configure different indexes to correctly route your data',
}),
'hec-internal-token': flags.string({
env: 'SPLUNK_INTERNAL_HEC_TOKEN',
description:
'HEC token to use for sending internal metrics. You can alternatively configure different indexes to correctly route your data.',
'HEC token to use for sending internal metrics. You can alternatively configure different indexes to correctly route your data',
}),

'eth-rpc-url': flags.string({
env: 'ETH_RPC_URL',
description: 'URL to reach the target ethereum node. Supported format is currently only HTTP(s) for JSON RPC',
// and WS(s) for websocket connections.
// 'Other arguments are interpreted as IPC and refer to a local path in the filesystem.',
}),
'eth-reject-invalid-certs': flags.boolean({
allowNo: true,
Expand All @@ -121,7 +116,7 @@ export const CLI_FLAGS = {

'abi-dir': flags.string({
env: 'ABI_DIR',
description: 'Directory containing ABI ',
description: 'Directory containing ABI definitions (JSON files). This directory will be searched recursively',
}),

'start-at-block': flags.option<StartBlock>({
Expand All @@ -131,7 +126,7 @@ export const CLI_FLAGS = {
description:
'First block to start ingesting from. ' +
'Possible values are "genesis", "latest", an absolute block number ' +
'or a negative number describing how many blocks before the latest one to start at.',
'or a negative number describing how many blocks before the latest one to start at',
parse: s => {
if (s === 'genesis' || s === 'latest') {
return s;
Expand All @@ -158,9 +153,4 @@ export const CLI_FLAGS = {
env: 'NETWORK_NAME',
description: 'The network name will be attached to all events sent to Splunk',
}),

// 'quorum-support': flags.boolean({
// env: 'QUORUM',
// description: 'Enable quorum compatibility',
// }),
};

0 comments on commit 029b16d

Please sign in to comment.