Dan Janosik
6 years ago
No known key found for this signature in database
GPG Key ID: C6F8CE9FFDB2CED2
3 changed files with
8 additions and
4 deletions
-
.env-sample
-
app.js
-
app/credentials.js
|
|
@ -6,12 +6,13 @@ |
|
|
|
#BTCEXP_PORT=3002 |
|
|
|
|
|
|
|
# Bitcoin RPC Credentials (URI -OR- HOST/PORT/USER/PASS) |
|
|
|
#BTCEXP_BITCOIND_URI=bitcoin://rpcusername:rpcpassword@127.0.0.1:8332 |
|
|
|
#BTCEXP_BITCOIND_URI=bitcoin://rpcusername:rpcpassword@127.0.0.1:8332?timeout=10000 |
|
|
|
#BTCEXP_BITCOIND_HOST=localhost |
|
|
|
#BTCEXP_BITCOIND_PORT=8332 |
|
|
|
#BTCEXP_BITCOIND_USER=rpcusername |
|
|
|
#BTCEXP_BITCOIND_PASS=rpcpassword |
|
|
|
#BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie |
|
|
|
#BTCEXP_BITCOIND_RPC_TIMEOUT=5000 |
|
|
|
|
|
|
|
# Optional ElectrumX Servers, used to display address transaction histories |
|
|
|
# Ref: https://uasf.saltylemon.org/electrum |
|
|
|
|
|
@ -286,13 +286,15 @@ app.runOnStartup = function() { |
|
|
|
var rpcCred = config.credentials.rpc; |
|
|
|
console.log(`Connecting via RPC to node at ${rpcCred.host}:${rpcCred.port}`); |
|
|
|
|
|
|
|
global.client = new bitcoinCore({ |
|
|
|
var rpcClientProperties = { |
|
|
|
host: rpcCred.host, |
|
|
|
port: rpcCred.port, |
|
|
|
username: rpcCred.username, |
|
|
|
password: rpcCred.password, |
|
|
|
timeout: 5000 |
|
|
|
}); |
|
|
|
timeout: rpcCred.timeout |
|
|
|
}; |
|
|
|
|
|
|
|
global.client = new bitcoinCore(rpcClientProperties); |
|
|
|
|
|
|
|
if (config.credentials.influxdb.active) { |
|
|
|
global.influxdb = new Influx.InfluxDB(config.credentials.influxdb); |
|
|
|
|
|
@ -23,6 +23,7 @@ module.exports = { |
|
|
|
username: btcAuth[0] || process.env.BTCEXP_BITCOIND_USER, |
|
|
|
password: btcAuth[1] || process.env.BTCEXP_BITCOIND_PASS, |
|
|
|
cookie: btcUri.query.cookie || process.env.BTCEXP_BITCOIND_COOKIE || path.join(os.homedir(), '.bitcoin', '.cookie'), |
|
|
|
timeout: parseInt(btcUri.query.timeout || process.env.BTCEXP_BITCOIND_RPC_TIMEOUT || 5000), |
|
|
|
}, |
|
|
|
|
|
|
|
influxdb:{ |
|
|
|