mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-28 21:12:37 +02:00
Fixed BTC node
This commit is contained in:
parent
71d0146b03
commit
c1bccaed65
2
apolloui
2
apolloui
@ -1 +1 @@
|
||||
Subproject commit f2ec08faad3fd084061ecadf8c84f24c42f8737c
|
||||
Subproject commit 9a6bbff237eef8b3f8535531278350684338fe38
|
@ -23,11 +23,11 @@ cat << EOF
|
||||
}],
|
||||
"memory":
|
||||
{
|
||||
"total": 245760,
|
||||
"available": 109952,
|
||||
"used": 233220,
|
||||
"cache": 97412,
|
||||
"swap": 1280
|
||||
"total": 2457600,
|
||||
"available": 1099520,
|
||||
"used": 2332200,
|
||||
"cache": 974120,
|
||||
"swap": 12800
|
||||
},
|
||||
"cpu":
|
||||
{
|
||||
|
@ -1,9 +1,10 @@
|
||||
const fs = require('fs');
|
||||
const moment = require('moment');
|
||||
|
||||
function getData() {
|
||||
const hashrate = getRandomFloat(3700, 4000).toFixed(1);
|
||||
return {
|
||||
"date": "2021-01-26 15:54:19",
|
||||
"date": moment().format('YYYY-MM-DD HH:mm:ss'), //"2021-01-26 15:54:19"
|
||||
"statVersion": "1.2",
|
||||
"versions": {
|
||||
"miner": "v13.16.1",
|
||||
|
@ -50,7 +50,7 @@ exports.up = async function (knex) {
|
||||
await knex('pools').insert({
|
||||
enabled: true,
|
||||
donation: 1,
|
||||
url: 'stratum+tcp://us.litecoinpool.org:3333',
|
||||
url: 'stratum+tcp://stratum.slushpool.com:3333',
|
||||
username: 'jstefanop.a1',
|
||||
password: 'a1',
|
||||
index: 99
|
||||
|
@ -1,7 +1,7 @@
|
||||
const { join } = require('path')
|
||||
const { exec } = require('child_process')
|
||||
|
||||
const litecoin = require('litecoin');
|
||||
const bitcoin = require('litecoin');
|
||||
|
||||
module.exports = ({ define }) => {
|
||||
define('stats', async (payload, { knex, errors, utils }) => {
|
||||
@ -63,7 +63,7 @@ module.exports = ({ define }) => {
|
||||
})
|
||||
}
|
||||
|
||||
const litecoinClient = new litecoin.Client({
|
||||
const bitcoinClient = new bitcoin.Client({
|
||||
host: '127.0.0.1',
|
||||
port: 8332,
|
||||
user: 'futurebit',
|
||||
@ -74,14 +74,14 @@ const litecoinClient = new litecoin.Client({
|
||||
|
||||
function getNodeStats () {
|
||||
const getBlockchainInfoPromise = new Promise((resolve, reject) => {
|
||||
litecoinClient.getBlockchainInfo((error, blockchainInfo) => {
|
||||
bitcoinClient.getBlockchainInfo((error, blockchainInfo) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
} else {
|
||||
try {
|
||||
// Use bestblockhash to call bestBlock, to retrieve time of last block calculation
|
||||
const bestBlockHash = blockchainInfo.bestblockhash
|
||||
litecoinClient.getBlock(bestBlockHash, (error, block) => {
|
||||
bitcoinClient.getBlock(bestBlockHash, (error, block) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
} else {
|
||||
@ -98,7 +98,7 @@ function getNodeStats () {
|
||||
})
|
||||
|
||||
const getConnectionCountPromise = new Promise((resolve, reject) => {
|
||||
litecoinClient.getConnectionCount((error, connectionCount) => {
|
||||
bitcoinClient.getConnectionCount((error, connectionCount) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
} else {
|
||||
@ -112,7 +112,7 @@ function getNodeStats () {
|
||||
})
|
||||
|
||||
const getMiningInfoPromise = new Promise((resolve, reject) => {
|
||||
litecoinClient.getMiningInfo((error, miningInfo) => {
|
||||
bitcoinClient.getMiningInfo((error, miningInfo) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
} else {
|
||||
@ -126,7 +126,7 @@ function getNodeStats () {
|
||||
})
|
||||
|
||||
const getPeerInfoPromise = new Promise((resolve, reject) => {
|
||||
litecoinClient.getPeerInfo((error, peerInfo) => {
|
||||
bitcoinClient.getPeerInfo((error, peerInfo) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user