Stratum - ranchimall/stratum-mining GitHub Wiki

Stratum-Mining: Quick Start Guide

OS Setup

  • Ubuntu version: Ubuntu 18.04.5 LTS

Update your server:

sudo apt-get update
sudo apt-get dist-upgrade

Dependencies

  • Python version: Python 2.7.17
  • PIP version: pip 20.3.4

Install python dependencies

sudo apt-get install python-twisted python-mysqldb python-dev python-setuptools python-memcache python-simplejson python-pylibmc

Dependency versions

  • python-dev: 2.7.15~rc1-1
  • python-mysqldb: 1.3.10-1build1
  • python-setuptools: 39.0.1-2
  • python-simplejson: 3.13.2-1
  • python-pylibmc: 1.5.2-1build1
  • python-memcache: 1.57-2ubuntu0.18.04.1
  • python-twisted: 17.9.0-2ubuntu0.1

Install the python modules

pip install distribute==0.7.3
pip install setuptools-rust==0.10.3
pip install twisted==17.9.0
pip install ecdsa==0.17.0
pip install pyopenssl==17.5.0
pip install autobahn==19.11.2
pip install typing==3.10.0.0
pip install automat==0.6.0

Module versions

  • distribute: 0.7.3
  • setuptools-rust: 0.10.3
  • twisted: 17.9.0
  • ecdsa: 0.17.0
  • pyopenssl: 17.5.0
  • autobahn: 19.11.2
  • cryptography: 3.3.2
  • typing: 3.10.0.0
  • automat: 0.6.0

Download

Download the repo

git clone https://github.com/ranchimall/stratum-mining.git

Installation

Install litecoin_scrypt and stratum (assuming you are working in your home directory):

cd stratum-mining
git submodule init
git submodule update
git submodule foreach git pull origin master

cd externals/litecoin_scrypt
sudo python setup.py install

cd ~
cd stratum-mining/externals/stratum
sudo python setup.py install
  • stratum version 0.3.14

Database Setup

  • MySQL version: mysql Ver 14.14 Distrib 5.7.34

Install mySQL

sudo apt-get install mysql-server

If the secure installation does not launch automatically after the installation completes, enter the following command:

sudo mysql_secure_installation

This utility prompts you to define the mysql root password and other security-related options, including removing remote access to the root user and setting the root password. Create a database from the template

cd ~
sudo mysql -p -e "create database mpos"
sudo mysql -p mpos < stratum-mining/sql/base_structure.sql

Recommended (optional) Create and use a SQL user instead of root. Remember to give access to the database to the user.

Create username and password for MySQL

CREATE USER '<sql-username>'@'localhost' IDENTIFIED WITH mysql_native_password BY '<sql-password>';
GRANT ALL PRIVILEGES ON mpos.* TO '<sql-username>'@'localhost';
FLUSH PRIVILEGES;

Configuration

Now that we have everything installed we can configure stratum-mining to run:

cp stratum-mining/conf/config_sample.py stratum-mining/conf/config.py
nano stratum-mining/conf/config.py

You will need to adjust some settings for this to work:

CENTRAL_WALLET = '<Your_Valid_CryptoCoin_Address>'
[...]
COINDAEMON_TRUSTED_HOST = 'localhost'
COINDAEMON_TRUSTED_PORT = <rpc_port>
COINDAEMON_TRUSTED_USER = '<rpc_user>'
COINDAEMON_TRUSTED_PASSWORD = '<rpc_pass>'
COINDAEMON_ALGO = 'scrypt'
[...]
HOSTNAME = '<yourservername>'
[...]
DATABASE_DRIVER = 'mysql'
DB_MYSQL_HOST = 'localhost'
DB_MYSQL_DBNAME = 'mpos'
DB_MYSQL_USER = '<sql_user>'
DB_MYSQL_PASS = '<sql_pwd>'
[...]
POOL_TARGET = 16
[...]
SOLUTION_BLOCK_HASH = True

Starting stratum-mining

Change to the stratum-mining folder and fire up the service:

cd stratum-mining
twistd -ny launcher.tac

If you want to run it in the background you can remove the -ny and replace it with -y:

twistd -y launcher.tac
⚠️ **GitHub.com Fallback** ⚠️