Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Sep 12, 2023
1 parent 94cf5ae commit 94ad39f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ BTCEXP_PORT=3002
# - [username/password]: none
# - cookie: '~/.groestlcoin/.cookie'
# - timeout: 5000 (ms)
BTCEXP_BITCOIND_URI=http://rpcusername:[email protected]: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:[email protected]: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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
Expand Down
14 changes: 7 additions & 7 deletions app/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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,

Expand All @@ -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),
};
}

Expand Down
30 changes: 15 additions & 15 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ const args = require('meow')(`
-a, --basic-auth-password <..> protect web interface with a password [default: no password]
-C, --coin <coin> crypto-coin to enable [default: GRS]
-b, --bitcoind-uri <uri> connection URI for groestlcoind rpc (overrides the options below)
-H, --bitcoind-host <host> hostname for groestlcoind rpc [default: 127.0.0.1]
-P, --bitcoind-port <port> port for groestlcoind rpc [default: 1441]
-c, --bitcoind-cookie <path> path to groestlcoind cookie file [default: ~/.groestlcoin/.cookie]
-u, --bitcoind-user <user> username for groestlcoind rpc [default: none]
-w, --bitcoind-pass <pass> password for groestlcoind rpc [default: none]
-b, --groestlcoind-uri <uri> connection URI for groestlcoind rpc (overrides the options below)
-H, --groestlcoind-host <host> hostname for groestlcoind rpc [default: 127.0.0.1]
-P, --groestlcoind-port <port> port for groestlcoind rpc [default: 1441]
-c, --groestlcoind-cookie <path> path to groestlcoind cookie file [default: ~/.groestlcoin/.cookie]
-u, --groestlcoind-user <user> username for groestlcoind rpc [default: none]
-w, --groestlcoind-pass <pass> password for groestlcoind rpc [default: none]
--address-api <option> api to use for address queries (options: electrum, blockchair.com) [default: none]
-E, --electrum-servers <..> comma separated list of electrum servers to use for address queries; only used if --address-api=electrum [default: none]
--rpc-allowall allow all rpc commands [default: false]
--rpc-blacklist <methods> comma separated list of rpc commands to block [default: see in config.js]
--cookie-secret <secret> secret key for signed cookie hmac generation [default: hmac derive from bitcoind pass]
--cookie-secret <secret> secret key for signed cookie hmac generation [default: hmac derive from groestlcoind pass]
--demo enable demoSite mode [default: disabled]
--no-rates disable fetching of currency exchange rates [default: enabled]
--slow-device-mode disable performance-intensive tasks (e.g. UTXO set fetching) [default: enabled]
Expand All @@ -43,15 +43,15 @@ const args = require('meow')(`
-v, --version output version number
Examples
$ 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
$ grs-rpc-explorer -p 8080 -P 18443 -c ~/.groestlcoin/regtest.cookie
Or using connection URIs
$ grs-rpc-explorer -b groestlcoin://bob:[email protected]:18443/
$ grs-rpc-explorer -b groestlcoin://127.0.0.1:18443/?cookie=$HOME/.groestlcoin/regtest/.cookie
All options may also be specified as environment variables
$ BTCEXP_PORT=8080 BTCEXP_BITCOIND_PORT=18443 BTCEXP_BITCOIND_COOKIE=~/.groestlcoin/regtest/.cookie grs-rpc-explorer
$ BTCEXP_PORT=8080 BTCEXP_GROESTLCOIND_PORT=18443 BTCEXP_GROESTLCOIND_COOKIE=~/.groestlcoin/regtest/.cookie grs-rpc-explorer
`, {
Expand All @@ -60,12 +60,12 @@ const args = require('meow')(`
host: {alias:'i'},
basicAuthPassword: {alias:'a'},
coin: {alias:'C'},
bitcoindUri: {alias:'b'},
bitcoindHost: {alias:'H'},
bitcoindPort: {alias:'P'},
bitcoindCookie: {alias:'c'},
bitcoindUser: {alias:'u'},
bitcoindPass: {alias:'w'},
groestlcoindUri: {alias:'b'},
groestlcoindHost: {alias:'H'},
groestlcoindPort: {alias:'P'},
groestlcoindCookie: {alias:'c'},
groestlcoindUser: {alias:'u'},
groestlcoindPass: {alias:'w'},
demo: {},
rpcAllowall: {},
electrumServers: {alias:'E'},
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ services:
#user: "1000:1000"
environment:
BTCEXP_HOST: 0.0.0.0
BTCEXP_BITCOIND_URI: $BTCEXP_BITCOIND_URI
BTCEXP_GROESTLCOIND_URI: $BTCEXP_GROESTLCOIND_URI
BTCEXP_ADDRESS_API: $BTCEXP_ADDRESS_API
BTCEXP_ELECTRUM_SERVERS: $BTCEXP_ELECTRUM_SERVERS
BTCEXP_SLOW_DEVICE_MODE: false
#More information mode, including Bitcoin exchange rates
#More information mode, including Groestlcoin exchange rates
#More privacy mode, no external queries
# BTCEXP_PRIVACY_MODE: true
# BTCEXP_NO_RATES: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"groestlcoinjs-lib": "^6.0.0",
"body-parser": "^1.20.2",
"bootstrap": "^5.2.3",
"bs58check": "^3.0.1",
"bs58grscheck": "^2.1.2",
"chart.js": "^4.3.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
Expand Down
2 changes: 1 addition & 1 deletion views/block-analysis.pug
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ block content
th.text-card-highlight.text-uppercase.fw-light Transaction
th.text-end.text-card-highlight.fw-light
span.text-uppercase BTC Days Destroyed
small.border-bottom.ms-2(title="Bitcoin Days", data-bs-toggle="tooltip") (bd)
small.border-bottom.ms-2(title="Groestlcoin Days", data-bs-toggle="tooltip") (bd)

tbody(id="tbody-top-daysdestroyed-tx")
tr.row-prototype(style="display: none;")
Expand Down

0 comments on commit 94ad39f

Please sign in to comment.