Skip to content

MyHush/hushwebminer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hush Web Miner

This miner turns 1 CPU + 256MB RAM + 1 browser tab into HUSH cryptocurrency, a zkSNARK coin related to Zcash.

Installation requirements

Perl 5.8 or higher as your system Perl, which just about every operating system has these days. No special CPAN modules are required to be installed, this repo comes with the CPAN module AnyEvent to implement asynchronous I/O.

No apache is required, no mysql, no php is required. Nginx is recommended to proxy requests in high traffic situations.

The server.pl in this repo implements it's own HTTP server, which is why nothing else is needed. It can serve static files and handle WebSocket connections.

Installing

You only need webassembly to compile new .WASM files, if you just want to host a webminer YOU DO NOT NEED the webassembly compiler on your server. Ignore any make or compile steps, just copy the .wasm file to the correct place, directly next to the similarly named .js :

hushwebminer.js hushwebminer.wasm

DO NOT edit the .js file directly, or the .wasm file will not load correctly. They are a pair.

git clone https://github.com/MyHush/hushwebminer/
cd hushwebminer
cd js-emscripten/ && make  # only if you want to re-compile!!!

TODO: explain this stuff more

  • Install js-emscripten/miner.html and hushminer.js and hushminer.wasm on web server.
  • Install js-backend/ on server as /ws

CPU Javascript miner for http://miner.myhush.org

Reimplementation of xenoncat/Tromp algorithm, just to understand it better by myself. Performs around the same as Tromp's equi1. It's single-threaded on purpose, and uses 256 MB of memory now. The aim was the pure C miner with no dependencies, that works of either little-endian or big-endian platform (ultrasparc speed is so pathetic).

c/ is portable C sources to produce binary for your platform.

js-emscripten/ is a port to emscipten for mining in WebAssembly-compatible browser

js-backend/ is a server-side support for browser mining, allows many sessions (tested up to 30K sessions, many thanks to https://github.com/kosjak1)

pool-emu/ may be handy for debugging your miners.

Code used:

CPU mining Hush from the Command Line

Make sure you compile the binary first:

cd c/
make

How to run binary:

./hushminer -l $POOL -u $TADDR -d 3

Here is a full example specifying a port and using the CPU mining port of the CloudPools.net mining pool:

./hushminer -P 5032 -l hush.cloudpools.net -u t1gztohnPzP2F7dCUonvkoQsMToHA2vVJTb.hushminer -d 2

Additionally a worker name of hushminer was used, which is optional.

The -d command line argument sets your debug level, 3 is good for debugging problems, 1 or 2 for normal operation.

Note that you will need to use a "CPU mining" port of your mining pool, otherwise your miner will be pooled with GPU miners and most likely never earn any shares.

Releases

No releases published

Packages

No packages published

Languages

  • Perl 47.4%
  • Other 26.2%
  • JavaScript 11.1%
  • C 10.6%
  • HTML 2.4%
  • C++ 1.7%
  • Other 0.6%