From 029b16d85417f90386bb5da167b8f89ef1eaa249 Mon Sep 17 00:00:00 2001 From: Siegfried Puchbauer Date: Fri, 10 Jan 2020 12:17:54 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20cleanup=20of=20CLI=20help?= =?UTF-8?q?=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/cli.md | 72 ++++++++++++++++++++++++------------------------- src/cliflags.ts | 38 ++++++++++---------------- 2 files changed, 49 insertions(+), 61 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 76ce188..51ac4d3 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -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 @@ -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 @@ -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 @@ -104,7 +102,7 @@ OPTIONS --start-at-block=genesis|latest| 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 @@ -117,26 +115,26 @@ OPTIONS -| 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 | diff --git a/src/cliflags.ts b/src/cliflags.ts index d4f0646..47c744d 100644 --- a/src/cliflags.ts +++ b/src/cliflags.ts @@ -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({ @@ -41,20 +41,17 @@ 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({ @@ -62,7 +59,7 @@ export const CLI_FLAGS = { 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', @@ -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, @@ -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({ @@ -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; @@ -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', - // }), };