Installing Dependencies

MPOS stands for Mining Portal Open Source. It is a unified mining interface for various Scrypt and SHA256d crypto-currencies. The project repository can be found at https://github.com/MPOS/php-mpos Unfortunately, MPOS does not natively support x11 based currencies like DASH, so we will have to use NOMP (Node Open Mining Portal). NOMP is an extremely efficient, highly scalable, all-in-one, easy to setup cryptocurrency mining pool written entirely in Node.js

DASHcan be built from the source with the instructions provided on https://github.com/dashpay/dash/blob/master/doc/build-unix.md

Installing NOMP

To install NOMP open up the terminal and type the following:

sudo apt update && sudo apt-get -y upgrade
sudo apt install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
sudo apt install libboost-all-dev git npm nodejs nodejs-legacy libminiupnpc-dev redis-server
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
source ~/.profile
nvm install 0.10.25
nvm use 0.10.25

We assume that you have set up the Dash Wallet/Dash Core/Dash Daemon correctly, and that your DASH configuration file (dash.conf for Dash Core) looks like this:

# Listening mode, enabled by default except when 'connect' is being used
listen=1

# Maximum number of inbound+outbound connections.
maxconnections=128

# JSON-RPC options (for controlling a running Dash/dashd process)

# server=1 tells Dash-Qt and dashd to accept JSON-RPC commands
server=1

# Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
# This option can be specified multiple times (default: bind to all interfaces)
#rpcbind=<addr>

# You must set rpcuser and rpcpassword to secure the JSON-RPC api
rpcuser=dashserver_etpnode3
rpcpassword=dashserver_etpnode31234566789

# How many seconds Dash Core will wait for a complete RPC HTTP request.
# after the HTTP connection is established. 
rpcclienttimeout=30

# server=1 tells Dash-Qt to accept JSON-RPC commands.
# it is also read by dashd to determine if RPC should be enabled 
rpcallowip=10.1.1.34/255.255.255.0
rpcallowip=1.2.3.4/24
rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
rpcallowip=127.0.0.1
rpcallowip=0.0.0.0/0

# Listen for RPC connections on this TCP port:
rpcport=9998

# You can use Dash or dashd to send commands to Dash/dashd
# running on another host using this option:
rpcconnect=188.166.247.123

# Transaction Fee Changes in 0.12.0

# Send transactions as zero-fee transactions if possible (default: 0)
#sendfreetransactions=0

# Create transactions that have enough fees (or priority) so they are likely to begin confirmation within n blocks (default: 1).
# This setting is over-ridden by the -paytxfee option.
#txconfirmtarget=n

# Miscellaneous options

# Pre-generate this many public/private key pairs, so wallet backups will be valid for
# both prior transactions and several dozen future transactions.
#keypool=100

paytxfee=0.00010

# User interface options

# Start Dash minimized
min=1

# Minimize to the system tray
minimizetotray=1

We are all set to install and configure NOMP.Type this in your terminal:

cd 
sudo mkdir nomp
cd nomp
sudo git clone https://github.com/zone117x/node-open-mining-portal.git .
sudo npm update
touch config.json #This is the main configuration file

While you are in nompdirectory, edit your main configuration file config.json (use the command sudo nano config.json) to look like this:

{
    "logLevel": "debug",
    "logColors": true,

    "cliPort": 17117,

    "clustering": {
        "enabled": true,
        "forks": "auto"
    },

    "defaultPoolConfigs": {
        "blockRefreshInterval": 1000,
        "jobRebroadcastTimeout": 120,
        "connectionTimeout": 120,
        "emitInvalidBlockHashes": false,
        "validateWorkerUsername": true,
        "tcpProxyProtocol": false,
        "banning": {
            "enabled": true,
            "time": 600,
            "invalidPercent": 50,
            "checkThreshold": 500,
            "purgeInterval": 300
        },
        "redis": {
            "host": "127.0.0.1",
            "port": 6379
        }
    },

    "website": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 80,
        "stratumHost": "cryppit.com",
        "stats": {
            "updateInterval": 60,
            "historicalRetention": 43200,
            "hashrateWindow": 300
        },
        "adminCenter": {
            "enabled": true,
            "password": "password"
        }
    },

    "redis": {
        "host": "127.0.0.1",
        "port": 6379
    },

    "switching": {
        "switch1": {
            "enabled": true,
            "algorithm": "x11",
            "ports": {
                "3333": {
                    "diff": 0.125,
                    "varDiff": {
                        "minDiff": 0.125,
                        "maxDiff": 5,
                        "targetTime": 60,
                        "retargetTime": 90,
                        "variancePercent": 30
                    }
                }
            }
        },
        "switch2": {
            "enabled": false,
            "algorithm": "scrypt",
            "ports": {
                "4444": {
                    "diff": 10,
                    "varDiff": {
                        "minDiff": 16,
                        "maxDiff": 512,
                        "targetTime": 15,
                        "retargetTime": 90,
                        "variancePercent": 30
                    }
                }
            }
        },
        "switch3": {
            "enabled": false,
            "algorithm": "x11",
            "ports": {
                "5555": {
                    "diff": 0.001,
                    "varDiff": {
                        "minDiff": 0.001,
                        "maxDiff": 1, 
                        "targetTime": 15, 
                        "retargetTime": 60, 
                        "variancePercent": 30 
                    }
                }
            }
        }
    },

    "profitSwitch": {
        "enabled": false,
        "updateInterval": 600,
        "depth": 0.90,
        "usePoloniex": true,
        "useCryptsy": true,
        "useMintpal": true,
        "useBittrex": true
    }
}

Save the file and close it.

Please Note: 1 Difficulty is actually 8192, 0.125 Difficulty is actually 1024. Whenever a miner submits a share, the pool counts the difficulty and keeps adding them as the shares, i.e. Miner 1 mines at 0.1 difficulty and finds 10 shares, the pool sees it as 1 share. Miner 2 mines at 0.5 difficulty and finds 5 shares, the pool sees it as 2.5 shares.

Go the the coins directory and look for dash.json file. If it doesn't exist, while in the coins directory, type touch dash.json and add the following lines to the file and save it:

{
    "name": "DASH",
    "symbol": "DASH",
    "algorithm": "x11",
    "mposDiffMultiplier": 256
}

Now we will edit the Pool Configuration file, located in the pool_configs directory. If dash.json doesn't exits in this directory, type touch dash.json and edit (nano dash.json) with similar content:

{
    "enabled": true,
    "coin": "dash.json",

    "address": "XvjYayk3ATSm8M7MPwhACTp7BSgRcbVaHf",

    "rewardRecipients": {
        "XhpyLP8W17EQiu65xAsNh37t2RbC3YpBnu": 1.5
    },

    "paymentProcessing": {
        "enabled": false,
        "paymentInterval": 20,
        "minimumPayment": 70,
        "daemon": {
            "host": "127.0.0.1",
            "port": 9998,
            "user": "dashserver_etpnode3",
            "password": "dashserver_etpnode31234566789"
        }
    },

    "ports": {
        "3008": {
            "diff": 1
        },
        "3333": {
            "diff": 1,
            "varDiff": {
                "minDiff": 1,
                "maxDiff": 256,
                "targetTime": 15,
                "retargetTime": 90,
                "variancePercent": 30
            }
        },
        "3256": {
            "diff": 256
        }
    },

    "daemons": [
        {
            "host": "127.0.0.1",
            "port": 9998,
            "user": "dashserver_etpnode3",
            "password": "dashserver_etpnode31234566789"
        }
    ],

    "p2p": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 19333,
        "disableTransactions": true
    },

    "mposMode": {
        "enabled": true,
        "host": "127.0.0.1",
        "port": 3306,
        "user": "root",
        "password": "etptoken",
        "database": "mpos",
        "checkPassword": true,
        "autoCreateWorker": false
    }

}

To understand what each block in these file mean kindly refer to https://github.com/zone117x/node-open-mining-portal/wiki/Setting-up-NOMP-for-MPOS-usage

To run NOMP, go to the terminal and type:

cd
cd nomp
node init.js

Kindly make sure you are using the correct miner software. For instance, the CPU Mining software for Dash is https://github.com/elmad/darkcoin-cpuminer-1.3-avx-aes

Installing MPOS

PHP-MPOS is a complex set of interlinking files and programs that create a customizable and powerful website. Because of its difficulty it is not recommended for beginners to set up public pools until they have thoroughly researched how the project works and how to properly set up and secure their servers. It is recommended to read the wiki before proceeding which can be found at https://github.com/MPOS/php-mpos/wiki

Open the terminal and run the following commands to install the basic tools:

cd 
sudo apt update
sudo apt install apache2 mysql-server build-essential autoconf libtool
sudo apt install libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev

For python-stratum:

sudo apt install python-twisted python-mysqldb python-dev python-setuptools python-memcache python-simplejson python-pylibmc
sudo easy_install -U distribute

For MPOS (change values for PHP-7 accordingly. Before proceeding, have a look at https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04):

sudo apt install php libapache2-mod-php php-mcrypt php-mysql memcached #For PHP7
sudo apt install php5-memcached php5-mysqlnd php5-curl php5-json libapache2-mod-php5 #For PHP5
sudo apache2ctl -k stop; sleep 2; sudo apache2ctl -k start

Download latest version from MPOS:

# We move into the default webroot of Ubuntu
cd /var/www/html #or /var/www
sudo git clone git://github.com/MPOS/php-mpos.git MPOS
cd MPOS
sudo git checkout master

To allow our site to send messages, set up the mail server. Accept 'internet server' and keep the defaults. This will set up Postfix.

sudo apt install postfix

During server installation MySQL was installed by using the LAMP Servergroup. This also setup a password for your rootuser. Use this password now to create the database and import the structure:

# Create database
sudo mysql -p -e "create database mpos"
# Import structure
sudo mysql -p mpos < sql/000_base_structure.sql

Configuration

First, give proper permissions to our compiled templates and caching folder. This example shows the procedure in Ubuntu, other distributions may vary (apache in CentOS, httpd in others). Ensure to give the service user access that will be executing the scripts!

sudo chown -R www-data templates/compile templates/cache logs

We need to configure the project to work on our newly installed server:

cd include/config
touch global.inc.php

And the configuration file should look like this (change your passwords, _wallet addresses _accordingly). Also try to match it with global.inc.dist.php:

<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

/**
 * Do not edit this unless you have confirmed that your config has been updated!
 * Also the URL to check for the most recent upstream versions available
 *  https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-config-version
 **/
$config['version'] = '1.0.1';
$config['version_url'] = 'https://raw.githubusercontent.com/MPOS/php-mpos/master/include/version.inc.php';

/**
 * Unless you disable this, we'll do a quick check on your config first.
 *  https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-config-check
 */
$config['skip_config_tests'] = false;

/**
 * Unless you disable this, we'll do a check for a valid coin address on registration.
 *  https://github.com/MPOS/php-mpos/wiki/Config-Setup#check-for-valid-wallet-address
 */
$config['check_valid_coinaddress'] = true;

/**
 * Defines
 *  Debug setting and salts for hashing passwords
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-defines--salts
 */
$config['DEBUG'] = 0;
$config['SALT'] = 'PmdcdncjndjcnjdLEASEMAKEMESOMETHINGRANDOM';
$config['SALTY'] = 'THISSHOULDALSOcdcndncjdcnBERRAANNDDOOM';

/**
  * Coin Algorithm
  *  Algorithm used by this coin, sha256d or scrypt
  *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-algorithm
  **/
$config['algorithm'] = 'scrypt';

/**
  * Getbalance API Calls
  *  System used for getting actual Balance from Wallet
  *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#getbalance-api-calls
  **/
$config['getbalancewithunconfirmed'] = true;

/**
 * Database configuration
 *  MySQL database configuration
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-database-configuration
 **/
$config['db']['host'] = 'localhost';
$config['db']['user'] = 'root';
$config['db']['pass'] = 'etptoken';
$config['db']['port'] = 3306;
$config['db']['name'] = 'mpos';
// Disabled by default and set in bootstrap if unset, but left in here so
// people know it exists
// $config['db']['shared']['accounts'] = $config['db']['name'];
// $config['db']['shared']['workers'] = $config['db']['name'];
// $config['db']['shared']['news'] = $config['db']['name'];

/**
 * Local wallet RPC
 *  RPC configuration for your daemon/wallet
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc
 **/
$config['wallet']['type'] = 'http';
$config['wallet']['host'] = 'localhost:9998';
$config['wallet']['username'] = 'dashserver_etpnode3';
$config['wallet']['password'] = 'dashserver_etpnode31234566789';

/**
 * Swiftmailer configuration
 *  Configure your way to send mails
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-swiftmailer
 **/
$config['swiftmailer']['type'] = 'sendmail';
$config['swiftmailer']['sendmail']['path'] = '/usr/sbin/sendmail';
$config['swiftmailer']['sendmail']['options'] = '-bs';
$config['swiftmailer']['smtp']['host'] = 'smtp.gmail.com';
$config['swiftmailer']['smtp']['port'] = '465';
$config['swiftmailer']['smtp']['encryption'] = 'ssl';
$config['swiftmailer']['smtp']['username'] = '[email protected]';
$config['swiftmailer']['smtp']['password'] = 'c#0lwXo$422F';
$config['swiftmailer']['smtp']['throttle'] = 100;

/**
 * Getting Started Config
 *  Shown to users in the 'Getting Started' section
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-getting-started
 **/
$config['gettingstarted']['coinname'] = 'DASH';
$config['gettingstarted']['coinurl'] = 'http://www.dash.org';
$config['gettingstarted']['stratumurl'] = '188.166.247.123';
$config['gettingstarted']['stratumport'] = '3333';

/**
 * Ticker API
 *  Fetch exchange rates via an API
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-ticker-api
 **/
$config['price']['enabled'] = false;
$config['price']['url'] = 'https://btc-e.com';
$config['price']['target'] = '/api/2/ltc_usd/ticker';
$config['price']['currency'] = '';

/**
 * Automatic Payout Thresholds
 *  Minimum and Maximum auto payout amount
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-automatic-payout-thresholds
 **/
$config['ap_threshold']['min'] = 1;
$config['ap_threshold']['max'] = 250;

/**
 * Minimum manual Payout Threshold
 *  Minimum manual payout amount
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-manual-payout-threshold
 **/
$config['mp_threshold'] = 1;

/**
 * Donation thresholds
 *  Minimum donation amount in percent
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-donation-thresholds
 **/
$config['donate_threshold']['min'] = 1;

/**
 * Account Specific Settings
 *  Settings for each user account
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-account-specific-settings
 **/
$config['accounts']['invitations']['count'] = 5;

/**
 * Currency
 *  Shorthand name for the currency
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-currency
 */
$config['currency'] = 'DASH';

/**
 * Coin Target
 *  Target time for coins to be generated
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-coin-target
 **/
$config['cointarget'] = '150';

/**
 * Coin Diff Change
 *  Amount of blocks between difficulty changes
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-coin-diff-change
 **/
$config['coindiffchangetarget'] = 1;

/**
 * TX Fees
 *  Fees applied to transactions
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-tx-fees
 **/
$config['txfee_auto'] = 0.1;
$config['txfee_manual'] = 0.1;

/**
 * Block & Pool Bonus
 *  Bonus coins for blockfinder or a pool bonus for everyone
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-block-bonus
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-pool-bonus
 */
$config['block_bonus'] = 0;
$config['pool_bonus'] = 0;
$config['pool_bonus_type'] = 'payout';

/**
 * Payout System
 *  Payout system chosen
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-payout-system
 **/
$config['payout_system'] = 'prop';

/**
 * Sendmany Support
 *  Enable/Disable Sendmany RPC method
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-sendmany-support
 **/
$config['sendmany']['enabled'] = false;

/**
 * Transaction Limits
 *  Number of transactions per payout run
 **/
$config['payout']['txlimit_manual'] = 500;
$config['payout']['txlimit_auto'] = 500;

/**
 * Round Purging
 *  Round share purging configuration
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-round-purging
 **/
$config['purge']['sleep'] = 1;
$config['purge']['shares'] = 25000;

/**
 * Share Archiving
 *  Share archiving configuration details
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-archiving
 **/
$config['archive']['maxrounds'] = 10; 
$config['archive']['maxage'] = 60 * 24; 


/**
 * Pool Fees
 *  Fees applied to users
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-pool-fees
 */
$config['fees'] = 0;

/**
 * PPLNS
 *  Pay Per Last N Shares
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-pplns-settings
 */
$config['pplns']['shares']['default'] = 4000000;
$config['pplns']['shares']['type'] = 'blockavg';
$config['pplns']['blockavg']['blockcount'] = 10;
$config['pplns']['reverse_payout'] = true;
$config['pplns']['dynamic']['percent'] = 30;

/**
 * Difficulty
 *  Difficulty setting for stratum/pushpool
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-pool-target-difficulty
 */
$config['difficulty'] = 1;

/**
 * Block Reward
 *  Block reward configuration details
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-reward-settings
 **/
$config['reward_type'] = 'block';
$config['reward'] = 5;

/**
 * Confirmations
 *  Credit and Network confirmation settings
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-confirmations
 */
$config['confirmations'] = 120;
$config['network_confirmations'] = 120;

/**
 * PPS
 *  Pay Per Share configuration details
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-pps-settings
 **/
$config['pps']['reward']['default'] = 50;
$config['pps']['reward']['type'] = 'blockavg';
$config['pps']['blockavg']['blockcount'] = 10;

/**
 * Memcache
 *  Memcache configuration details
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-memcache
 **/
$config['memcache']['enabled'] = true;
$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;
$config['memcache']['keyprefix'] = 'mpos_';
$config['memcache']['expiration'] = 90;
$config['memcache']['splay'] = 15;
$config['memcache']['force']['contrib_shares'] = false;
$config['memcache']['sasl'] = false;
$config['memcache']['sasl']['username'] = '';
$config['memcache']['sasl']['password'] = '';

/**
 * Cookies
 *  Cookie configuration details
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-cookies
 **/
$config['cookie']['duration'] = '1440';
$config['cookie']['domain'] = '';
$config['cookie']['path'] = '/';
$config['cookie']['httponly'] = true;
$config['cookie']['secure'] = false;

/**
 * Smarty Cache
 *  Enable smarty cache and cache length
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-smarty-cache
 **/
$config['smarty']['cache'] = 0;
$config['smarty']['cache_lifetime'] = 30;

/**
 * System load
 *  Disable some calls when high system load
 *   https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-system-load
 **/
$config['system']['load']['max'] = 10.0;

Now we need to edit the file located at: /usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py

Change:

from autobahn.websocket import WebSocketServerProtocol, WebSocketServerFactory

To:

from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory

If this file doesn't exist, we may need to download and install additional packages for stratum-mining:

cd
git clone https://github.com/Tydus/litecoin_scrypt.git
git clone https://github.com/ahmedbodi/stratum-mining.git
git clone https://github.com/ahmedbodi/stratum.git

cd stratum-mining
git submodule init
git submodule update

cd externals/litecoin_scrypt
sudo python setup.py install

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

# If there is an error while running the last command "sudo python setup.py install", 
# comment these two lines and try installing again:
# #from distribute_setup import use_setuptools
# #use_setuptools()

Miscellaneous details:

rpcuser=dashserver_etpnode3

rpcpassword= dashserver_etpnode31234566789

personal account=XhpyLP8W17EQiu65xAsNh37t2RbC3YpBnu

wallet account= XvjYayk3ATSm8M7MPwhACTp7BSgRcbVaHf

address = 188.166.247.123

dashd command = dashd -daemon

wallet command = dash-cli getaccountaddress ""

To run the miner:

nohup ./minerd -a X11 --url=stratum+tcp://188.166.247.123:3333 -u etptoken.worker1 -p 1 -t 4 > minerlog 2>&1 &

To run NOMP:

nohup node init.js > log 2>&1 &

If MPOS front-end does not show up on your web address, you need to edit the ApacheServer configuration file. Read this for reference: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04

results matching ""

    No results matching ""