Upgrading from versions older than May 30, 2018 (commits older than f4974d8fa7ef9ee9b200079f7adfa00c9388ac80) - XDagger/openxdagpool GitHub Wiki
OpenXDAGPool changes:
.env.example
file changed. Inspect the changes and update your.env
file appropriately.- newest version of OpenXDAGPool-scripts repository is now required. This repository contains php core that OpenXDAGPool contacts to import all the information it needs from the pool daemon.
- payouts and found blocks core was rewritten from scratch. Log file parsing now no longer takes place. All payouts and found blocks are imported every 5 minutes. All payouts and found blocks are based only on the pool wallet. This means that when you deploy OpenXDAGPool later while your pool was already running, it automatically and always imports found blocks and payouts for full pool history (based on your pool wallet). See the openxdagpool-scripts repository for details. See the
engine/config.php.EXAMPLE
file for details. - payouts and found blocks should now always match precise network state, even if your pool was desynced for any periods of time.
- found blocks will now list real main block time. Payouts will list real transaction time.
- pool's fee is now calculated directly from found blocks. This means when you change your fees, blocks import will still show correct fee for each imported block.
- pool's settings are no longer entered in administration interface, but are read each minute directly from your pool daemon.
- payouts and found blocks data will be TRUNCATED once you run
php artisan migrate
. Back up your database! New payouts and found blocks history will then be periodically loaded (2000 found blocks per run) - a JSON with pool diagnostic information is now available at
/status
URL, and also a human readable text file at/status/human-readable
. These files update every minute. - other miner hashrate estimation algorithms than
averaging1
were removed and are no longer configurable in the.env
file
OpenXDAGPool-scripts changes:
- a brand new PHP engine to manage daemon data. Log file parsing no longer takes place, and log files are no longer necessary for OpenXDAGPool.
- new log managing script (periodically archives and gzips logs larger than 100MB)
- new template and helper scripts
Update procedure:
- run everything as user pool or other user applicable to your setup, never as root!
- this update guide expects you have everything installed stock (according to the readme). If not, substitute your own values / commands.
crontab -e
and replace each occurence ofscripts
withscripts2
cd; mv scripts scripts2
, this will allow your pool to import data the "old way" while you update your scripts.git clone https://github.com/XDagger/openxdagpool-scripts.git scripts
cd scripts/engine; cp config.php.EXAMPLE config.php
- edit
config.php
, read the file and set appropriate values. Create a new MySQL database for openxdagpool-scripts according to comments inconfig.php
file. - run
php core.php livedata
. A JSON should be printed, verifying communication with daemon works. - run
php core.php blocks gather
. This may take a long time. Wait for the command to finish. - run
php core.php blocks summary
. You should see a JSON like this:
{
"not_fully_inspected": 784797,
"to_be_exported": 0,
"to_be_exported_invalidated": 0,
"valid": 0,
"invalid": 0,
"total": 784797
}
crontab -e
and ADD just this cron schedule:
* * * * * /usr/bin/php /home/pool/scripts/engine/core.php blocks gather >> /dev/null 2>&1
* * * * * /usr/bin/php /home/pool/scripts/engine/core.php blocks inspect >> /dev/null 2>&1
0 0 * * * /usr/bin/php /home/pool/scripts/engine/core.php blocks gatherAll >> /dev/null 2>&1
0 0 * * * /usr/bin/php /home/pool/scripts/engine/core.php blocks inspectAll >> /dev/null 2>&1
- periodically run
php core.php blocks summary
. When thevalid
andto_be_exported
counters are very close to each other or equal, the new scripts are ready. crontab -e
and delete all old scripts that havescripts2
in the path. Add rest of new scripts:
40 */3 * * * /bin/bash /home/pool/scripts/xdag_update_whitelist.sh
50 */3 * * * /bin/bash /home/pool/scripts/xdag_archive_logs.sh
50 2 * * * /bin/bash /home/pool/scripts/xdag_delete_tmp_files.sh
- copy scripts from
shell_templates
toxdag1
andxdag2
. MODIFY the files to suit your setup, mainlyxdag_run.sh
! - comment out OpenXDAGPool cron schedule (
crontab -e
) - wait for OpenXDAGPool cron to complete. Issue
ps aux | grep php
periodically and check if no PHP process is left running in the OpenXDAGPool directory. Cron may take some time to finish. - go to
scripts
directory again and copy thewww-scripts/core_call.php
to/var/www/pool
, delete oldbalances.php
file there. Inspect the file and set appropriate paths if your setup differs. - remove all old text files from the
/var/www/pool
directory. - go to OpenXDAGPool directory.
- git pull the OpenXDAGPool installation. This will cause website downtime. Disable nginx for the time being or set a different welcome page if necessary before pulling the git repo.
- make sure your
.env
file is up to date by inspecting changes made to the.env.example
file. Mailny the "DOWNLOAD_X" and "X" variables were removed, together with HASHRATE_ALGORITHM, and new variables were added,DISABLE_BLOCKS_IMPORT
andOPENXDAGPOOL_SCRIPTS_URL
. Do not expose the script URL endpoint to the internet! It should be available only locally. Read the.env
file comments for details. rm storage/miners.txt storage/stats.txt storage/state.txt storage/blocks.txt storage/payouts.txt; rm -fr storage/pooldata
- remove old unnecessary text files- run
php artisan migrate
. Back up your database first! Your payouts and found blocks information will be deleted. This may take a long time depending on how large your payouts and found blocks tables are. Don't interrupt the script! - run
php artisan data:live; php artisan data:fast
. Make sure the commands completed successfully. - run
npm install
and thennpm run production
- enable OpenXDAGPool cron schedule again. The pool will automatically start importing payouts and found blocks history for your pool.
- enable nginx or the website again for your visitors.
- remove the old
scripts2
folder - it is normal to see "?" instead of pool stats for first 5 minutes after the new installation cron is enabled.
Notes:
- when you pay out your pool wallet, those payouts are detected and ignored (not imported). Never pay out your pool wallet when you have only ONE found block with leftover pool fee. Such payouts are indistinguishable from normal miner payouts, and will cause affected block to be listed with 0% pool fee. Pool's fee is now calculated directly from imported block, and this calculation doesn't work in mentioned scenario. If you only pay out your pool wallet when there is more than one block with leftover balance, such payouts will be detected, and pool's fee will be properly calculated for given blocks. Alternatively you may pay out your only found block's leftover pool fee more than a week after the block was first inspected, as blocks older than 5 days are never re-inspected, to conserve resources.