chia-network-scanner
Version:
Scans the Chia network for active full nodes
23 lines • 695 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Peer = void 0;
const crypto_1 = require("crypto");
class Peer {
constructor(peerOptions) {
this.visited = false;
this.hostname = peerOptions.hostname;
this.port = peerOptions.port;
this.timestamp = peerOptions.timestamp;
}
visit() {
this.visited = true;
}
hash() {
return crypto_1.createHash('sha1')
// Timestamp is not included as the same peer may be reported with a different timestamp
.update(`${this.hostname}${this.port}`)
.digest('hex');
}
}
exports.Peer = Peer;
//# sourceMappingURL=peer.js.map