Skip to content

alex3s/scala-puddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-puddle

work in progress - not working correctly yet - only for educational purposes

A Scala (XLA) mining pool server written in C based on the excellent and fast monero-pool by jtgrassie. For a full fetched version of Scala pool featuring all kind of statistics, check https://github.com/scala-network/scala-pool

This fast and light pool is intended to be run on local network and serve your local devices. In fact, thanks to the original implementation by JtGrassie it's fast enough to be compiled and run on your Android or Linux mobile phone. Forked from Wownero-puddle.

Compiling from source

  1. Compiling on Debian or Ubuntu Linux
  2. Compiling on ARM based systems. Raspbery Pi or Android within the Termux app command environment. This readme features compiling on Linux. Compiling on Android inside Termux app follows soon. (it's possible, trick is to get the correct packages first: apt install ... list coming soon)

Dependencies

The build system requires the Scala node source tree to be cloned and compiled. Follow the instructions for compiling Scala local node, then export the following variable:

export MONERO_ROOT=/path/to/cloned/scala

Replacing the path appropriately.

Beyond the Scala dependencies, the following extra libraries are also required to build the pool:

  • liblmdb
  • libevent
  • json-c
  • uuid

As an example, on Ubuntu, these dependencies can be installed with the following command:

sudo apt-get install liblmdb-dev libevent-dev libjson-c-dev uuid-dev

Compile

After installing all the dependencies as described above, to compile the pool as a release build, run:

make release

The application will be built in build/release/.

Optionally you can compile a debug build by simply running:

make

Debug builds are output in build/debug/.

Configuration

During compilation, a copy of pool.conf is placed in the output build directory. Edit this file as you see fit. When running the pool, if a custom location is not set via the command-line parameter --config-file <file>, the pool will first look for this file in the same directory as the pool binary, then in the current users home directory. The configuration options should all be self explanatory.

There are also some command-line parameters which can be used to override some of these settings.

Block notification

There is one configuration option that deserves a special mention.

You can optionally start the pool with the flag --block-notified (or set in the config file: block-notified = 1). This will prevent the pool from polling for new blocks using a timer, and instead, fetch a new block template when it receives a signal (specifically, SIGUSR1). Now whenever you start scalad, you'll make use of its --block-notify option.

E.g.

scalad ... --block-notify '/usr/bin/pkill -USR1 monero-pool'

This instructs scalad to send the required signal, SIGUSR1, to your pool whenever a new block is added to the chain.

Using this mechanism has a significant benefit - your pool immediatley knows when to fetch a new block template to send to your miners. You're essentially giving your miners a head-start over miners in pools which use polling (which is what all the other pool implementations do).

Running

To run the server first start the local Scala Node (scalad): /path/to/cloned/scala/build/Linux/development/release/bin/scalad Wait until the daemon synchronizes with the network.

Ensure you have your Scala daemon (scalad) is up and running with the correct host and port settings as defined in your pool config file.

In case if you are running more than a local networking pool and you want to enable payments: also start wallet RPC (scala-wallet-rpc)

It is highly recommended to run these on the same host as the pool server to avoid any network latency when their RPC methods are called.

Then simply cd build/[debug|release] and run ./monero-pool.

Command-line parameters

A few of the configuration options can be overridden via the following command-line parameters:

-c, --config-file <file>
-l, --log-file <file>
-b, --block-notified [0|1]
-d, --data-dir <dir>
-p, --pid-file <file>
-f, --forked [0|1]

Web UI

There is a minimal web UI that gets served on the port specified in the config file. If you plan on running a public pool, it's advisable to use either Apache or Nginx as a proxy in front of this with some appropriate caching configured. The goal is to offload browser based traffic to something built for the task and allow the pool to focus on its primary function - serving miners.

If you intend to make changes to the web UI, note that the HTML gets compiled into the pool binary. The single web page that gets served simply makes use of a JSON endpoint to populate the stats.

SSL

The pool has been tested behind both HAProxy and stunnel, so if you wish to provide SSL access to the pool, these are both good options and simple to setup. The reference pool makes use of HAProxy and port 4343 for SSL traffic.

The web UI, as mentioned above, should ideally be placed behind a caching proxy. Therefore SSL termination should be be configured there (i.e. in Apache/Nginx).

Help / Contact

Supporting the project

This mining pool has no built-in developer donation (like other mining pool software has), so if you use it and want to donate, Scala (XLA) donations to:

Svky3xkbHvXFD8Y1WcrgasZEWEmr3n125XRnjPvz5bcqaVZb548rGoCggZ6bhTDE4GKu4G4kCU1bNHbTeiLZpMCs22QUW3PEi

Thanks!

License

Please see the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •