Ethereum network status dashboard for PoW and PoA networks
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.
ethstats-server/models/node.js

35 lines
458 B

var geoip = require('geoip-lite');
10 years ago
var Node = function Node()
10 years ago
{
10 years ago
this.id = null;
this.info = {};
this.geo = {}
this.stats = {
10 years ago
active: false,
10 years ago
listening: false,
10 years ago
mining: false,
10 years ago
peers: 0,
pending: 0,
gasPrice: 0,
block: {},
blocktimeAvg: 0,
difficulty: [],
uptime: {
down: 0,
inc: 0,
total: 0
10 years ago
},
lastUpdate: 0
};
10 years ago
return this;
}
10 years ago
Node.prototype.setGeo = function()
10 years ago
{
10 years ago
this.geo = geoip.lookup(ip);
}
module.exports = Node;