From 238ecda9904dbf01020843bb893820c6e22faa4f Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Fri, 8 Feb 2019 03:43:58 +0200 Subject: [PATCH] Update CLI utility with BASIC_AUTH_PASSWORD & ELECTRUMX_SERVERS, alias --coin as -C --- bin/cli.js | 70 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index 62c64f7..7c0000f 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -5,38 +5,40 @@ const args = require('meow')(` $ btc-rpc-explorer [options] Options - -p, --port port to bind http server [default: 3002] - -l, --login protect web interface with a password [default: no password] - --coin crypto-coin to enable [default: BTC] - - -b, --bitcoind-uri connection URI for bitcoind rpc (overrides the options below) - -H, --bitcoind-host hostname for bitcoind rpc [default: 127.0.0.1] - -P, --bitcoind-port port for bitcoind rpc [default: 8332] - -c, --bitcoind-cookie path to bitcoind cookie file [default: 8332] - -u, --bitcoind-user username for bitcoind rpc [default: none] - -w, --bitcoind-pass password for bitcoind rpc [default: none] - - --rpc-allowall allow all rpc commands [default: false] - --rpc-blacklist comma separated list of rpc commands to block [default: see in config.js] - --cookie-secret secret key for signed cookie hmac generation [default: hmac derive from bitcoind pass] - --demo enable demoSite mode [default: disabled] - --no-rates disable fetching of currency exchange rates [default: enabled] - - --ipstack-key api access key for ipstack (for geoip) [default: disabled] - --ganalytics-tracking tracking id for google analytics [default: disabled] - --sentry-url sentry url [default: disabled] - - --enable-influxdb enable influxdb for logging network stats [default: false] - --influxdb-uri connection URI for influxdb (overrides the options below) - --influxdb-host hostname for influxdb [default: 127.0.0.1] - --influxdb-port port for influxdb [default: 8086] - --influxdb-user username for influxdb [default: admin] - --influxdb-pass password for influxdb [default: admin] - --influxdb-dbname database name for influxdb [default: influxdb] - - -e, --node-env nodejs environment mode [default: production] - -h, --help output usage information - -v, --version output version number + -p, --port port to bind http server [default: 3002] + -a, --basic-auth-password <..> protect web interface with a password [default: no password] + -C, --coin crypto-coin to enable [default: BTC] + + -b, --bitcoind-uri connection URI for bitcoind rpc (overrides the options below) + -H, --bitcoind-host hostname for bitcoind rpc [default: 127.0.0.1] + -P, --bitcoind-port port for bitcoind rpc [default: 8332] + -c, --bitcoind-cookie path to bitcoind cookie file [default: ~/.bitcoin/.cookie] + -u, --bitcoind-user username for bitcoind rpc [default: none] + -w, --bitcoind-pass password for bitcoind rpc [default: none] + + -E, --electrumx-servers <..> comma separated list of electrum servers to use for address queries [default: none] + + --rpc-allowall allow all rpc commands [default: false] + --rpc-blacklist comma separated list of rpc commands to block [default: see in config.js] + --cookie-secret secret key for signed cookie hmac generation [default: hmac derive from bitcoind pass] + --demo enable demoSite mode [default: disabled] + --no-rates disable fetching of currency exchange rates [default: enabled] + + --ipstack-key api access key for ipstack (for geoip) [default: disabled] + --ganalytics-tracking tracking id for google analytics [default: disabled] + --sentry-url sentry url [default: disabled] + + --enable-influxdb enable influxdb for logging network stats [default: false] + --influxdb-uri connection URI for influxdb (overrides the options below) + --influxdb-host hostname for influxdb [default: 127.0.0.1] + --influxdb-port port for influxdb [default: 8086] + --influxdb-user username for influxdb [default: admin] + --influxdb-pass password for influxdb [default: admin] + --influxdb-dbname database name for influxdb [default: influxdb] + + -e, --node-env nodejs environment mode [default: production] + -h, --help output usage information + -v, --version output version number Examples $ btc-rpc-explorer --port 8080 --bitcoind-port 18443 --bitcoind-cookie ~/.bitcoin/regtest/.cookie @@ -51,10 +53,10 @@ const args = require('meow')(` $ BTCEXP_PORT=8080 BTCEXP_BITCOIND_PORT=18443 BTCEXP_BITCOIND_COOKIE=~/.bitcoin/regtest/.cookie btc-rpc-explorer -`, { flags: { port: {alias:'p'}, login: {alias:'l'} +`, { flags: { port: {alias:'p'}, basicAuthPassword: {alias:'a'}, coin: {alias:'C'} , bitcoindUri: {alias:'b'}, bitcoindHost: {alias:'H'}, bitcoindPort: {alias:'P'} , bitcoindCookie: {alias:'c'}, bitcoindUser: {alias:'u'}, bitcoindPass: {alias:'w'} - , demo: {type:'boolean'}, rpcAllowall: {type:'boolean'} + , demo: {type:'boolean'}, rpcAllowall: {type:'boolean'}, electrumxServers: {alias:'E'} , enableInfluxdb: {type:'boolean'}, nodeEnv: {alias:'e', default:'production'} } } ).flags;