Browse Source

updated README

pull/123/head
notgiven688 3 years ago
parent
commit
c15c587fb9
1 changed files with 29 additions and 14 deletions
  1. +29
    -14
      README.md

+ 29
- 14
README.md View File

@ -1,6 +1,6 @@
# webminerpool
*Complete* sources for a monero (aeon) webminer. Hard fork (v7) ready. Try it here:
**Complete sources** for a monero (aeon) webminer. **Hard fork (v7) ready**. Try it here:
#### [Monero example](https://webminerpool.com/)
@ -12,7 +12,9 @@ _The server_ is written in **C#**, **optionally calling C**-routines to check ha
_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.
# Overview
The project exists since September 2017 and is now fully open sourced, i.e. the server and the client (including the webassembly miner) can be build from the codebase.
# Repository Content
### SDK
@ -39,16 +41,12 @@ The SDK directory contains all client side mining scripts which allow mining in
In this example the webminerpool.com server is used. A dynamic fee (about 4%) is used to cover hosting costs. You can also connect to your own server by altering the server variable in the script itself or using for example
```html
<script src="webmr.js"></script>
<script>
server = "ws://localhost:8181"
startMining("minexmr.com","49kkH7rdoKyFsb1kYPKjCYiR2xy1XdnJNAY1e7XerwQFb57XQaRP7Npfk5xm1MezGn2yRBz6FWtGCFVKnzNTwSGJ3ZrLtHU");
</script>
(...)
```
webmr.js can be found under SDK/xmr/miner_compressed (or for Aeon SDK/aeon/miner_compressed).
@ -58,7 +56,7 @@ The startMining function can take additional arguments
startMining(pool, address, password, numThreads, userid);
```
- pool, this has to be a pool available at webminerpool.com.
- 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.
@ -86,7 +84,7 @@ or with optional input parameters:
startMiningWithId(loginid, numThreads, userid)
```
Get a loginid by opening "register.html" in SDK/xmr/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.
Get a loginid by opening *register.html* in SDK/xmr/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?
@ -96,25 +94,42 @@ SDK/xmr/miner_compressed/webmr.js simply combines
2. SDK/xmr/miner_raw/worker.js
3. SDK/xmr/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 "hash_cn" below.
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 "hash_cn" below.
### Server
The C# server. To compile under linux using mono and msbuild use
```bash
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](https://github.com/statianzo/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
```bash
./build
```
and follow the instructions. No additional 3rd party libraries are needed.
and follow the instructions. No additional libraries are needed.
```bash
mono server.exe
```
should run the server. Additional information will follow soon.
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*](http://ipset.netfilter.org/iptables.man.html). 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 (ws**s**://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 from the certificates you get for example from [*Let's Encrypt*](https://letsencrypt.org/) use the command
```bash
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.
### hash_cn
The monero/aeon cryptonight hashing functions in C code. With simple Makefiles 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.
The monero/aeon cryptonight hashing functions in C-code. With simple Makefiles for use with gcc and emcc - the emscripten webassembly compiler (use the "make" command to compile). libhash should be compiled so that the server can check hashes calculated by the user.
# ToDo

Loading…
Cancel
Save