Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

miner-rpc

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miner-rpc

CGMiner and BFGMiner RPC client

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

miner-rpc

This is a simple Node.js module that talks to the CGMiner and BFGMiner RPC APIs.

Installation

Make sure your miner is running with the --api-listen option and (if needed) an appropriate --api-allow option, then:

  • In your project folder:

    npm install miner-rpc
    
  • System-wide, using the command-line script:

    sudo npm install -g miner-rpc
    miner-rpc localhost devs
    

Usage

host, port, and params are optional. host defaults to localhost, port defaults to 4028, and params is empty by default.

var rpc = require('miner-rpc');

var client = rpc.client(host, port);

client.get(cmd, params, function(err, data, raw) {
    // err  : the error that occurred, if any
    // data : the sanitized response from the miner, with a '_status' property
    // raw  : the raw response from the miner
});

Examples

client.get('devs', function(err, data) {
    // data contains a list of devices active in the miner
});

client.get('coin', function(err, data) {
    // data contains some information about the currency being mined, including
    // the network difficulty
});

client.get('pgaset', '0,fan,80', function(err, data) {
    // Tries to set device 0 fan to 80%.  If access to privileged commands is
    // denied, err will be set; otherwise, data will be the status object
    // returned from the miner.
});

See the CGMiner RPC API Readme or the BFGMiner RPC API Readme for more example commands.

Keywords

FAQs

Package last updated on 14 Mar 2014

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