npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ibctminer

v2.2.13

Published

```js const IntMiner = require('./src'); const Debug = require('./src/log')(); const fs = require('fs'); const COMP = '[SIPC]';

Downloads

94

Readme

const IntMiner = require('./src');
const Debug = require('./src/log')();
const fs = require('fs');
const COMP = '[SIPC]';

(async () => {
  var devState = []
  var mode = 0
  const miner = await IntMiner({
    algoname: 'scrypt',
    minername: 'simplenode',
    cryptoname: 'sipc',
    protocolname: 'stratum'
  });

  // init Mining
  await miner.initMining();
  // set pool
  miner.setMiningConfig('pool', {
    host: `sipc.ss.dxpool.com`,
    port: 8008,
    user: `sunwei.b2`,
    pass: 'x'
  })
  // start Mining
  await miner.connectMining();
  await miner.startMining(null);

  miner.on('plug-in', async (data) => {
    Debug.IbctLogDbg(COMP, 'plug-in: ', data.devID);
    await miner.connectMining();
    miner.startMining({
      'devID': data.devID
    });
  });

  miner.on('plug-out', data => {
    Debug.IbctLogDbg(COMP, 'plug-out: ', data.devID);
    // miner.stopMining({ 'devId': data.devID });
  });

  miner.on("error", function (devID, data) {
    if (devID)
      Debug.IbctLogErr(COMP, 'Miner' + devID + ':', data);
    else
      Debug.IbctLogErr(COMP, data);
  });

  miner.on("warning", function (devID, data) {
    if (devID)
      Debug.IbctLogDbg(COMP, 'Miner' + devID + ':', data);
    else
      Debug.IbctLogDbg(COMP, data);
  });

  setTimeout(function() {
    if (mode === 1) {
      Debug.IbctLogDbg(COMP, 'Burn Image')
      fs.readFile('./v0.0.3r.bin', (err, data) => {
        if (err) {
          Debug.IbctLogErr(COMP, err)
        } else {
          miner.BurnMiningFirmware(null, data, function (err, data) {
            if (err) {
              Debug.IbctLogErr(COMP, err)
              return
            }

            Debug.IbctLogDbg(COMP, 'Burn ', (data * 100).toFixed(1), '%')
            if ((data * 100).toFixed(1) === '100.0') {
              Debug.IbctLogDbg(COMP, 'Burn Complete')
            }
          })
        }
      })
    } else if (mode === 2) {
      Debug.IbctLogDbg(COMP, 'Reboot')
      miner.RebootMining(null)
    } else if (mode === 3) {
      Debug.IbctLogDbg(COMP, 'Set led on')
      miner.SetMiningLed(null, true)
      setTimeout(function() {
        Debug.IbctLogDbg(COMP, 'Set led off')
        miner.SetMiningLed(null, false)
      }, 5000)
    } else if (mode === 4) {
      Debug.IbctLogDbg(COMP, 'Stop Miner')
      miner.stopMining(null)
    } else if (mode === 5) {
      Debug.IbctLogDbg(COMP, 'Exit Miner')
      miner.exitMining()
    }
  }, 10000)

  setInterval(function () {
    devState = miner.getMiningStatus();
    Debug.IbctLogDbg(COMP, JSON.stringify(devState));
  }, 10000);
})();
  1. startMining() input: null: 所有设备开始挖矿 或: 指定设备开始挖矿 { “devID”: 0, } Output: null

  2. stopMining() input: null: 关闭所有设备 或: 关闭指定设备 { “devID”: 0 } Output: null

  3. getMiningStatus() input: null: 输出所有设备的状态 或: 输出指定设备的状态 { “devID”: 0, } Output: [ { “devID”: 0, “miningName”:“simplenode”, “miningSN”:“X10B92451F3EE7”, “miningType”:“sipc”, “state”: “on”, “version”: “V0.0.1”, “hashrate”: “845KH/s”, “avHashrate”: “820KH/s”, “hardwareErr”: 300, “rejected”: 100, “nonces”: 100, “accepted”: 100, “temperatue”: “50℃”, “elapsed”: “10h15m6s”, “pools”: { “host”: “sipc.ss.dxpool.com”, “port”: 8008, “user”: “sunwei.b2”, “pass”: “x” } } ]

  4. RebootMining() input null: 关闭所有设备 或: 关闭指定设备 { “devID”: 0, } Output: null

  5. SetMiningLed(Device, Enable) input Device: null: 关闭所有设备 或: 关闭指定设备 { “devID”: 0, “enable”: true } Status: true: 某种灯状态 或 false: 还原置灯之前的灯状态

  6. BurnMiningFirmware(Device, Image, Callback) input Device null: 关闭所有设备 或: 关闭指定设备 { “devID”: 0, } Image 烧入镜像 烧入实例: burnFirmware() { fs.readFile('./head.bin', (err, data) => { if (err) { Debug.IbctLogErr(COMP, err); } else { miner.BurnMiningFirmware(null, data, function (err, data) { if (err) { Debug.IbctLogErr(COMP, err); return; }

         Debug.IbctLogDbg(COMP, 'Burn ', (data * 100).toFixed(1), '%');
         if ((data * 100).toFixed(1) === '100.0') {
           Debug.IbctLogDbg(COMP, 'Burn Complete');
         }
       });
     }

    }); } 烧入完成请重新插拔矿机

  7. setMiningConfig(setName, settings) input: setName: 可以设置矿机的类型,目前只支持'pool' settings: 设置值。 如果是pool: { host: sipc.ss.dxpool.com, port: 8008, user: sunwei.b2, pass: 'x' }

  8. exitMining() input: null 释放miner相关资源 Output: null

  9. connectMining(Device) input Device: null: 连接所有设备 或: 连接指定设备 { “devID”: 0, }