You are on page 1of 10

3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

HOME (HTTPS://EXPLOSIVE.CLOUD/)
/ UNCATEGORIZED (HTTPS://EXPLOSIVE.CLOUD/CATEGORY/UNCATEGORIZED/)
/ CREATE A PHP-MPOS DOCKER CONTAINER (PART 2) (HTTPS://EXPLOSIVE.CLOUD/?P=85)

CREATE A PHP-MPOS DOCKER


CONTAINER (PART 2)
PUBLISHED ON 21 MARCH 2024 (HTTPS://EXPLOSIVE.CLOUD/?P=85)

BY TYLER JURGENS (HTTPS://EXPLOSIVE.CLOUD/AUTHOR/TJURGENS/)

This entry is part 8 of 0 in the series How to start a Verium mining


Search … SEARC
pool (https://explosive.cloud/series/how-to-start-a-verium-mining-
pool/)

How to start a Verium mining pool


(https://explosive.cloud/series/how-to-start-a-verium-mining-
pool/)

In Part 1 (https://explosive.cloud/create-a-php-mpos-docker-
(https://vexpert.vmware.com/direc
container-part-1/) of this series, we examine how to create the
php-mpos Docker container itself. That only gets you started,
we still need to configure this software to make it work for us.

Luckily, there is only one config file to get this all working. That
config file will be located here:
(https://community.veeam.com/p/v
/var/www/MPOS/include/config/global.inc.php

 As another stroke of luck, you can simply grab the example


(https://explosive.cloud)
config, edit it and name it appropriately for your pool to
function. We will do this step in our Docker host, since we are
 going to want to mount it to our Docker container (as you saw

 previously in the docker-compose.yml).


(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 1/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

Download the global.inc.dist.php file


template
To start off, we’re going to download the global.inc.dist.php
file and save it as
/data/mpos/include/config/global.inc.php . To do so,
we’re going to wget the file from mderasse’s php-mpos
repository. I suggest doing so from your user’s home directory
(https://tanzu.vmware.com/vangua
and copying it over to the data directory once complete.

(https://tanzu.vmware.com/vangua

wget https://github.com/mderasse/php-mpo RECENT POSTS


s/blob/master/include/config/global.inc.
dist.php global.inc.php (https://tanzu.vmware.com/vangua
(https://tanzu.vmware.com/vangua

(https://tanzu.vmware.com/vangua
If you watched closely above, we wget the template config
and save it immediately as the proper config name, because Tuning Minio – Ethernet
we’re just smart like that. Settings
(https://explosive.cloud/set-
Now we can start editing. minio-rx-and-tx-buffers/)

VMware Cloud Director – VAMI


vi global.inc.php
Backup Failure
(https://explosive.cloud/vmware-
cloud-director-vami-backup/)
The first few lines are going to remain unchanged. Our first
changes will be to the salt/salty hashing passwords.
NSX – Node with the same IP
already exists
(https://explosive.cloud/nsx-
$config['DEBUG'] = 0;
same-ip-already-exists/)
$config['SALT'] = 'PLEASEMAKEMESOMETHING
RANDOM';
$config['SALTY'] = 'THISSHOULDALSOBERRAA Minio and Veeam – Cleaning
NNDDOOM'; up Expired DeleteMarkers
 (https://explosive.cloud/minio-
(https://explosive.cloud) and-veeam-cleaning-up-
As stated, make them random and long. Use some password expired-delete-markers/)

generator with 64 characters or more.

(mailto:someone@example.com)
For the Coin Algorithm, we will want to set this to scriptn .
https://explosive.cloud/?p=85&preview=true 2/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

Configuring VMware NSX Backups


$config['algorithm'] = 'scryptn';
Using SSH Keys
(https://explosive.cloud/configuring
vmware-nsx-backups-using-ssh-
The database config is also important. Here is where we set
keys/)
php-mpos to use the database instance that we created way
back when we first set up a MySQL Docker Container
(https://explosive.cloud/create-a-mysql-instance/).
RECENT COMMENTS

Tyler Jurgens
$config['db']['host'] = 'db';
(https://explosive.cloud) on
$config['db']['user'] = 'pooluser';
NSX – Node with the same IP
$config['db']['pass'] = 'my.super.top.se
already exists
cret.password';
(https://explosive.cloud/nsx-
$config['db']['port'] = 3306;
same-ip-already-
$config['db']['name'] = 'mpos';
exists/#comment-4064)

For the local wallet RPC, we will want to point this to our first Fernando on NSX – Node with
Verium wallet Docker container the same IP already exists

(https://explosive.cloud/create-a-verium-wallet-image/). (https://explosive.cloud/nsx-
same-ip-already-
exists/#comment-4050)
$config['wallet']['type'] = 'http';
$config['wallet']['host'] = 'verium1:339
87';
ARCHIVES
$config['wallet']['username'] = 'mywalle
trpcuser';
February 2024
$config['wallet']['password'] = 'some!lo
(https://explosive.cloud/2024/02/)
ng!random.string';

January 2024
(https://explosive.cloud/2024/01/)
For Swiftmailer, we will configure this to point to our Postfix
Docker Container. Running a seperate Docker instance for
Postfix is not necessary, but it is definitely very handy. I do this September 2023
 (https://explosive.cloud/2023/09/)
so I can relay my email through a third party relay, and filter
(https://explosive.cloud)
out some email I really don’t want to be sending out (to keep
 within the free tier of the mail relay service). This way you also August 2023
avoid running into any SPAM email blacklists. (https://explosive.cloud/2023/08/)

(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 3/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

June 2023
$config['swiftmailer']['type'] = 'smtp';
(https://explosive.cloud/2023/06/)
$config['swiftmailer']['sendmail']['pat
h'] = '/usr/sbin/sendmail';
$config['swiftmailer']['sendmail']['opti May 2023
ons'] = '-bs'; (https://explosive.cloud/2023/05/)

$config['swiftmailer']['smtp']['host'] =
'postfix'; October 2020
$config['swiftmailer']['smtp']['port'] = (https://explosive.cloud/2020/10/)
'25';
$config['swiftmailer']['smtp']['encrypti
on'] = ''; CATEGORIES
$config['swiftmailer']['smtp']['usernam
e'] = ''; Backup & Disaster Recovery
$config['swiftmailer']['smtp']['passwor (https://explosive.cloud/category/b
d'] = ''; disaster-recovery/)
$config['swiftmailer']['smtp']['throttl
e'] = 100;
DevOps
(https://explosive.cloud/category/d

The Getting Started Config will need to be adjusted for your


Minio
pool specifically, as these values will be pulled into the page
(https://explosive.cloud/category/m
that gets displayed to your users.

NSX
$config['gettingstarted']['coinname'] = (https://explosive.cloud/category/n
'Verium';
$config['gettingstarted']['coinurl'] =
Veeam
'https://portal.vericoin.info/verium/';
(https://explosive.cloud/category/v
$config['gettingstarted']['stratumurl']
= 'vrm.mypool.com';
VMware
$config['gettingstarted']['stratumport']
(https://explosive.cloud/category/v
= '3333';

VMware Cloud Director


 (https://explosive.cloud/category/v
The ticker API is pretty broken if you decide to use the default
(https://explosive.cloud)
php-mpos repository. Luckily on mine and mderasse’s cloud-director/)
 repository, its been fixed to work with Verium.
Web

(mailto:someone@example.com) (https://explosive.cloud/category/w

https://explosive.cloud/?p=85&preview=true 4/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

$config['price']['enabled'] = true;
$config['price']['url'] = 'https://api.c TAGS
oingecko.com';
$config['price']['target'] = '/api/v3/si Caddy Docker

mple/price?ids=veriumreserve&vs_currenci
es=usd'; Docker Compose
$config['price']['currency'] = 'USD';

Grafana Influxdb

The auto payment threshold is entirely up to you. I like keeping


Minio Nsx
it relatively low at 20, because the last thing you want is for
your pool to be accumulating VRM from miners.
Telegraf Veeam

$config['ap_threshold']['min'] = 1;
VMware
$config['ap_threshold']['max'] = 20;

VMware Cloud Director

Manual payment I set even lower, mostly to keep fees down.

$config['mp_threshold'] = 5;

The next few settings I skip over, but we will want to make
sure we setup the Currency properly.

$config['currency'] = 'VRM';

The coin target we set to 250, because… (I forget).


$config['cointarget'] = '250';
(https://explosive.cloud)


(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 5/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

Coin fees are not as clear cut as you may think. We want to
make sure the pool isn’t taking money out of its own wallet to
pay for miners to transfer funds, but we also don’t want to
charge more than just the coin fee. Mderasse setup a dynamic
fee method to charge only what is being used, so that’s what
we’ll enable.

$config['txfee_auto'] = 0.003;
$config['txfee_manual'] = 0.006;

$config['txfee_auto_dynamic']['enabled']
= true;
$config['txfee_auto_dynamic']['coefficie
nt'] = 0.000208623;

$config['txfee_manual_dynamic']['enable
d'] = true;
$config['txfee_manual_dynamic']['coeffic
ient'] = 0.000208623;

For the block and pool bonus – be careful here. You can easily
set a pool bonus that pays out more than you accumulate with
fees. Hence, I keep the pool bonus at 0 and the block bonus
low. You can set both to 0 if you want to provide no reward for
mining on your pool. These rewards come out of your ‘liquid
assets’, which is to say, VRM not currently stashed away for
miners.

$config['block_bonus'] = 0.001;
$config['pool_bonus'] = 0;
$config['pool_bonus_type'] = 'payout';


(https://explosive.cloud)
The payout system we will set to pplns.


(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 6/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

$config['payout_system'] = 'pplns';

The next few configs are left unchanged again. Note: Do not
enable sendmany. I fixed the code in my repo, but I am fairly
certain the dynamic fees implemented by mderasse will not
work with sendmany.

For pool fees, we are going to set this to 1%. You can set it
however you like but remember, it costs you money to run this
pool. 1% of VRM at current prices will not cover your costs.

$config['fees'] = 1;

The block reward we set to 0.8, as that’s roughly how much is


generated per block.

$config['reward_type'] = 'block';
$config['reward'] = 0.8;

As Verium has 100 blocks for the confirmations, we can set


that accordingly in our config.

$config['confirmations'] = 100;
$config['network_confirmations'] = 100;

We can skip setting the pps values, since we use pplns


payouts.

(https://explosive.cloud)
For Memcached settings, we will want to point our php-mpos
 to our Memcached Docker Container
(https://explosive.cloud/create-a-redis-and-memcache-

docker-container/).
(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 7/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

$config['memcache']['enabled'] = true;
$config['memcache']['host'] = 'memcach
e';
$config['memcache']['port'] = 11211;
$config['memcache']['keyprefix'] = 'mpos
_';
$config['memcache']['expiration'] = 90;
$config['memcache']['splay'] = 15;
$config['memcache']['force']['contrib_sh
ares'] = false;
$config['memcache']['sasl'] = false;
$config['memcache']['sasl']['username']
= '';
$config['memcache']['sasl']['password']
= '';

The rest of the settings can be left to their defaults.

Copy the config to its appropriate


location
Last step in setting up php-mpos to run with our docker-
compose.yml settings is to ensure the global.inc.php file is
copied to the correct location to be mounted to our Docker
Container.

sudo cp global.inc.php /data/mpos/includ


e/config/

Recap
 Now that we have gone through and set up our php-mpos
(https://explosive.cloud)
Docker container in Part 1 (https://explosive.cloud/create-a-
php-mpos-docker-container-part-1/), and worked through the

config file, we can now start up our Docker Compose instance.
 I will continue with additional articles on how to backup the
(mailto:someone@example.com)
MySQL database, setup LetsEncrypt certificates, and setup a

https://explosive.cloud/?p=85&preview=true 8/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

Postfix Docker Container. As mentioned, if you run into


problems with this setup as documented in this series so far,
it will likely be with LetsEncrypt. So you have a choice now,
either wait for my next article, figure it out yourself, or remove
SSL from your site.

(/#facebook) (/#twitter) (/#reddit)


(/#email) (/#wechat) (/#linkedin)

(https://www.addtoany.com/share#url=https%3A%2F%2Fexplosive.cloud%2F%3Fp%3D85&title
mpos%20Docker%20Container%20(Part%202))

 UNCATEGORIZED
(HTTPS://EXPLOSIVE.CLOUD/CATEGORY/UNCATEGORIZED/)
E D I T ( H T T P S : // E X P L O S I V E . C L O U D / W P -
A D M I N / P O S T. P H P ? P O S T = 8 5 & A C T I O N = E D I T )

LEAVE A REPLY
Logged in as Tyler Jurgens. Edit your profile (https://explosive.cloud/wp-admin/profile.php). Log out?
(https://explosive.cloud/wp-login.php?
action=logout&redirect_to=https%3A%2F%2Fexplosive.cloud%2F%3Fp%3D85&_wpnonce=541394605b
Required fields are marked *

Comment *

POST COMMENT

(https://explosive.cloud)
This site uses Akismet to reduce spam. Learn how your
 comment data is processed (https://akismet.com/privacy/).


(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 9/10
3/21/24, 8:08 AM Create a php-mpos Docker Container (Part 2) - Explosive Cloud

COPYRIGHT © ALL RIGHTS RESERVED. THEME: MINIMAL GRID


(HTTPS://WWW.THEMEMATTIC.COM/THEME/MINIMAL-GRID/) BY THEMEMATTIC
(HTTPS://THEMEMATTIC.COM/)


(https://explosive.cloud)


(mailto:someone@example.com)
https://explosive.cloud/?p=85&preview=true 10/10

You might also like