363 lines
12 KiB
PHP
363 lines
12 KiB
PHP
<?php
|
|
// Make sure we are called from index.php
|
|
if (!defined('SECURITY')) die('Hacking attempt');
|
|
|
|
// Our include directory for additional features
|
|
define('INCLUDE_DIR', BASEPATH . 'include');
|
|
|
|
// Our class directory
|
|
define('CLASS_DIR', INCLUDE_DIR . '/classes');
|
|
|
|
// Our pages directory which takes care of
|
|
define('PAGES_DIR', INCLUDE_DIR . '/pages');
|
|
|
|
// Set debugging level for our debug class
|
|
define('DEBUG', 0);
|
|
|
|
// SALT used to hash passwords
|
|
define('SALT', 'PLEASEMAKEMESOMETHINGRANDOM');
|
|
|
|
/**
|
|
* Database configuration
|
|
*
|
|
* A MySQL database backend is required for mmcfe-ng.
|
|
* Also ensure the database structure is imported!
|
|
* The SQL file should be included in this project under the `sql` directory
|
|
*
|
|
* Default:
|
|
* host = 'localhost'
|
|
* port = 3306
|
|
* user = 'someuser'
|
|
* pass = 'somepass'
|
|
* name = 'mmcfe_ng'
|
|
**/
|
|
$config['db']['host'] = 'localhost';
|
|
$config['db']['user'] = 'someuser';
|
|
$config['db']['pass'] = 'somepass';
|
|
$config['db']['port'] = 3306;
|
|
$config['db']['name'] = 'mmcfe_ng';
|
|
|
|
/**
|
|
* Local wallet RPC configuration
|
|
*
|
|
* mmcfe-ng uses the RPC backend to fetch transactions, blocks
|
|
* and various other things. They need to match your coind RPC
|
|
* configuration.
|
|
*
|
|
* Default:
|
|
* type = 'http'
|
|
* host = 'localhost:19334'
|
|
* username = 'testnet'
|
|
* password = 'testnet'
|
|
**/
|
|
$config['wallet']['type'] = 'http';
|
|
$config['wallet']['host'] = 'localhost:19334';
|
|
$config['wallet']['username'] = 'testnet';
|
|
$config['wallet']['password'] = 'testnet';
|
|
|
|
/**
|
|
* API configuration to fetch prices for set currency
|
|
*
|
|
* Explanation:
|
|
* mmcfe-ng will try to fetch the current exchange rates
|
|
* from this API URL/target. Currently btc-e and coinchoose
|
|
* are supported in mmcfe-ng. If you want to remove the trade
|
|
* header just set currency to an empty string.
|
|
*
|
|
* Default (btc-e.com):
|
|
* url = `https://btc-e.com`
|
|
* target = `/api/2/ltc_usd/ticker`
|
|
* currency = `USD`
|
|
*
|
|
* Optional (coinchoose.com):
|
|
* url = `http://www.coinchoose.com`
|
|
* target = `/api.php`
|
|
* currency = `BTC`
|
|
**/
|
|
$config['price']['url'] = 'https://btc-e.com';
|
|
$config['price']['target'] = '/api/2/ltc_usd/ticker';
|
|
$config['price']['currency'] = 'USD';
|
|
|
|
|
|
/**
|
|
* Automatic payout thresholds
|
|
*
|
|
* These values define the min and max settings
|
|
* that can be entered by a user.
|
|
* Defaults:
|
|
* `min` = `1`
|
|
* `max` = `250`
|
|
**/
|
|
$config['ap_threshold']['min'] = 1;
|
|
$config['ap_threshold']['max'] = 250;
|
|
|
|
|
|
/**
|
|
* Website specific configuration settings
|
|
*
|
|
* Explanation:
|
|
* title : Website title used in master template
|
|
* name : The pool name, displayed in the header and mails
|
|
* slogan : A special slogan, also displayed in the header below name
|
|
* email : `From` addresses used in notifications
|
|
* theme : Theme used for desktop browsers
|
|
* mobile : Enable/Disable mobile theme support
|
|
* mobile_theme : Theme used for mobile browsers
|
|
*
|
|
* Defaults:
|
|
* title = `The Pool - Mining Evolved`
|
|
* name = `The Pool`
|
|
* slogan = `Resistance is futile`
|
|
* email = `test@example.com`
|
|
* theme = `mmcFE`
|
|
* mobile = true
|
|
* mobile_theme = `mobile`
|
|
**/
|
|
$config['website']['title'] = 'The Pool - Mining Evolved';
|
|
$config['website']['name'] = 'The Pool';
|
|
$config['website']['slogan'] = 'Resistance is futile';
|
|
$config['website']['email'] = 'test@example.com';
|
|
$config['website']['theme'] = 'mmcFE';
|
|
$config['website']['mobile'] = true;
|
|
$config['website']['mobile_theme'] = 'mobile';
|
|
|
|
/**
|
|
* Some basic access restrictions on some pages
|
|
*
|
|
* Explanation:
|
|
* Some pools would like to run a few pages for public access instead
|
|
* of enforcing a login. You can change visibility of some pages here.
|
|
*
|
|
* Options:
|
|
* 'public' : Allow guest access and authenticated user to view page
|
|
* 'private' : Only allow logged in users access to view page
|
|
*
|
|
* Defaults:
|
|
* 'private' for every page
|
|
**/
|
|
$config['website']['acl']['statistics']['pool'] = 'private';
|
|
$config['website']['acl']['statistics']['blocks'] = 'private';
|
|
|
|
/**
|
|
* Re-Captcha settings
|
|
* Please read http://www.google.com/recaptcha for details
|
|
**/
|
|
$config['recaptcha']['enabled'] = false;
|
|
$config['recaptcha']['public_key'] = 'YOUR_PUBLIC_RECAPTCHA_KEY';
|
|
$config['recaptcha']['private_key'] = 'YOUR_PRIVATE_RECAPTCHA_KEY';
|
|
|
|
// Currency system used in this pool, default: `LTC`
|
|
$config['currency'] = 'LTC';
|
|
|
|
/**
|
|
* Default transaction fee to apply to user transactions
|
|
*
|
|
* Explanation
|
|
* The coin daemon applies transcation fees to young coins.
|
|
* Since we are unable to find out what the exact fee was we set
|
|
* a default value here which is applied to both manual and auto payouts.
|
|
* If this is not set, no fee is applied in the transactions history but
|
|
* the user might still see them when the coins arrive.
|
|
*
|
|
* Default:
|
|
* txfee = 0.1
|
|
**/
|
|
$config['txfee'] = 0.1;
|
|
|
|
// Payout a block bonus to block finders, default: 0 (disabled)
|
|
// This bonus is paid by the pool operator, it is not deducted from the block payout!
|
|
$config['block_bonus'] = 0;
|
|
|
|
|
|
/**
|
|
* Payout sytem in use
|
|
*
|
|
* This will modify some templates and activate the
|
|
* appropriate crons. Only ONE payout system at a time
|
|
* is supported!
|
|
*
|
|
* Available options:
|
|
* prop: Proportional payout system
|
|
* pps : Pay Per Share payout system
|
|
* pplns : Pay Per Last N Shares payout system
|
|
*
|
|
* Default:
|
|
* prop
|
|
**/
|
|
$config['payout_system'] = 'prop';
|
|
|
|
/**
|
|
* Archiving configuration for debugging
|
|
*
|
|
* Explanation:
|
|
* By default, we don't need to archive for a long time. PPLNS and Hashrate
|
|
* calculations rely on this archive, but all shares past a certain point can
|
|
* safely be deleted.
|
|
*
|
|
* To ensure we have enough shares on stack for PPLNS, this
|
|
* is set to the past 10 rounds. Even with lucky ones in between those should
|
|
* fit the PPLNS target. On top of that, even if we have more than 10 rounds,
|
|
* we still keep the last maxage shares to ensure we can calculate hashrates.
|
|
* Both conditions need to be met in order for shares to be purged from archive.
|
|
*
|
|
* Proportional mode will only keep the past 24 hours. These are required for
|
|
* hashrate calculations to work past a round, hence 24 hours was selected as
|
|
* the default. You may want to increase the time for debugging, then add any
|
|
* integer reflecting minutes of shares to keep.
|
|
*
|
|
* Availabe Options:
|
|
* maxrounds : PPLNS, keep shares for maxrounds
|
|
* maxage : PROP and PPLNS, delete shares older than maxage minutes
|
|
*
|
|
* Default:
|
|
* maxrounds = 10
|
|
* maxage = 60 * 24 (24h)
|
|
**/
|
|
$config['archive']['maxrounds'] = 10;
|
|
$config['archive']['maxage'] = 60 * 24;
|
|
|
|
// URL prefix for block searches, used for block links, default: `http://explorer.litecoin.net/search?q=`
|
|
// If empty, the block link to the block information page will be removed
|
|
$config['blockexplorer'] = 'http://explorer.litecoin.net/search?q=';
|
|
|
|
// Link to blockchain information, used for difficulty link, default: `http://allchains.info`
|
|
// If empty, the difficulty link to the chain information will be removed
|
|
$config['chaininfo'] = 'http://allchains.info';
|
|
|
|
// Pool fees applied to users in percent, default: 0 (disabled)
|
|
$config['fees'] = 0;
|
|
|
|
/**
|
|
* PPLNS requires some settings to run properly. First we need to define
|
|
* a default shares count that is applied if we don't have a proper type set.
|
|
* Different dynamic types can be applied, or you can run a fixed scheme.
|
|
*
|
|
* Explanation
|
|
*
|
|
* PPLNS can run on two different payouts: fixed and blockavg. Each one
|
|
* defines a different PPLNS target.
|
|
*
|
|
* Fixed means we will be looking at the shares setup in the default
|
|
* setting. There is no automatic adjustments to the PPLNS target,
|
|
* all users will be paid out proportionally to that target.
|
|
*
|
|
* Blockavg will look at the last blockcount blocks shares and take
|
|
* the average as the PPLNS target. This will be automatically adjusted
|
|
* when difficulty changes and more blocks are available. This keeps the
|
|
* target dynamic but still traceable.
|
|
*
|
|
* default : Default target shares for PPLNS
|
|
* type : Payout type used in PPLNS
|
|
* blockcount : Amount of blocks to check for avg shares
|
|
*
|
|
* Available Options:
|
|
* default : amount of shares, integeger
|
|
* type : blockavg or fixed
|
|
* blockcount : amount of blocks, any integer
|
|
*
|
|
* Defaults:
|
|
* default = 4000000
|
|
* type = `blockavg`
|
|
* blockcount = 10
|
|
**/
|
|
$config['pplns']['shares']['default'] = 4000000;
|
|
$config['pplns']['shares']['type'] = 'blockavg';
|
|
$config['pplns']['blockavg']['blockcount'] = 10;
|
|
|
|
// Pool target difficulty as set in pushpoold configuration file
|
|
// Please also read this for stratum: https://github.com/TheSerapher/php-mmcfe-ng/wiki/FAQ
|
|
$config['difficulty'] = 20;
|
|
|
|
|
|
/**
|
|
* This defines how rewards are paid to users.
|
|
*
|
|
* Explanation:
|
|
*
|
|
* Proportional + PPLNS Payout System
|
|
* When running a pool on fixed mode, each block will be paid
|
|
* out as defined in `reward`. If you wish to pass transaction
|
|
* fees inside discovered blocks on to user, set this to `block`.
|
|
* This is really helpful for altcoins with dynamic block values!
|
|
*
|
|
* PPS Payout System
|
|
* If set to `fixed`, all PPS values are based on the `reward` setting.
|
|
* If you set it to `block` you will calculate the current round based
|
|
* on the previous block value. The idea is to pass the block of the
|
|
* last round on to the users. If no previous block is found, PPS value
|
|
* will fall back to the fixed value set in `reward`. Ensure you don't
|
|
* overpay users in the first round!
|
|
*
|
|
* Available options:
|
|
* reward_type:
|
|
* fixed : Fixed value according to `reward` setting
|
|
* block : Dynamic value based on block amount
|
|
* reward:
|
|
* float value : Any value of your choice but should reflect base block values
|
|
*
|
|
* Default:
|
|
* reward_type = `fixed`
|
|
* reward = 50
|
|
*
|
|
**/
|
|
$config['reward_type'] = 'fixed';
|
|
$config['reward'] = 50;
|
|
|
|
// Confirmations per block required to credit transactions, default: 120
|
|
$config['confirmations'] = 120;
|
|
|
|
|
|
/**
|
|
* Memcache configuration
|
|
*
|
|
* Even though you can disable the memcache for debugging purposes, the memcache
|
|
* library is still required for mmcfe-ng to work. You should not disable this in
|
|
* a live environment since a lot of data is cached for the website to increase load
|
|
* times!
|
|
*
|
|
* Explanations
|
|
* enabled : Disable (false) memcache for debugging or enable (true) it
|
|
* host : Host IP or hostname
|
|
* port : memcache port
|
|
* keyprefix : Must be changed for multiple mmcfe-ng instances on one host
|
|
* expiration : Default expiration time in seconds of all cached keys.
|
|
* Increase if caches expire too fast.
|
|
* splay : Default randomizer for expiration times.
|
|
* This will spread expired keys across `splay` seconds.
|
|
*
|
|
* Default:
|
|
* enabled = `true`
|
|
* host = `localhost`
|
|
* port = 11211
|
|
* keyprefix = `mmcfe_ng_`
|
|
* expiration = 90
|
|
* splay = 15
|
|
**/
|
|
$config['memcache']['enabled'] = true;
|
|
$config['memcache']['host'] = 'localhost';
|
|
$config['memcache']['port'] = 11211;
|
|
$config['memcache']['keyprefix'] = 'mmcfe_ng_';
|
|
$config['memcache']['expiration'] = 90;
|
|
$config['memcache']['splay'] = 15;
|
|
|
|
|
|
/**
|
|
* Cookie configiration
|
|
*
|
|
* For multiple installations of this cookie change the cookie name
|
|
*
|
|
* Default:
|
|
* path = '/'
|
|
* name = 'POOLERCOOKIE'
|
|
* domain = ''
|
|
**/
|
|
$config['cookie']['path'] = '/';
|
|
$config['cookie']['name'] = 'POOLERCOOKIE';
|
|
$config['cookie']['domain'] = '';
|
|
|
|
// Disable or enable smarty cache
|
|
// This is usually not required, default: 0
|
|
$config['cache'] = 0;
|
|
|
|
?>
|