Browse Source

Hashes per second in case we use this

master
nolim1t 5 years ago
parent
commit
02b154f990
No known key found for this signature in database GPG Key ID: F6287B82CC84BCBD
  1. 7
      logic/bitcoind.js
  2. 5
      services/bitcoind.js

7
logic/bitcoind.js

@ -164,12 +164,17 @@ async function nodeStatusSummary() {
const networkInfo = await bitcoindService.getNetworkInfo();
const mempoolInfo = await bitcoindService.getMempoolInfo();
// This line requires upstream changes
//const hashespersec = await bitcoindService.getHashesPerSec();
return {
blocks: blockchainInfo.result.blocks,
difficulty: blockchainInfo.result.difficulty,
size: blockchainInfo.result.sizeOnDisk,
mempool: mempoolInfo.result,
connections: networkInfo.result.connections,
connections: networkInfo.result.connections
// Below requires upstream changes to bitcoind-rpc library
// hashespersec: hashespersec.result
}
}

5
services/bitcoind.js

@ -96,6 +96,10 @@ function getNetworkInfo() {
return promiseify(rpcClient, rpcClient.getNetworkInfo, 'network info');
}
function getHashesPerSec() {
return promiseify(rpcClient, rpcClient.getNetworkHashPs, 'network hash per second');
}
function help() {
// TODO: missing from the library, but can add it not sure how to package.
// rpc.uptime(function (err, res) {
@ -109,6 +113,7 @@ function help() {
}
module.exports = {
getHashesPerSec,
getBlockHash,
getBlock,
getTransaction,

Loading…
Cancel
Save