aiostratum-proxy is a new,
open source stratum protocol (and altcoin derivatives) mining proxy. Its focus on being extensible/modular is one of its greatest strengths: users can create new
aiostratum-proxy coin/algos 'plug-ins' or 'modules' without having to modify
aiostratum-proxy itself.
Originally built as a learning exercise to better understand stratum protocol(s) and the mining ecosystem, I now think that others will benefit by making
aiostratum-proxy available for everyone to use.
The goal for
aiostratum-proxy is to make it the easiest solution for any coin/algorithm pool proxying needs, via the creation of JSONRPC (the stratum base 'language') modules.
More information available at the
aiostratum-proxy Github repository.
Current Status:As mentioned,
aiostratum-proxy is new, and is looking for some testing beyond what I've thrown at it. Current coin/algo support is Equihash-only (more to come, given community interest). Constructive feedback is needed and appreciated.
Donations:There is
no dev fee. However, I eat food and need to support those around me - devs need to make money too. Consider it incentive to maintain and continue developing
aiostratum-proxy. So if you use this proxy,
donate using the addresses below:
- BTC: 1BS4QYAFiya4tsjyvHeY945biKnDj6bRA4
- LTC: LTN1LPGnJjHMKq4DcuQYifQgLfT4Phmn9d
- ETH: 0x4B005e68D323bdABD8eeD1D415117Ff1B57b3EC5
- BTCP: b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg
- ZCL: t1eoqTqyatJzL2rErW83waZLQHZLKuipMbi
Don't have any of the above? I'll look into getting an address in your choice currency.
Features:The intention for
aiostratum-proxy was to be feature-comparable with existing mining proxies, yet extensible without forking to add support for other coins.
- Configure multiple proxies to run at the same time (ie. mine same/different coins on same/different pools)
- Each proxy configuration supports multiple fallback pools
- Each proxy supports up to 65536 miner connections, each mining a separate nonce space (dependent on coin & miner support)
- Supports plaintext and secure connections (TLS/SSL) for both miner and pool connections
- Easily implement new coin/algorithm JSONRPC 'stratum-like' protocols as dynamically-loaded (via config file), external Python3 modules
Supported Coins/Algos:- Equihash
- ... it's a bit lonely here, let's add some more maybe?
How you can help:- Test!
- Create coin/algo modules (submit pull requests)
- Find bugs (File them on Github)
- Donate (see above!)
- Spread the word to coin dev teams, pool operators, other miners
- ... share your ideas for improvement
Requirements & Compatibility:aiostratum-proxy is written using Python3's non-blocking
async/await syntax - so
Python 3.5 or greater is required.
It runs on
Linux and macOS, and
should work on Windows (send in reports, please).
Installation:Read all of the Installation and Usage sections before proceeding with installing.It's best to always refer to the
aiostratum-proxy Github repository for source code and updated installation and usage instructions - but for the eager miners out there... installation is pretty simple:
pip install aiostratum-proxy
... but you probably really want to
use Python virtual environments to contain the installation, rather than installing globally:
# this will create a directory 'containing' the Python3 virtual environment
python3 -m venv aiostratum_proxy
cd aiostratum_proxy
# this will install the aiostratum-proxy package
bin/pip install aiostratum-proxy
# verify the installation by checking the package version
bin/aiostratum-proxy --version
# view the built-in command-line help
bin/aiostratum-proxy --help
As you can see, installation creates a new command-line shortcut called
aiostratum-proxy.
Usage:A YAML config file is needed for the proxy to run (
learn more about YAML); you can generate one:
bin/aiostratum-proxy --generate-config > proxy-config.yaml
Open and edit the generated proxy-config.yaml in a text editor. To run aiostratum-proxy, pass it your edited config file:
bin/aiostratum-proxy --config proxy-config.yaml
While you probably should always generate and edit your own config using the above instructions, here's a couple of sample configs for mining Bitcoin Private (BTCP) - to show you how simple they can be. Remember to modify addresses, usernames, passwords to use your own:
proxies:
- worker_class: aiostratum_proxy.protocols.equihash.EquihashWorkerProtocol
pool_class: aiostratum_proxy.protocols.equihash.EquihashPoolProtocol
listen:
- host: ''
port: 10666
pools:
- host: pool2.btcprivate.org
port: 3032
account_name: b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg
account_password: x
The above uses the included Equihash support, defines a single unsecured port for miners to connect to and a single pool to proxy to. Simple, but not very secure or robust. Let's try again, adding in secure connections and a fallback pool:
proxies:
- worker_class: aiostratum_proxy.protocols.equihash.EquihashWorkerProtocol
pool_class: aiostratum_proxy.protocols.equihash.EquihashPoolProtocol
listen:
- host: ''
port: 10666
- host: ''
port: 10667
ssl: true
ssl_cert_file:
ssl_cert_key_file:
pools:
- host: pool2.btcprivate.org
port: 3032
account_name: b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg
account_password: x
- host: btcp.suprnova.cc
port: 6825
ssl: true
account_name: wetblanket
account_password: mypw
The above uses the included Equihash support, defines 2 ports for miners to connect to (1 of them being SSL/TLS secured) and 2 pools to proxy to (the second being the fallback).
Authorization Setting Notes:Handily,
aiostratum-proxy will automatically extract the worker name from each miner's authorization (when it connects) and appends it to the
account_name config setting before authorizing with the pool. This allows you to continue per-miner hash/share rate tracking at the pool level. (Thanks
Doftorul for the feedback!)
Step by step explanation:
- Miner connects to aiostratum-proxy with randomletters.worker1
- aiostratum-proxy extracts worker1 from the miner's auth
- aiostratum-proxy appends worker1 to the config file pool account_name setting giving us b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg.worker1
- aiostratum-proxy requests authorization from the pool for b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg.worker1
- Miner is authorized, stats are tracked at the pool as desired
Note that you CAN optionally put a worker name in the config file pool
account_name setting (ie.
b1CACK65UTwzmHGw2VvyozdPsRLMb8utGLg.worker1, but this will cause miner-specific worker names to be ignored. You might want this in a larger farm setup, perhaps.
Release Notes:1.0.2 2018/07/13- Fixing keepalive issue
- Added debug statement to help detect miner/proxy misconfiguration
1.0.1 2018/07/12- Adding in worker socket keepalive configuration
1.0.0 2018/03/22Future Ideas/Thoughts:This section contains some ideas that may not get implemented - it depends on community feedback.
- Improve documentation
- Consider immediate reply to miner share submissions instead of waiting for pool response
- Complete mining.set_extranonce support
- Consider additional authentication improvements (currently miners aren't authenticated)
- authenticate miners locally within proxy via config
- authenticate miners via passthru to pool; would require per-pool mappings of username/password for fallback pools in config?
- Add HAProxy PROXY protocol support
- Collect stats (for console display/API purposes)
- Create stats JSON API endpoint
- More coin/algo support
- Complete Bitcoin/Litecoin/etc stratum module (aiostratum_proxy.protocols.stratum.StratumPoolProtocol & aiostratum_proxy.protocols.stratum.StratumWorkerProtocol)
- Ethereum (ETH) protocol(s) support?
- ... share your thoughts/ideas