All Projects → notgiven688 → Webminerpool

notgiven688 / Webminerpool

Complete sources for a monero webminer.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Webminerpool

Coin Hive Stratum
use CoinHive's JavaScript miner on any stratum pool
Stars: ✭ 380 (+117.14%)
Mutual labels:  cryptocurrency, mining, monero, xmr
Xmr Miner
Web-based Cryptocurrency miner, built with Vue.js
Stars: ✭ 444 (+153.71%)
Mutual labels:  cryptocurrency, mining, monero, xmr
Lime Miner
a simple hidden silent XMR miner.
Stars: ✭ 109 (-37.71%)
Mutual labels:  mining, monero, xmr
Crypto-Webminer
Use Crypto Webminer JavaScript miner on various Cryptonight | CN-Lite | CN-Fast | CN-Fast2 | CN-Pico | CN-RWZ | CN-UPX2 | CN-Half | CN-Heavy | CN-Saber (BitTube) | Argon2id - Chukwa Stratum Pools
Stars: ✭ 166 (-5.14%)
Mutual labels:  mining, monero, xmr
SilentXMRMiner
A Silent (Hidden) Monero (XMR) Miner Builder
Stars: ✭ 417 (+138.29%)
Mutual labels:  mining, monero, xmr
Mithril
Pure Rust Monero Miner
Stars: ✭ 112 (-36%)
Mutual labels:  cryptocurrency, mining, monero
xrig
High performance cryptonight miner for AMD cards. Designed for large-scale use of RX Vega.
Stars: ✭ 23 (-86.86%)
Mutual labels:  mining, monero, xmr
Kasisto
A Monero Point of Sale payment system
Stars: ✭ 120 (-31.43%)
Mutual labels:  cryptocurrency, monero, xmr
Xmrig
RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner
Stars: ✭ 6,372 (+3541.14%)
Mutual labels:  cryptocurrency, monero, xmr
React Coin Hive
Mine cryptocurrency while your users haven't engaged with your content lately
Stars: ✭ 153 (-12.57%)
Mutual labels:  cryptocurrency, monero, xmr
Monero Testnet Sandbox
Monero (XMR) testnet sandbox with 3 daemons and 3 wallets
Stars: ✭ 12 (-93.14%)
Mutual labels:  cryptocurrency, monero, xmr
Deepminer
deepMiner webminer proxy (update for cryptoNight R)
Stars: ✭ 497 (+184%)
Mutual labels:  mining, monero, xmr
Cryptogoblin
CryptoNote CPU/GPU mining tool for Monero (XMR)
Stars: ✭ 39 (-77.71%)
Mutual labels:  mining, monero, xmr
Xmrminer
An embeddable Monero miner written in Swift.
Stars: ✭ 87 (-50.29%)
Mutual labels:  cryptocurrency, monero
Gatelessgatesharp
Gateless Gate Sharp is an user-friendly yet extremely powerful open-source multi-algorithm miner for Windows operating systems.
Stars: ✭ 86 (-50.86%)
Mutual labels:  cryptocurrency, mining
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-43.43%)
Mutual labels:  cryptocurrency, monero
Awesome Privacy On Blockchains
A curated list of privacy on blockchains resources
Stars: ✭ 86 (-50.86%)
Mutual labels:  cryptocurrency, monero
Php Mpos
MPOS stands for Mining Portal Open Source. Issue tracker is now closed since it's not maintained anymore.
Stars: ✭ 1,501 (+757.71%)
Mutual labels:  cryptocurrency, mining
Monero Python
A comprehensive Python module for handling Monero cryptocurrency
Stars: ✭ 122 (-30.29%)
Mutual labels:  cryptocurrency, monero
Sumoeasyminer
The most easy, intuitive CPU miner for cryptonote-based cryptocurrency
Stars: ✭ 77 (-56%)
Mutual labels:  cryptocurrency, monero

webminerpool

Complete sources for a Monero (cryptonight and variants) webminer. Hard fork ready.

The server is written in C#, optionally calling C-routines to check hashes calculated by the clients. It acts as a proxy server for common pools.

The client runs in the browser using javascript and webassembly. websockets are used for the connection between the client and the server, webassembly to perform hash calculations, web workers for threads.

Thanks to nierdz there is a docker file available. See below.

Will RandomX (enabled in October) be supported?

No. Not at the moment. The problem here is that in principle one could compile code "on the fly" utilizing wasm but unfortunately some floating point operations used by RandomX are not supported by wasm. Workarounds would make the code slow.

The strategy is to rely on coins which are more easily mined in the browser. Pools like moneroocean.stream let you mine them in direct exchange for Monero.

Turtle coin utilizing cn-lite (very well mineable using webasm) will fork to another POW, called "chukwa". If there is support for this POW change on moneroocean (AND the algorithm turns out to be profitable) we will follow. The code is already in place (branch argon2) but needs some serious cleaning and optimizing.

Currently supported algorithms

# xmrig short notation webminerpool internal description
1 cn algo="cn", variant=-1 autodetect cryptonight variant (block.major - 6)
2 cn/0 algo="cn", variant=0 original cryptonight
3 cn/1 algo="cn", variant=1 also known as monero7 and cryptonight v7
4 cn/2 algo="cn", variant=2 or 3 cryptonight variant 2
5 cn/r algo="cn", variant=4 cryptonight variant 4 also known as cryptonightR
6 cn-lite algo="cn-lite", variant=-1 same as #1 with memory/2, iterations/2
7 cn-lite/0 algo="cn-lite", variant=0 same as #2 with memory/2, iterations/2
8 cn-lite/1 algo="cn-lite", variant=1 same as #3 with memory/2, iterations/2
9 cn-pico/trtl algo="cn-pico", variant=2 or 3 same as #4 with memory/8, iterations/8
10 cn-half algo="cn-half", variant=2 or 3 same as #4 with memory/1, iterations/2
11 cn/rwz algo="cn-rwz", variant=2 or 3 same as #4 with memory/1, iterations*3/4

What is new?

  • September 3, 2019

    • Added cn/rwz (CryptoNight v8 ReverseWaltz). (client-side / server-side)
  • March 1, 2019

    • Added cryptonight v4. Hard fork ready! Added support for cn/half and cn-pico/trtl. Added support for auto-algo switching. (client-side / server-side)
  • September 27, 2018

    • Added cryptonight v2. Hard fork ready! (client-side / server-side)
  • June 15, 2018

    • Support for blocks with more than 2^8 transactions. (client-side / server-side)
  • May 21, 2018

    • Support for multiple open tabs. Only one tab is constantly mining if several tabs/browser windows are open. (client-side)
  • May 6, 2018

    • Check if webasm is available. Please update the script. (client-side)
  • May 5, 2018

    • Support for multiple websocket servers in the client script (load-distribution).
  • April 26, 2018

    • A further improvement to fully support the extended stratum protocol. (server-side)
    • A simple json config-file holding all available pools. (server-side)
  • April 22, 2018

    • All cryptonight and cryptonight-light based coins are supported in a single miner. Stratum extension were implemented: The server now takes pool suggestions (algorithm and variant) into account. Defaults can be specified for each pool - that makes it possible to mine coins like Stellite, Turtlecoin,.. (client/server-side)
    • Client reconnect time gets larger with failed attempts. (client-side)

Repository Content

SDK

The SDK directory contains all client side mining scripts which allow mining in the browser.

Minimal working example

<script src="webmr.js"></script>

<script>
	server = "ws://localhost:8181"
	startMining("minexmr.com","49kkH7rdoKyFsb1kYPKjCYiR2xy1XdnJNAY1e7XerwQFb57XQaRP7Npfk5xm1MezGn2yRBz6FWtGCFVKnzNTwSGJ3ZrLtHU"); 
</script>

webmr.js can be found under SDK/miner_compressed.

The startMining function can take additional arguments

startMining(pool, address, password, numThreads, userid);
  • pool, this has to be a pool registered at the server.
  • address, a valid XMR address you want to mine to.
  • password, password for your pool. Often not needed.
  • numThreads, the number of threads the miner uses. Use "-1" for auto-config.
  • userid, allows you to identify the number of hashes calculated by a user. Can be any string with a length < 200 characters.

To throttle the miner just use the global variable "throttleMiner", e.g.

startMining(..);
throttleMiner = 20;

If you set this value to 20, the cpu workload will be approx. 80% (for 1 thread / CPU). Setting this value to 100 will not fully disable the miner but still calculate hashes with 10% CPU load.

If you do not want to show the user your address or even the password you have to create a loginid. With the loginid you can start mining with

startMiningWithId(loginid)

or with optional input parameters:

startMiningWithId(loginid, numThreads, userid)

Get a loginid by opening register.html in SDK/other. You also find a script which enumerates all available pools and a script which shows you the amount of hashes calculated by a userid. These files are quite self-explanatory.

What are all the *.js files?

SDK/miner_compressed/webmr.js simply combines

  1. SDK/miner_raw/miner.js
  2. SDK/miner_raw/worker.js
  3. SDK/miner_raw/cn.js

Where miner.js handles the server-client connection, worker.js are web workers calculating cryptonight hashes using cn.js - a emscripten generated wrapped webassembly file. The webassembly file can also be compiled by you, see section hash_cn below.

Server

The C# server. It acts as proxy between the clients (the browser miners) and the pool server. Whenever several clients use the same credentials (pool, address and password) they get "bundled" into a single pool connection, i.e. only a single connection is seen by the pool server. This measure helps to prevent overloading regular pool servers with many low-hash web miners.

The server uses asynchronous websockets provided by the FLECK library. Smaller fixes were applied to keep memory usage low. The server code should be able to handle several thousand connections with modest resource usage.

The following compilation instructions apply for linux systems. Windows users have to use Visual Studio to compile the sources.

To compile under linux (with mono and msbuild) use

./build

and follow the instructions. No additional libraries are needed.

mono server.exe

should run the server.

Optionally you can compile the C-library libhash.so found in hash_cn. Place this library in the same folder as server.exe. If this library is present the server will make use of it and check hashes which gets submitted by the clients. If clients submit bad hashes ("low diff shares"), they get disconnected. The server occasionally writes ip-addresses to ip_list. These addresses should get (temporarily) banned on your server for example by adding them to iptables. The file can be deleted after the ban. See Firewall.cs for rules when a client is seen as malicious - submitting wrong hashes is one possibility.

Without a SSL certificate the server will open a regular websocket (ws://0.0.0.0:8181). To use websocket secure (wss://0.0.0.0:8181) you should place certificate.pfx (a pkcs12 file) into the server directory. The default password which the server uses to load the certificate is "miner". To create a pkcs12 file from regular certificates, e.g. from Let's Encrypt, use the command

openssl pkcs12 -export -out certificate.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem

The server should autodetect the certificate on startup and create a secure websocket.

Attention: Most linux based systems have a (low) fixed limit of available file-descriptors configured ("ulimit"). This can cause an unwanted upper limit for the users who can connect (typical 1000). You should change this limit if you want to have more connections.

hash_cn

The cryptonight hashing functions in C-code. With simple Makefiles (use the "make" command to compile) for use with gcc and emcc - the emscripten webassembly compiler. libhash should be compiled so that the server can check hashes calculated by the user.

Dockerization

Find the original pull request with instructions by nierdz here.

Added Dockerfile and entrypoint.sh. Inside entrypoint.sh, if $DOMAIN is provided, a certificate is registered and packed in pkcs12 format to be used with server.exe.

cd webminerpool
docker build -t webminerpool .

To run it:

docker run -d -p 80:80 -p 8181:8181 -e DOMAIN=mydomain.com webminerpool

The 80:80 bind is used to obtain a certificate. The 8181:8181 bind is used for server itself.

If you want to bind these ports to a specific IP, you can do this:

docker run -d -p xx.xx.xx.xx:80:80 -p xx.xx.xx.xx:8181:8181 -e DOMAIN=mydomain.com webminerpool

You can even use docker-compose, here is a sample snippet:

webminer:
  container_name: webminer
  image: webminer:1.0
  build:
    context: ./webminerpool
  restart: always
  ports:
    - ${WEBMINER_IP}:80:80
    - ${WEBMINER_IP}:8181:8181
  environment:
    DOMAIN: ${WEBMINER_DOMAIN}
  networks:
    - my-network

To use this snippet, you need to define $WEBMINER_DOMAIN and $WEBMINER_IP in a .env file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].