diff --git a/.env b/.env index 0ad401e85..cf74210a6 100644 --- a/.env +++ b/.env @@ -36,13 +36,13 @@ BTCEXP_PORT=3002 # - [username/password]: none # - cookie: '~/.groestlcoin/.cookie' # - timeout: 5000 (ms) -BTCEXP_BITCOIND_URI=http://rpcusername:rpcpassword@127.0.0.1:1441?timeout=10000 -BTCEXP_BITCOIND_HOST=127.0.0.1 -BTCEXP_BITCOIND_PORT=1441 -BTCEXP_BITCOIND_USER=rpcusername -BTCEXP_BITCOIND_PASS=rpcpassword -BTCEXP_BITCOIND_COOKIE=/root/.groestlcoin/.cookie -#BTCEXP_BITCOIND_RPC_TIMEOUT=5000 +BTCEXP_GROESTLCOIND_URI=http://rpcusername:rpcpassword@127.0.0.1:1441?timeout=10000 +BTCEXP_GROESTLCOIND_HOST=127.0.0.1 +BTCEXP_GROESTLCOIND_PORT=1441 +BTCEXP_GROESTLCOIND_USER=rpcusername +BTCEXP_GROESTLCOIND_PASS=rpcpassword +BTCEXP_GROESTLCOIND_COOKIE=/root/.groestlcoin/.cookie +#BTCEXP_GROESTLCOIND_RPC_TIMEOUT=5000 # Select optional "address API" to display address tx lists and balances diff --git a/README.md b/README.md index 552aa9b2c..29dc674be 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ In either case, refer to [.env-sample](.env-sample) for a list of the options an For configuring with CLI arguments, run `grs-rpc-explorer --help` for the full list of options. An example execution is: ```bash -grs-rpc-explorer --port 8080 --bitcoind-port 18443 --bitcoind-cookie ~/.groestlcoin/regtest/.cookie +grs-rpc-explorer --port 8080 --groestlcoind-port 18443 --groestlcoind-cookie ~/.groestlcoin/regtest/.cookie ``` #### Demo site settings diff --git a/app.js b/app.js index d3fa8c07a..a0f898903 100644 --- a/app.js +++ b/app.js @@ -878,7 +878,7 @@ expressApp.onStartup = async () => { function connectToRpcServer() { // reload credentials, the main "config.credentials.rpc" can be stale // since the username/password can be sourced from the auth cookie - // which changes each startup of bitcoind + // which changes each startup of groestlcoind let credentialsForRpcConnect = config.credentials.loadFreshRpcCredentials(); debugLog(`RPC Credentials: ${JSON.stringify(utils.obfuscateProperties(credentialsForRpcConnect, ["password"]), null, 4)}`); diff --git a/app/credentials.js b/app/credentials.js index dec217bb6..2df4c1c07 100644 --- a/app/credentials.js +++ b/app/credentials.js @@ -8,17 +8,17 @@ const fs = require("fs"); const debug = require("debug"); const debugLog = debug("btcexp:config"); -const btcUri = process.env.BTCEXP_BITCOIND_URI ? url.parse(process.env.BTCEXP_BITCOIND_URI, true) : { query: { } }; +const btcUri = process.env.BTCEXP_GROESTLCOIND_URI ? url.parse(process.env.BTCEXP_GROESTLCOIND_URI, true) : { query: { } }; const btcAuth = btcUri.auth ? btcUri.auth.split(':') : []; function loadFreshRpcCredentials() { - let username = btcAuth[0] || process.env.BTCEXP_BITCOIND_USER; - let password = btcAuth[1] || process.env.BTCEXP_BITCOIND_PASS; + let username = btcAuth[0] || process.env.BTCEXP_GROESTLCOIND_USER; + let password = btcAuth[1] || process.env.BTCEXP_GROESTLCOIND_PASS; - let authCookieFilepath = btcUri.query.cookie || process.env.BTCEXP_BITCOIND_COOKIE || path.join(os.homedir(), '.groestlcoin', '.cookie'); + let authCookieFilepath = btcUri.query.cookie || process.env.BTCEXP_GROESTLCOIND_COOKIE || path.join(os.homedir(), '.groestlcoin', '.cookie'); let authType = "usernamePassword"; @@ -37,8 +37,8 @@ function loadFreshRpcCredentials() { } return { - host: btcUri.hostname || process.env.BTCEXP_BITCOIND_HOST || "127.0.0.1", - port: btcUri.port || process.env.BTCEXP_BITCOIND_PORT || 1441, + host: btcUri.hostname || process.env.BTCEXP_GROESTLCOIND_HOST || "127.0.0.1", + port: btcUri.port || process.env.BTCEXP_GROESTLCOIND_PORT || 1441, authType: authType, @@ -47,7 +47,7 @@ function loadFreshRpcCredentials() { authCookieFilepath: authCookieFilepath, - timeout: parseInt(btcUri.query.timeout || process.env.BTCEXP_BITCOIND_RPC_TIMEOUT || 5000), + timeout: parseInt(btcUri.query.timeout || process.env.BTCEXP_GROESTLCOIND_RPC_TIMEOUT || 5000), }; } diff --git a/bin/cli.js b/bin/cli.js index 6805f8124..8255ffc22 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -16,19 +16,19 @@ const args = require('meow')(` -a, --basic-auth-password <..> protect web interface with a password [default: no password] -C, --coin crypto-coin to enable [default: GRS] - -b, --bitcoind-uri connection URI for groestlcoind rpc (overrides the options below) - -H, --bitcoind-host hostname for groestlcoind rpc [default: 127.0.0.1] - -P, --bitcoind-port port for groestlcoind rpc [default: 1441] - -c, --bitcoind-cookie path to groestlcoind cookie file [default: ~/.groestlcoin/.cookie] - -u, --bitcoind-user username for groestlcoind rpc [default: none] - -w, --bitcoind-pass password for groestlcoind rpc [default: none] + -b, --groestlcoind-uri connection URI for groestlcoind rpc (overrides the options below) + -H, --groestlcoind-host hostname for groestlcoind rpc [default: 127.0.0.1] + -P, --groestlcoind-port port for groestlcoind rpc [default: 1441] + -c, --groestlcoind-cookie path to groestlcoind cookie file [default: ~/.groestlcoin/.cookie] + -u, --groestlcoind-user username for groestlcoind rpc [default: none] + -w, --groestlcoind-pass password for groestlcoind rpc [default: none] --address-api