diff --git a/CHANGELOG.md b/CHANGELOG.md index 497fbbcb..76736ef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.5.1] - 2021-07-? +## [0.5.1] - 2021-07-22 - Wizard on Workers page to create a Docker run/compose based on your settings. [Issue #97](https://github.com/guydavis/machinaris/issues/97) - Update to patch release of Chia 1.2.2, including a fix for harvester cache updates. See their [changelog for details](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.2.2). +- Latest Madmax plotter with support for n_buckets3 and n_rmulti2 settings in Plotman. ## [0.5.0] - 2021-07-09 diff --git a/api/commands/chiadog_cli.py b/api/commands/chiadog_cli.py index 02fe895c..0f701419 100644 --- a/api/commands/chiadog_cli.py +++ b/api/commands/chiadog_cli.py @@ -67,6 +67,9 @@ def start_chiadog(): for blockchain in blockchains: try: workdir = "/{0}dog".format(blockchain) + offset_file = "{0}/debug.log.offset".format(workdir) + if os.path.exists(offset_file): + os.remove(offset_file) configfile = "/root/.chia/{0}dog/config.yaml".format(blockchain) logfile = "/root/.chia/{0}dog/logs/{0}dog.log".format(blockchain) proc = Popen("nohup /{0}-blockchain/venv/bin/python3 -u main.py --config {1} >> {2} 2>&1 &".format(blockchain, configfile, logfile), \ diff --git a/config/plotman.sample.yaml b/config/plotman.sample.yaml index 8d34700b..adc98c3d 100644 --- a/config/plotman.sample.yaml +++ b/config/plotman.sample.yaml @@ -92,26 +92,28 @@ scheduling: # Configure the plotter. See: https://github.com/guydavis/machinaris/wiki/Plotman#plotting plotting: - # Your farmer public key is always required for plotting - # farmer_pk: YOUR_FARMER_PUBLIC_KEY (always required) - # Your pool public key is only required for solo plotting, else comment it out! - #pool_pk: YOUR_POOL_PUBLIC_KEY (comment this out if portable pool plotting) - # Your pool contract address is only required for portable pool plotting, else comment it out! - #pool_contract_address: YOUR_POOL_CONTRACT_ADDRESS (comment this out if solo plotting) + # See Keys page, for 'Farmer public key' value + farmer_pk: REPLACE_WITH_THE_REAL_VALUE + # ONLY FOR OLD SOLO PLOTS, COMMENT OUT IF PORTABLE PLOTTING!!! + pool_pk: REPLACE_WITH_THE_REAL_VALUE + # See 'Settings | Pools' page, for 'P2 singleton address' value, UNCOMMENT IF PORTABLE PLOTTING!!! + #pool_contract_address: REPLACE_WITH_THE_REAL_VALUE # If you enable 'chia', plot in *parallel* with higher tmpdir_max_jobs and global_max_jobs # If you enable 'madmax', plot in *sequence* with very low tmpdir_max_jobs and global_max_jobs type: chia - # The chia plotter: https://github.com/Chia-Network/chia-blockchain chia: + # The stock plotter: https://github.com/Chia-Network/chia-blockchain k: 32 # k-size of plot, leave at 32 most of the time - e: False # Disable bitfield back sorting (default is True) + e: False # Use -e plotting option n_threads: 2 # Threads per job n_buckets: 128 # Number of buckets to split data into job_buffer: 3389 # Per job memory - # The madmax plotter: https://github.com/madMAx43v3r/chia-plotter madmax: + # madMAx plotter: https://github.com/madMAx43v3r/chia-plotter n_threads: 4 # Default is 4, SLOWLY crank up if you have many cores n_buckets: 256 # Default is 256 + n_buckets3: 256 # Default is 256 + n_rmulti2: 1 # Default is 1 diff --git a/scripts/chiadog_launch.sh b/scripts/chiadog_launch.sh index 57d15188..898f2fc3 100644 --- a/scripts/chiadog_launch.sh +++ b/scripts/chiadog_launch.sh @@ -6,7 +6,7 @@ cp -f /machinaris/scripts/chiadog_notifier.sh /root/.chia/chiadog/notifier.sh && echo 'Starting Chiadog...' cd /chiadog chiadog_pids=$(pidof python3) -if [ ! -z $chiadog_pids ]; then +if [[ ! -z $chiadog_pids ]]; then kill $chiadog_pids fi /chia-blockchain/venv/bin/python3 -u main.py --config /root/.chia/chiadog/config.yaml > /root/.chia/chiadog/logs/chiadog.log 2>&1 & diff --git a/scripts/plotman_install.sh b/scripts/plotman_install.sh index 73fed0bf..00fc8b91 100644 --- a/scripts/plotman_install.sh +++ b/scripts/plotman_install.sh @@ -4,7 +4,7 @@ # cd /chia-blockchain -PLOTMAN_REPO_URL=https://github.com/ericaltendorf/plotman@main +PLOTMAN_REPO_URL=https://github.com/ericaltendorf/plotman@development from="${PLOTMAN_GIT_URL:-${PLOTMAN_REPO_URL}}" echo 'Installing Plotman from:${from}...' diff --git a/web/actions/plotman.py b/web/actions/plotman.py index 6eec7a60..aacb1486 100644 --- a/web/actions/plotman.py +++ b/web/actions/plotman.py @@ -157,15 +157,15 @@ def load_config_replacements(): farmer_pk = load_key_pk('Farmer') if farmer_pk: #app.logger.info("FARMER_PK: {0}".format(farmer_pk)) - replacements.append([ 'farmer_pk:.*$', 'farmer_pk: '+ farmer_pk]) + replacements.append([ 'farmer_pk:\s+REPLACE_WITH_THE_REAL_VALUE.*$', 'farmer_pk: '+ farmer_pk]) pool_pk = load_key_pk('Pool') if pool_pk: #app.logger.info("POOL_PK: {0}".format(pool_pk)) - replacements.append([ 'pool_pk:.*$', 'pool_pk: '+ pool_pk]) + replacements.append([ 'pool_pk:\s+REPLACE_WITH_THE_REAL_VALUE.*$', 'pool_pk: '+ pool_pk]) pool_contract_address = load_pool_contract_address() if pool_contract_address: #app.logger.info("POOL_CONTRACT_ADDRESS: {0}".format(pool_contract_address)) - replacements.append([ 'pool_contract_address:.*$', 'pool_contract_address: '+ pool_contract_address]) + replacements.append([ 'pool_contract_address:\s+REPLACE_WITH_THE_REAL_VALUE.*$', 'pool_contract_address: '+ pool_contract_address]) return replacements def load_config(plotter): @@ -177,11 +177,18 @@ def load_config(plotter): app.logger.info(traceback.format_exc()) lines = [] config = utils.send_get(plotter, "/configs/plotting", debug=False).content.decode('utf-8') + replaces = 0 for line in config.splitlines(): for replacement in replacements: - line = re.sub(replacement[0], replacement[1], line) + (line, num_replaces) = re.subn(replacement[0], replacement[1], line) + replaces += num_replaces lines.append(line) - return '\n'.join(lines) + if replaces > 0: + #app.logger.info("Return true for replaced.") + return [ True, '\n'.join(lines) ] + else: + #app.logger.info("Return false for replaced.") + return [ False, '\n'.join(lines) ] def save_config(plotter, config): try: # Validate the YAML first diff --git a/web/routes.py b/web/routes.py index 63474bd9..2a1711b2 100644 --- a/web/routes.py +++ b/web/routes.py @@ -246,7 +246,9 @@ def views_settings_config(path): elif config_type == "farming": response = make_response(chia.load_config(w, request.args.get('blockchain')), 200) elif config_type == "plotting": - response = make_response(plotman.load_config(w), 200) + [replaced, config] = plotman.load_config(w) + response = make_response(config, 200) + response.headers.set('ConfigReplacementsOccurred', replaced) else: abort("Unsupported config type: {0}".format(config_type), 400) response.mimetype = "application/x-yaml" diff --git a/web/templates/alerts.html b/web/templates/alerts.html index 4a23b25b..117ca23b 100644 --- a/web/templates/alerts.html +++ b/web/templates/alerts.html @@ -75,7 +75,7 @@ - diff --git a/web/templates/settings/plotting.html b/web/templates/settings/plotting.html index a677e07e..9e8cb795 100644 --- a/web/templates/settings/plotting.html +++ b/web/templates/settings/plotting.html @@ -32,6 +32,7 @@ {% endwith %} +
@@ -66,13 +67,21 @@ {% block scripts %}
+ Worker