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

proxy to use CoinHive miner on any stratum pool


Version published
Weekly downloads
119
increased by4.39%
Maintainers
1
Weekly downloads
 
Created
Source

CoinHive Stratum Proxy

This proxy allows you to use CoinHive's JavaScript miner on a custom stratum pool. This package was inspired by x25's coinhive-stratum-mining-proxy.

Installation

npm install -g coin-hive-stratum

Usage

You just need to launch a proxy pointing to the desired pool:

coin-hive-stratum 8892 --host=xmr-eu1.nanopool.org --port=14444

And then just point your CoinHive miner to the proxy:

<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script>
  // Configure CoinHive to point to your proxy
  CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8892"]];

  // Start miner
  var miner = CoinHive.Anonymous('your-monero-address');
  miner.start();

</script>

Now your CoinHive miner would be mining on nanopool.org XMR pool, using your monero address. This will work for any pool based on the Stratum Mining Protocol. You can even set up your own.

CLI

Usage: 'coin-hive-stratum <port>'

<port>: The port where the server will listen to

Options:

  --host    The pool's host.
  --port    The pool's port.
  --log     Enable/Disable the logs, default is true

API

  • createServer: Creates a proxy server. It may take an options object with the following optional properties:

    • host: the pool's host.

    • port: the pool's port.

    • log: enable/disable the logs, default is true.

  • proxy.listen(port): launches the server listening on the specified port, which by default is 8892.

FAQ

Can I use this programatically?

Yes, like this:

const createProxy = require('coin-hive-stratum');
const proxy = createProxy({
  host: 'xmr-eu1.nanopool.org',
  port: 14444,
});
proxy.listen(8892);

Can I use several workers?

Yes, just create a CoinHive.User and the username will be used as the stratum worker name:

<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script>
  // Configure CoinHive to point to your proxy
  CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8892"]];

  // Start miner
  var miner = CoinHive.User('your-monero-address', 'my-worker');
  miner.start();

</script>

Disclaimer

This project is not endorsed by or affiliated with coinhive.com in any way.

Keywords

FAQs

Package last updated on 06 Oct 2017

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

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