New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

js-stratum-proxy

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-stratum-proxy

Proxy stratum mining either programatically or staticlly to your desired stratum mining pool.

latest
Source
npmnpm
Version
0.0.17
Version published
Maintainers
1
Created
Source

js-stratum-proxy

Proxy stratum mining either programatically or staticlly to your desired stratum mining pool.

Install

npm i js-stratum-proxy

Example Usage

You may choose which pools to proxy to by overiding handleAuthorization. The object you return will be used to create a connection with the pool.

const net = require('net');
const StratumProxy = require('js-stratum-proxy');

class MyStratumProxy extends StratumProxy {
  async handleAuthorization(address, minerName) {
    const { poolAddress, poolPort } = await getPoolDataForAddressFromSomewhere(address);
    
    // Make sure you return an object with these keys
    return { address, minerName, poolAddress, poolPort };
  }
}

const app = net.createServer(socket => {
  const connection = new MyStratumProxy(socket);

  connection.on('connected', () => console.log('connected'));
  connection.on('data', data => console.log('data', data));
  connection.on('error', error => console.log('error', error));
  connection.on('disconnected', () => console.log('disconnected'));
});

app.listen(3333, () => {
  console.log(`Proxy server listening at port 3333`);
});

FAQs

Package last updated on 19 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts