You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
596 lines
14 KiB
596 lines
14 KiB
7 years ago
|
var utils = require("../utils.js");
|
||
|
var config = require("../config.js");
|
||
|
var coins = require("../coins.js");
|
||
7 years ago
|
|
||
|
|
||
8 years ago
|
|
||
7 years ago
|
|
||
7 years ago
|
function getGenesisBlockHash() {
|
||
7 years ago
|
return coins[config.coin].genesisBlockHash;
|
||
7 years ago
|
}
|
||
|
|
||
|
function getGenesisCoinbaseTransactionId() {
|
||
7 years ago
|
return coins[config.coin].genesisCoinbaseTransactionId;
|
||
7 years ago
|
}
|
||
7 years ago
|
|
||
7 years ago
|
function getRpcData(cmd) {
|
||
8 years ago
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command(cmd, function(err, result, resHeaders) {
|
||
8 years ago
|
if (err) {
|
||
7 years ago
|
console.log("Error for RPC command '" + cmd + "': " + err);
|
||
7 years ago
|
|
||
|
reject(err);
|
||
|
|
||
|
return;
|
||
8 years ago
|
}
|
||
|
|
||
|
resolve(result);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
7 years ago
|
function getRpcDataWithParams(cmd, params) {
|
||
7 years ago
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command(cmd, params, function(err, result, resHeaders) {
|
||
7 years ago
|
if (err) {
|
||
7 years ago
|
console.log("Error for RPC command '" + cmd + "': " + err);
|
||
7 years ago
|
|
||
|
reject(err);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
resolve(result);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
7 years ago
|
function getBlockchainInfo() {
|
||
|
return getRpcData("getblockchaininfo");
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
function getNetworkInfo() {
|
||
|
return getRpcData("getnetworkinfo");
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
function getNetTotals() {
|
||
|
return getRpcData("getnettotals");
|
||
7 years ago
|
}
|
||
|
|
||
8 years ago
|
function getMempoolInfo() {
|
||
7 years ago
|
return getRpcData("getmempoolinfo");
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
function getUptimeSeconds() {
|
||
7 years ago
|
return getRpcData("uptime");
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
function getMempoolStats() {
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command('getrawmempool', true, function(err, result, resHeaders) {
|
||
7 years ago
|
if (err) {
|
||
7 years ago
|
console.log("Error 428thwre0ufg: " + err);
|
||
7 years ago
|
|
||
7 years ago
|
reject(err);
|
||
|
|
||
|
return;
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
var maxFee = 0;
|
||
|
var maxFeePerByte = 0;
|
||
7 years ago
|
for (var txid in result) {
|
||
|
var txMempoolInfo = result[txid];
|
||
7 years ago
|
var fee = txMempoolInfo.modifiedfee;
|
||
|
var feePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size;
|
||
7 years ago
|
|
||
7 years ago
|
if (fee > maxFee) {
|
||
|
maxFee = txMempoolInfo.modifiedfee;
|
||
|
}
|
||
|
|
||
|
if (feePerByte > maxFeePerByte) {
|
||
|
maxFeePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size;
|
||
|
}
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
var satoshiPerByteBucketMaxima = coins[config.coin].feeSatoshiPerByteBucketMaxima;
|
||
7 years ago
|
var bucketCount = satoshiPerByteBucketMaxima.length + 1;
|
||
7 years ago
|
|
||
7 years ago
|
var satoshiPerByteBuckets = [];
|
||
|
var satoshiPerByteBucketLabels = [];
|
||
7 years ago
|
|
||
7 years ago
|
satoshiPerByteBucketLabels[0] = ("[0 - " + satoshiPerByteBucketMaxima[0] + ")");
|
||
|
for (var i = 0; i < bucketCount; i++) {
|
||
|
satoshiPerByteBuckets[i] = {"count":0, "totalFees":0, "totalBytes":0};
|
||
7 years ago
|
|
||
7 years ago
|
if (i > 0 && i < bucketCount - 1) {
|
||
|
satoshiPerByteBucketLabels[i] = ("[" + satoshiPerByteBucketMaxima[i - 1] + " - " + satoshiPerByteBucketMaxima[i] + ")");
|
||
|
}
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
satoshiPerByteBucketLabels[bucketCount - 1] = (satoshiPerByteBucketMaxima[satoshiPerByteBucketMaxima.length - 1] + "+");
|
||
7 years ago
|
|
||
7 years ago
|
var summary = {
|
||
|
"count":0,
|
||
|
"totalFees":0,
|
||
|
"totalBytes":0,
|
||
|
"satoshiPerByteBuckets":satoshiPerByteBuckets,
|
||
|
"satoshiPerByteBucketLabels":satoshiPerByteBucketLabels
|
||
|
};
|
||
7 years ago
|
|
||
7 years ago
|
for (var txid in result) {
|
||
|
var txMempoolInfo = result[txid];
|
||
|
var fee = txMempoolInfo.modifiedfee;
|
||
|
var feePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size;
|
||
|
var satoshiPerByte = feePerByte * 100000000;
|
||
7 years ago
|
|
||
7 years ago
|
var addedToBucket = false;
|
||
|
for (var i = 0; i < satoshiPerByteBucketMaxima.length; i++) {
|
||
|
if (satoshiPerByteBucketMaxima[i] > satoshiPerByte) {
|
||
|
satoshiPerByteBuckets[i]["count"]++;
|
||
|
satoshiPerByteBuckets[i]["totalFees"] += fee;
|
||
|
satoshiPerByteBuckets[i]["totalBytes"] += txMempoolInfo.size;
|
||
|
|
||
|
addedToBucket = true;
|
||
|
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (!addedToBucket) {
|
||
|
satoshiPerByteBuckets[bucketCount - 1]["count"]++;
|
||
|
satoshiPerByteBuckets[bucketCount - 1]["totalFees"] += fee;
|
||
|
satoshiPerByteBuckets[bucketCount - 1]["totalBytes"] += txMempoolInfo.size;
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
summary["count"]++;
|
||
|
summary["totalFees"] += txMempoolInfo.modifiedfee;
|
||
|
summary["totalBytes"] += txMempoolInfo.size;
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
summary["averageFee"] = summary["totalFees"] / summary["count"];
|
||
7 years ago
|
summary["averageFeePerByte"] = summary["totalFees"] / summary["totalBytes"];
|
||
7 years ago
|
|
||
|
summary["satoshiPerByteBucketMaxima"] = satoshiPerByteBucketMaxima;
|
||
|
summary["satoshiPerByteBucketCounts"] = [];
|
||
|
summary["satoshiPerByteBucketTotalFees"] = [];
|
||
|
|
||
|
for (var i = 0; i < bucketCount; i++) {
|
||
|
summary["satoshiPerByteBucketCounts"].push(summary["satoshiPerByteBuckets"][i]["count"]);
|
||
|
summary["satoshiPerByteBucketTotalFees"].push(summary["satoshiPerByteBuckets"][i]["totalFees"]);
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
resolve(summary);
|
||
7 years ago
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
8 years ago
|
function getBlockByHeight(blockHeight) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
getBlocksByHeight([blockHeight]).then(function(results) {
|
||
|
if (results && results.length > 0) {
|
||
|
resolve({ success:true, getblock:results[0] });
|
||
7 years ago
|
|
||
7 years ago
|
} else {
|
||
|
resolve({ success:false });
|
||
8 years ago
|
}
|
||
7 years ago
|
}).catch(function(err) {
|
||
|
reject(err);
|
||
8 years ago
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
8 years ago
|
function getBlocksByHeight(blockHeights) {
|
||
|
console.log("getBlocksByHeight: " + blockHeights);
|
||
|
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
var batch = [];
|
||
|
for (var i = 0; i < blockHeights.length; i++) {
|
||
|
batch.push({
|
||
|
method: 'getblockhash',
|
||
7 years ago
|
parameters: [ blockHeights[i] ]
|
||
8 years ago
|
});
|
||
|
}
|
||
|
|
||
|
var blockHashes = [];
|
||
7 years ago
|
client.command(batch).then((responses) => {
|
||
|
responses.forEach((item) => {
|
||
|
blockHashes.push(item);
|
||
|
});
|
||
8 years ago
|
|
||
|
if (blockHashes.length == batch.length) {
|
||
7 years ago
|
getBlocksByHash(blockHashes).then(function(blocks) {
|
||
|
resolve(blocks);
|
||
8 years ago
|
});
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
8 years ago
|
function getBlockByHash(blockHash) {
|
||
7 years ago
|
return new Promise(function(resolve, reject) {
|
||
|
getBlocksByHash([blockHash]).then(function(results) {
|
||
|
if (results && results.length > 0) {
|
||
|
resolve(results[0]);
|
||
8 years ago
|
|
||
7 years ago
|
} else {
|
||
|
resolve(null);
|
||
|
}
|
||
|
}).catch(function(err) {
|
||
|
reject(err);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
8 years ago
|
|
||
7 years ago
|
function getBlocksByHash(blockHashes) {
|
||
8 years ago
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
var batch = [];
|
||
|
for (var i = 0; i < blockHashes.length; i++) {
|
||
|
batch.push({
|
||
|
method: 'getblock',
|
||
|
parameters: [ blockHashes[i] ]
|
||
|
});
|
||
8 years ago
|
}
|
||
8 years ago
|
|
||
7 years ago
|
var blocks = [];
|
||
|
client.command(batch).then((responses) => {
|
||
|
responses.forEach((item) => {
|
||
|
blocks.push(item);
|
||
|
});
|
||
|
|
||
|
var coinbaseTxids = [];
|
||
|
for (var i = 0; i < blocks.length; i++) {
|
||
|
coinbaseTxids.push(blocks[i].tx[0])
|
||
|
}
|
||
|
|
||
|
getRawTransactions(coinbaseTxids).then(function(coinbaseTxs) {
|
||
|
for (var i = 0; i < blocks.length; i++) {
|
||
|
blocks[i].coinbaseTx = coinbaseTxs[i];
|
||
|
blocks[i].miner = getMinerFromCoinbaseTx(coinbaseTxs[i]);
|
||
|
}
|
||
|
|
||
|
resolve(blocks);
|
||
|
});
|
||
8 years ago
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function getRawTransaction(txid) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
getRawTransactions([txid]).then(function(results) {
|
||
|
if (results && results.length > 0) {
|
||
|
resolve(results[0]);
|
||
8 years ago
|
|
||
7 years ago
|
} else {
|
||
|
resolve(null);
|
||
8 years ago
|
}
|
||
7 years ago
|
}).catch(function(err) {
|
||
|
reject(err);
|
||
8 years ago
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
7 years ago
|
function getAddress(address) {
|
||
7 years ago
|
return getRpcDataWithParams("validateaddress", address);
|
||
7 years ago
|
}
|
||
|
|
||
8 years ago
|
function getRawTransactions(txids) {
|
||
|
console.log("getRawTransactions: " + txids);
|
||
|
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
if (!txids || txids.length == 0) {
|
||
|
resolve([]);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
7 years ago
|
if (coins[config.coin].genesisCoinbaseTransactionId) {
|
||
|
if (txids.length == 1 && txids[0] == coins[config.coin].genesisCoinbaseTransactionId) {
|
||
7 years ago
|
// copy the "confirmations" field from genesis block to the genesis-coinbase tx
|
||
|
getBlockByHeight(0).then(function(blockZeroResult) {
|
||
7 years ago
|
var result = coins[config.coin].genesisCoinbaseTransaction;
|
||
7 years ago
|
result.confirmations = blockZeroResult.getblock.confirmations;
|
||
8 years ago
|
|
||
7 years ago
|
resolve([result]);
|
||
7 years ago
|
|
||
7 years ago
|
}).catch(function(err) {
|
||
|
reject(err);
|
||
7 years ago
|
|
||
7 years ago
|
return;
|
||
|
});
|
||
8 years ago
|
|
||
7 years ago
|
return;
|
||
|
}
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
var requests = [];
|
||
8 years ago
|
for (var i = 0; i < txids.length; i++) {
|
||
|
var txid = txids[i];
|
||
8 years ago
|
|
||
|
if (txid) {
|
||
8 years ago
|
requests.push({
|
||
8 years ago
|
method: 'getrawtransaction',
|
||
7 years ago
|
parameters: [ txid, 1 ]
|
||
8 years ago
|
});
|
||
|
}
|
||
|
}
|
||
8 years ago
|
|
||
7 years ago
|
var requestBatches = utils.splitArrayIntoChunks(requests, 100);
|
||
8 years ago
|
|
||
|
executeBatchesSequentially(requestBatches, function(results) {
|
||
|
resolve(results);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function executeBatchesSequentially(batches, resultFunc) {
|
||
|
var batchId = utils.getRandomString(20, 'aA#');
|
||
|
|
||
|
console.log("Starting " + batches.length + "-item batch " + batchId + "...");
|
||
|
|
||
|
executeBatchesSequentiallyInternal(batchId, batches, 0, [], resultFunc);
|
||
|
}
|
||
|
|
||
|
function executeBatchesSequentiallyInternal(batchId, batches, currentIndex, accumulatedResults, resultFunc) {
|
||
|
if (currentIndex == batches.length) {
|
||
|
console.log("Finishing batch " + batchId + "...");
|
||
|
|
||
|
resultFunc(accumulatedResults);
|
||
8 years ago
|
|
||
7 years ago
|
return;
|
||
|
}
|
||
8 years ago
|
|
||
8 years ago
|
console.log("Executing item #" + (currentIndex + 1) + " (of " + batches.length + ") for batch " + batchId);
|
||
8 years ago
|
|
||
8 years ago
|
var count = batches[currentIndex].length;
|
||
|
|
||
7 years ago
|
client.command(batches[currentIndex]).then(function(results) {
|
||
|
results.forEach((item) => {
|
||
|
accumulatedResults.push(item);
|
||
8 years ago
|
|
||
7 years ago
|
count--;
|
||
7 years ago
|
});
|
||
8 years ago
|
|
||
7 years ago
|
if (count == 0) {
|
||
8 years ago
|
executeBatchesSequentiallyInternal(batchId, batches, currentIndex + 1, accumulatedResults, resultFunc);
|
||
7 years ago
|
}
|
||
|
});
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
function getMinerFromCoinbaseTx(tx) {
|
||
|
if (global.miningPoolsConfig) {
|
||
|
for (var coinbaseTag in global.miningPoolsConfig.coinbase_tags) {
|
||
|
if (global.miningPoolsConfig.coinbase_tags.hasOwnProperty(coinbaseTag)) {
|
||
|
if (utils.hex2ascii(tx.vin[0].coinbase).indexOf(coinbaseTag) != -1) {
|
||
|
return global.miningPoolsConfig.coinbase_tags[coinbaseTag];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
for (var payoutAddress in global.miningPoolsConfig.payout_addresses) {
|
||
|
if (global.miningPoolsConfig.payout_addresses.hasOwnProperty(payoutAddress)) {
|
||
|
return global.miningPoolsConfig.payout_addresses[payoutAddress];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
function getBlockByHashWithTransactions(blockHash, txLimit, txOffset) {
|
||
|
console.log("getBlockByHashWithTransactions: " + blockHash);
|
||
8 years ago
|
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command('getblock', blockHash, function(errGetblock, resultGetblock, resHeadersGetblock) {
|
||
|
if (errGetblock) {
|
||
|
console.log("Error 3017hfwe0f: " + errGetblock);
|
||
8 years ago
|
|
||
7 years ago
|
reject(errGetblock);
|
||
8 years ago
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var txids = [];
|
||
7 years ago
|
|
||
|
// make sure we have the coinbase transaction since it can indicate
|
||
|
// "block" info that we might want to display (miner)
|
||
|
if (txOffset > 0) {
|
||
|
txids.push(resultGetblock.tx[0]);
|
||
|
}
|
||
|
|
||
|
for (var i = txOffset; i < Math.min(txOffset + txLimit, resultGetblock.tx.length); i++) {
|
||
|
txids.push(resultGetblock.tx[i]);
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
var maxInputsTracked = 10;
|
||
8 years ago
|
getRawTransactions(txids).then(function(transactions) {
|
||
|
var txInputsByTransaction = {};
|
||
|
|
||
7 years ago
|
// even if we're on "page 2" of transactions we pull the coinbase
|
||
|
// tx first so that we can store it
|
||
|
resultGetblock.coinbaseTx = transactions[0];
|
||
|
resultGetblock.miner = getMinerFromCoinbaseTx(transactions[0]);
|
||
|
|
||
|
// if we're on page 2, we don't really want it anymore...
|
||
|
if (txOffset > 0) {
|
||
|
transactions.shift();
|
||
|
}
|
||
|
|
||
7 years ago
|
var vinTxids = [];
|
||
8 years ago
|
var promises = [];
|
||
|
for (var i = 0; i < transactions.length; i++) {
|
||
|
var transaction = transactions[i];
|
||
|
|
||
|
if (transaction) {
|
||
7 years ago
|
//console.log("xyz: " + JSON.stringify(transaction.vin));
|
||
|
|
||
|
for (var j = 0; j < Math.min(maxInputsTracked, transaction.vin.length); j++) {
|
||
|
if (transaction.vin[j].txid) {
|
||
|
vinTxids.push(transaction.vin[j].txid);
|
||
|
}
|
||
|
}
|
||
8 years ago
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
getRawTransactions(vinTxids).then(function(vinTransactions) {
|
||
|
var vinTxById = {};
|
||
8 years ago
|
|
||
7 years ago
|
vinTransactions.forEach(function(tx) {
|
||
|
vinTxById[tx.txid] = tx;
|
||
|
});
|
||
8 years ago
|
|
||
7 years ago
|
transactions.forEach(function(tx) {
|
||
|
txInputsByTransaction[tx.txid] = [];
|
||
|
|
||
|
for (var i = 0; i < Math.min(maxInputsTracked, tx.vin.length); i++) {
|
||
|
if (vinTxById[tx.vin[i].txid]) {
|
||
|
txInputsByTransaction[tx.txid].push(vinTxById[tx.vin[i].txid]);
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
resolve({ getblock:resultGetblock, transactions:transactions, txInputsByTransaction:txInputsByTransaction });
|
||
7 years ago
|
});
|
||
8 years ago
|
});
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
7 years ago
|
function getHelp() {
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command('help', function(err, result, resHeaders) {
|
||
7 years ago
|
if (err) {
|
||
|
console.log("Error 32907th429ghf: " + err);
|
||
|
|
||
|
reject(err);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var lines = result.split("\n");
|
||
|
var sections = [];
|
||
|
|
||
|
lines.forEach(function(line) {
|
||
|
if (line.startsWith("==")) {
|
||
|
var sectionName = line.substring(2);
|
||
|
sectionName = sectionName.substring(0, sectionName.length - 2).trim();
|
||
|
|
||
|
sections.push({name:sectionName, methods:[]});
|
||
|
|
||
|
} else if (line.trim().length > 0) {
|
||
|
var methodName = line.trim();
|
||
|
|
||
|
if (methodName.includes(" ")) {
|
||
|
methodName = methodName.substring(0, methodName.indexOf(" "));
|
||
|
}
|
||
|
|
||
|
sections[sections.length - 1].methods.push({name:methodName, content:line.trim()});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
resolve(sections);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function getRpcMethodHelp(methodName) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
7 years ago
|
client.command('help', methodName, function(err, result, resHeaders) {
|
||
7 years ago
|
if (err) {
|
||
|
console.log("Error 237hwerf07wehg: " + err);
|
||
|
|
||
|
reject(err);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
7 years ago
|
var output = {};
|
||
|
output.string = result;
|
||
|
|
||
7 years ago
|
var str = result;
|
||
|
|
||
|
var lines = str.split("\n");
|
||
|
var argumentLines = [];
|
||
|
var catchArgs = false;
|
||
|
lines.forEach(function(line) {
|
||
|
if (line.trim().length == 0) {
|
||
|
catchArgs = false;
|
||
|
}
|
||
|
|
||
|
if (catchArgs) {
|
||
|
argumentLines.push(line);
|
||
|
}
|
||
|
|
||
7 years ago
|
if (line.trim() == "Arguments:" || line.trim() == "Arguments") {
|
||
7 years ago
|
catchArgs = true;
|
||
|
}
|
||
|
});
|
||
|
|
||
7 years ago
|
var args = [];
|
||
|
var argX = null;
|
||
|
// looking for line starting with "N. " where N is an integer (1-2 digits)
|
||
|
argumentLines.forEach(function(line) {
|
||
7 years ago
|
var regex = /^([0-9]+)\.\s*"?(\w+)"?\s*\(([^,)]*),?\s*([^,)]*),?\s*([^,)]*),?\s*([^,)]*)?\s*\)\s*(.+)?$/;
|
||
7 years ago
|
|
||
7 years ago
|
var match = regex.exec(line);
|
||
|
|
||
|
if (match) {
|
||
|
argX = {};
|
||
|
argX.name = match[2];
|
||
|
argX.detailsLines = [];
|
||
|
|
||
|
argX.properties = [];
|
||
|
|
||
|
if (match[3]) {
|
||
|
argX.properties.push(match[3]);
|
||
|
}
|
||
|
|
||
|
if (match[4]) {
|
||
|
argX.properties.push(match[4]);
|
||
|
}
|
||
|
|
||
|
if (match[5]) {
|
||
|
argX.properties.push(match[5]);
|
||
|
}
|
||
|
|
||
|
if (match[6]) {
|
||
7 years ago
|
argX.properties.push(match[6]);
|
||
|
}
|
||
|
|
||
|
if (match[7]) {
|
||
|
argX.description = match[7];
|
||
7 years ago
|
}
|
||
|
|
||
|
args.push(argX);
|
||
|
}
|
||
|
|
||
|
if (!match && argX) {
|
||
|
argX.detailsLines.push(line);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
output.args = args;
|
||
|
|
||
|
resolve(output);
|
||
7 years ago
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
8 years ago
|
module.exports = {
|
||
7 years ago
|
getGenesisBlockHash: getGenesisBlockHash,
|
||
|
getGenesisCoinbaseTransactionId: getGenesisCoinbaseTransactionId,
|
||
7 years ago
|
getBlockchainInfo: getBlockchainInfo,
|
||
|
getNetworkInfo: getNetworkInfo,
|
||
7 years ago
|
getNetTotals: getNetTotals,
|
||
8 years ago
|
getMempoolInfo: getMempoolInfo,
|
||
8 years ago
|
getBlockByHeight: getBlockByHeight,
|
||
8 years ago
|
getBlocksByHeight: getBlocksByHeight,
|
||
8 years ago
|
getBlockByHash: getBlockByHash,
|
||
7 years ago
|
getBlockByHashWithTransactions: getBlockByHashWithTransactions,
|
||
8 years ago
|
getRawTransaction: getRawTransaction,
|
||
7 years ago
|
getRawTransactions: getRawTransactions,
|
||
7 years ago
|
getMempoolStats: getMempoolStats,
|
||
7 years ago
|
getUptimeSeconds: getUptimeSeconds,
|
||
|
getHelp: getHelp,
|
||
7 years ago
|
getRpcMethodHelp: getRpcMethodHelp,
|
||
7 years ago
|
getAddress: getAddress
|
||
8 years ago
|
};
|