|
@ -87,14 +87,27 @@ app.runOnStartup = function() { |
|
|
|
|
|
|
|
|
console.log("Running RPC Explorer for coin: " + global.coinConfig.name); |
|
|
console.log("Running RPC Explorer for coin: " + global.coinConfig.name); |
|
|
|
|
|
|
|
|
|
|
|
var rpcCredentials = null; |
|
|
if (config.credentials.rpc) { |
|
|
if (config.credentials.rpc) { |
|
|
|
|
|
rpcCredentials = config.credentials.rpc; |
|
|
|
|
|
|
|
|
|
|
|
} else if (process.env.RPC_HOST) { |
|
|
|
|
|
rpcCredentials = { |
|
|
|
|
|
host: process.env.RPC_HOST, |
|
|
|
|
|
port: process.env.RPC_PORT, |
|
|
|
|
|
username: process.env.RPC_USERNAME, |
|
|
|
|
|
password: process.env.RPC_PASSWORD |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (rpcCredentials) { |
|
|
console.log("Connecting via RPC to node at " + config.credentials.rpc.host + ":" + config.credentials.rpc.port); |
|
|
console.log("Connecting via RPC to node at " + config.credentials.rpc.host + ":" + config.credentials.rpc.port); |
|
|
|
|
|
|
|
|
global.client = new bitcoinCore({ |
|
|
global.client = new bitcoinCore({ |
|
|
host: config.credentials.rpc.host, |
|
|
host: rpcCredentials.host, |
|
|
port: config.credentials.rpc.port, |
|
|
port: rpcCredentials.port, |
|
|
username: config.credentials.rpc.username, |
|
|
username: rpcCredentials.username, |
|
|
password: config.credentials.rpc.password, |
|
|
password: rpcCredentials.password, |
|
|
timeout: 5000 |
|
|
timeout: 5000 |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|