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.
34 lines
458 B
34 lines
458 B
var geoip = require('geoip-lite');
|
|
|
|
var Node = function Node()
|
|
{
|
|
this.id = null;
|
|
this.info = {};
|
|
this.geo = {}
|
|
this.stats = {
|
|
active: false,
|
|
listening: false,
|
|
mining: false,
|
|
peers: 0,
|
|
pending: 0,
|
|
gasPrice: 0,
|
|
block: {},
|
|
blocktimeAvg: 0,
|
|
difficulty: [],
|
|
uptime: {
|
|
down: 0,
|
|
inc: 0,
|
|
total: 0
|
|
},
|
|
lastUpdate: 0
|
|
};
|
|
|
|
return this;
|
|
}
|
|
|
|
Node.prototype.setGeo = function()
|
|
{
|
|
this.geo = geoip.lookup(ip);
|
|
}
|
|
|
|
module.exports = Node;
|
|
|