Socket
Socket
Sign inDemoInstall

coin-hive-stratum

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coin-hive-stratum - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

16

build/Donation.js

@@ -6,3 +6,2 @@ "use strict";

function Donation(options) {
var _this = this;
this.id = uuid.v4();

@@ -29,2 +28,8 @@ this.address = null;

this.connection = options.connection;
}
Donation.prototype.connect = function () {
var _this = this;
if (this.online) {
this.kill();
}
this.ready = new Promise(function (resolve) {

@@ -34,5 +39,2 @@ _this.resolved = false;

});
}
Donation.prototype.connect = function () {
var _this = this;
var login = this.address;

@@ -48,2 +50,3 @@ if (this.user) {

this.connection.on(this.id + ":job", this.handleJob.bind(this));
this.connection.on(this.id + ":error", this.handleError.bind(this));
this.heartbeat = setInterval(function () { return _this.connection.send(_this.id, "keepalived"); }, 30000);

@@ -61,2 +64,3 @@ this.online = true;

this.connection.removeAllListeners(this.id + ":job");
this.connection.removeAllListeners(this.id + ":error");
this.jobs = [];

@@ -94,4 +98,8 @@ this.taken = [];

};
Donation.prototype.handleError = function (error) {
console.warn("donation connection error (" + this.id + ")", JSON.stringify(error));
this.connect();
};
return Donation;
}());
exports.default = Donation;

@@ -145,3 +145,2 @@ "use strict";

catch (e) {
console.warn("failed to send message to miner, websocket seems to be already closed", e.message);
this.kill();

@@ -148,0 +147,0 @@ }

@@ -11,3 +11,3 @@ module.exports = {

maxMinersPerConnection: 100,
purgeInterval: 30000,
purgeInterval: -1,
donations: [

@@ -14,0 +14,0 @@ {

{
"name": "coin-hive-stratum",
"version": "2.2.2",
"version": "2.3.0",
"description": "proxy to use CoinHive miner on any stratum pool",

@@ -5,0 +5,0 @@ "main": "build",

@@ -12,7 +12,7 @@ ## CoinHive Stratum Proxy

- Deploy this proxy for free to `now.sh` + GitHub Pages and avoid AdBlock.
[Learn More](https://github.com/cazala/coin-hive-stratum/wiki/Deploy-to-now.sh-and-GitHub-Pages)
* Deploy this proxy for free to `now.sh` + GitHub Pages and avoid AdBlock.
[Learn More](https://github.com/cazala/coin-hive-stratum/wiki/Deploy-to-now.sh-and-GitHub-Pages)
- Run proxy with `pm2` and get load balancing, cluster mode, watch & reload, and live metrics.
[Learn More](https://github.com/cazala/coin-hive-stratum/wiki/Run-with-PM2)
* Run proxy with `pm2` and get load balancing, cluster mode, watch & reload, and live metrics.
[Learn More](https://github.com/cazala/coin-hive-stratum/wiki/Run-with-PM2)

@@ -54,5 +54,7 @@ ## Installation

You can see your proxy stats (number of miners and connections) by hittings `/stats`, ie: `https://localhost:8892/stats`.
You can see your proxy stats (number of miners and connections) by hittings `/stats`, ie:
`https://localhost:8892/stats`.
To get more advanced metrcis you will have to [run the proxy with PM2](https://github.com/cazala/coin-hive-stratum/wiki/Run-with-PM2).
To get more advanced metrcis you will have to
[run the proxy with PM2](https://github.com/cazala/coin-hive-stratum/wiki/Run-with-PM2).

@@ -114,3 +116,3 @@ ## CLI

* `proxy.listen(port)`: launches the server listening on the specified port, which by default is `8892`.
* `proxy.listen(port [, host])`: launches the server listening on the specified port (and optionally a host).

@@ -124,4 +126,4 @@ ## FAQ

```js
const createProxy = require("coin-hive-stratum");
const proxy = createProxy({
const Proxy = require("coin-hive-stratum");
const proxy = new Proxy({
host: "la01.supportxmr.com",

@@ -128,0 +130,0 @@ port: 3333

import * as uuid from "uuid";
import Connection from "./Connection";
import { Job } from "src/types";
import { Job, StratumError } from "src/types";

@@ -38,2 +38,8 @@ export type Options = {

this.connection = options.connection;
}
connect(): void {
if (this.online) {
this.kill();
}
this.ready = new Promise(resolve => {

@@ -43,5 +49,2 @@ this.resolved = false;

});
}
connect(): void {
let login = this.address;

@@ -57,2 +60,3 @@ if (this.user) {

this.connection.on(this.id + ":job", this.handleJob.bind(this));
this.connection.on(this.id + ":error", this.handleError.bind(this));
this.heartbeat = setInterval(() => this.connection.send(this.id, "keepalived"), 30000);

@@ -71,2 +75,3 @@ this.online = true;

this.connection.removeAllListeners(this.id + ":job");
this.connection.removeAllListeners(this.id + ":error");
this.jobs = [];

@@ -109,4 +114,9 @@ this.taken = [];

}
handleError(error: StratumError) {
console.warn(`donation connection error (${this.id})`, JSON.stringify(error));
this.connect();
}
}
export default Donation;

@@ -111,3 +111,2 @@ import * as EventEmitter from "events";

} catch (e) {
console.warn(`failed to send message to miner, websocket seems to be already closed`, e.message);
this.kill();

@@ -114,0 +113,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc