Code Monkey home page Code Monkey logo

handyminer-goldshell-cli's Introduction

HandyMiner-Goldshell-CLI

Now Supporting the Goldshell HS1-Plus!

HandyMiner Team Donation Address (HNS): hs1qwfpd5ukdwdew7tn7vdgtk0luglgckp3klj44f8

HandyMiner Team Donation Address (BTC): bc1qk3rk4kgek0hzpgs8qj4yej9j5fs7kcnjk7kuvt

Quick Links

HandyMiner Social Channels:

HandshakeTalk Telegram

Description: A simple CLI interface (+optional Dashboard) for HSD Mining to enable the Goldshell HS1 to communicate with Handshake HSD via Stratum Mining.

Easy Installation

   Easily installed within minutes.
   Simple ASIC Configuration setup.
   Note: Make sure your device is set to not sleep automatically, otherwise your miner will stop mining.

HandyMiner Running with Dashboard Enabled

Imgur

PREREQUISITES

Node.js v10.4 and above (whatever one has bigint support)

(Windows Users) Git Bash A handy bash terminal, install in Program Files/Git

(Windows Users) Download STM32 Virtual COM PORT driver OR Download STM32 Virtual COM PORT driver from STMicroelectronics

Linux: Dependencies install can be found in ./linux_installation.md

Raspberry Pi Installation Steps ./raspberry_pi_installation.md

INSTALLATION

> Clone this repo or Download & Install as ZIP :

Download Latest from Releases

Note: un-zipping the full contents may take a bit.

> Install Dependencies (mac/linux/windows) :

npm install in this directory or

> Windows Double-click install dependencies :

Double-click install.windows.bat.

Windows folks: If you didnt double click install.windows.bat youll need to run the following command in the repo root:

npm install

THE POINT

First, make sure to plug AC power into the Goldshell HS1 and connect the USB from the HS1 to your computer.

Non-terminal users: simply double click (windows) dashboard.windows.bat or (mac) dashboard.mac.command or (linux) dashboard.sh files.

Note: The first time you launch will run you thru the miner configurator.

Launch the miner in terminal in a bash terminal (windows: git-bash) like:

cd (into the repo base)
npm start (runs the CLI miner)

Most terminals:
npm run dashboard //runs the CLI dashboard+miner
OR
./dashboard.sh //same

Note: many windows terminals dont do text coloring or dashboards right with npm run commands.. So if it's an issue (and you didnt double click) you can launch the proper dashboard like:

node ./miner/dashboard.js

Ubuntu Users note:

To have this app talk to the goldshell serial devices out of the box, you may have to run with sudo (we did in ubuntu, but not raspi). If you run node mine.js and run into errors: To grant permissions to your user to talk to the devices without sudo, perform the steps in the Ubuntu FAQ

Mine blocks!

(Ctrl+C, Q, or ESC to stop the dashboard miner)

MINER CONFIGURATOR

The first time you run the miner, you will run through a configurator which will write a config to ./goldshell.json. Should you want to reconfigure in the future, you can just run node configure.js in this directory. Alternately delete goldshell.json and (re)start the miner.

Required items to have ready for configuration:

  1. Host or IP address of the pool or solo node you mine to (127.0.0.1 for your local fullnode)
  2. (Pool mining) Your wallet address or registered pool username

Optional configuration items (just leave blank and hit enter if you dont know) :

  1. Pool or solo node port (probably 3008)
  2. The stratum password (optional)

POOL SETTINGS

DXPOOL

stratum host: hns.ss.dxpool.com stratum port: 3008

username: registered_username.workerName password: anything

F2POOL

stratum host: hns.f2pool.com stratum_port: 6000

non-registered: username: walletAddress.workerName password: anything

registered: username: username.workerName password: anything

hnspool

stratum host: stratum-us.hnspool.com stratum_port: 3001

non-registered: username: walletAddress.workerName password: anything

registered: username: hnspool_registered_username.workerName password: anything

Advanced Options:

App/API developers: You can run like HANDYRAW=true node mine.js or set the environment variable HANDYRAW=true and the miner executable will output raw JSON. The dashboard application is built using the raw CLI JSON output.

Multiple Configs!: If you want to use different worker names or pools with the same miner executable, you can pass in your custom config.json into the miner like: node mine.js myCustomConfigName.json Note the miner will default to config.json without this argument.

ASIC per Config: If you are using multiple configs, you may want to group multiple Goldshell HS1's as you see fit. Within goldshell.json the line asics:"-1" can change to: asics:"COM1,COM2". basically the COM* values are the ports displayed initially when you start the miner with node mine.js

Mining FAQ:

  1. I started the dashboard and it says connection to 127.0.0.1 is timed out and trying again in 20s.

This means your fullnode is not running. Please launch a fullnode or mine to a pool IP address.

  1. No ASICs were detected.

Ensure the blue LED next to the USB port on the HS1 is solid blue. If so, and you're in Windows, Download STM32 Virtual COM PORT driver from Goldshell so that the ASIC can be detected

  1. Solo miners: We do not auto-start the fullnode for you here like we do in HandyMiner-GUI. However we made it easy here. If you want to run your own fullnode to mine to with the provided utilities: docker fullnode instructions

  2. Windows may also need to add the following two items added to the Path environment variable:

C:\Program Files\nodejs\node_modules\npm\bin

Ubuntu FAQ

If you try to mine out of the box without sudo you may see an error that looks like:

asic connection error:: [Error: Error: Permission denied, cannot open /dev/ttyACM0]

If you dont want to run as sudo, you can modify your permissions to the ASIC device like so:

Notice the serial address in the error ^^ : /dev/ttyACM0 On the terminal, we will need to add your user to the group that owns the serial device, then restart the Linux machine.

To add your user to the device group for access:
the easy way: sudo ./linux_grant_serial_permissions.sh, and then restart the linux machine.
or the less easier way:
  1. Run the command with the device ID listed in the error, like: ls -la /dev/ttyACM0 It will output something like: crw-rw---- 1 root dialout 166, 0 Jul 18 18:06 /dev/ttyACM0 Which in our case, the group is dialout
  2. To add your username to the dialout group: sudo useradd -G dialout $USER (OR ON SOME SYSTEMS) sudo adduser $USER dialout
  3. Now restart the computer and voila, you can now mine without sudo!
       _.-._        _.-._
     _| | | |      | | | |_
    | | | | |      | | | | |
    | | | | |      | | | | |
    | _.-'  | _  _ |  '-._ |
    ;_.-'.-'/`/  \`\`-.'-._;
    |   '    /    \    '   |
     \  '.  /      \  .`  /
      |    |        |    |

EPIC Thanks to chjj and the entire Handshake Project

EPIC Thanks to Steven McKie for being my mentor/believing in me

EPIC Thanks to the Goldshell team for making innovative hardware

Copyright 2020 HandyMiner

Copyright 2020 Alex Smith - [email protected]

Copyright 2020 Steven McKie - [email protected]

Copyright 2020 Thomas Costanzo - [email protected]

LICENSE

handyminer-goldshell-cli's People

Contributors

alexsmith540 avatar smcki012 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

handyminer-goldshell-cli's Issues

Error: Inappropriate ioctl for device setting custom baud rate of 9600

My HS1+ is set up on my HiveOS rig was running fine for the last couple of weeks, miner crashed last night and now whenever I try to start the miner with HandyMiner it looks like it connects but the dashboard never opens up.

Using "npm start" I did see the following error:
image

Using "npm run dashboard" I get the following, it looks like its connected and receives new work:
image

Stratum

hi, we want to develop hns mining pool,is there any detail stratum document for HandyMiner?

How to use nonce returnd by HS1 minner to submitwork to nodes?

Hi there,
I'v tested it on HNS MAINNET by HS1
Following is the logs Interactive journal of my test,

//subscribe
{"method":"mining.subscribe","id":0,"params":["icbtminer"]}
//authorize
{"method":"mining.authorize","id":1,"params":["GoldShell.H10B0291C354D4","x"]}

{"id":0,"result":[[["mining.set_difficulty","ae000000"],["mining.notify","ae000000"]],"ae000000",24],"error":null}
{"id":null,"method":"mining.set_difficulty","params":[128]}

{"id": 1, "result": true, "error": null}


//notify
{"id":null,"method":"mining.notify","params":["3","00000000000000005a15f73435b4b326894a88acafaa5bd2854435a108fb2060","9d5ea4e0b886a02fa8cb6ac14eb56de194c69111197a3dc3d31dcfeb3d49c6a7","31ec2ee912ceeef819ea37b5e1c35e64746c77413a01e8617a46c48fe6bca046","4a4d980553ed32d1819780c190a0a9947210af17cfcd92a085ae073b2c7f3a1b","0000000000000000000000000000000000000000000000000000000000000000","00000000","1906292f","5fc5a7b8"]}

//submit
{"method":"mining.submit","id":2,"params":["GoldShell.H10B0291C354D4","3","00000002","5fc5a7b8","ed796623","0000000000000000000000000000000000000000000000000000000000000000"]}
           ----------------------------------
           |
           ⬇

//submit parse

"blockin.H10B0291C354D4",  //username
"3",                       //jobID
"00000002",                //nonce2
"5fc5a7b8",                //response.nonce.slice(0,8) time
"ed796623",                //response.nonce.slice(8,16)
"0000000000000000000000000000000000000000000000000000000000000000"  //mask  ???

How to get the extraNonce(24 Bytes) required by the node via nonce/nonce2 of mining.submit .
Also, the last field is mask?

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.