Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it would be nice to have a copy or move function as an archive option. #632

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
bbdf4a0
Display memory usage as factor of 1024 rather than 1000
BasilHorowt May 4, 2021
3be8846
Merge branch 'development' into human_format_1024
BasilHorowt May 4, 2021
9c399fc
allow empty dst directory, if so, the tmp directory is used as buffer.
wisherhxl May 1, 2021
b8a7c45
debug.
wisherhxl May 1, 2021
de346fd
fixup! Display memory usage as factor of 1024 rather than 1000
BasilHorowt May 7, 2021
06e415f
Merge branch 'human_format_1024' of github.com:BasilHorowt/plotman in…
BasilHorowt May 7, 2021
bf6f543
fixup! Merge branch 'human_format_1024' of github.com:BasilHorowt/plo…
BasilHorowt May 7, 2021
abf1c78
include basic usage instructions
drewmullen May 1, 2021
e1dc012
Update src/plotman/resources/plotman.yaml
wisherhxl May 9, 2021
81bb174
fix: be insensitive to trailing / on rsyncd_path for df
altendky May 9, 2021
aac436f
fix: add missing import os.path
altendky May 9, 2021
278df21
fix: use posixpath for archive remote paths
altendky May 9, 2021
d882274
New configuration option for interactive
May 10, 2021
e2de4a1
Show number of running jobs in the status command
May 10, 2021
01bacff
Simplify tmp dir map
rafaelsteil May 11, 2021
900039d
Class defaults match config defaults
rafaelsteil May 11, 2021
bea021b
Rename Tools to Commands
May 11, 2021
411fa0c
removes unessisary arguments in psutil.pocess_iter in job.Job.get_run…
hackerzhuli May 11, 2021
317f057
Merge branch 'development' into status-more-info
altendky May 12, 2021
24c9ff0
Merge pull request #315 from rafaelsteil/status-more-info
altendky May 12, 2021
b42ace6
Merge branch 'development' into altendky-patch-2
altendky May 12, 2021
a527dd7
Merge branch 'development' into development
altendky May 12, 2021
17255ba
Merge pull request #340 from hackerzhuli/development
altendky May 12, 2021
cc22ea6
Merge branch 'development' into altendky-patch-2
altendky May 12, 2021
68a1056
Merge pull request #295 from ericaltendorf/altendky-patch-2
altendky May 12, 2021
d680826
fix: make plot_util.df_b (return free space for directory) cross plat…
hackerzhuli May 12, 2021
509601f
Merge branch 'main' into main_to_development_v0.3
altendky May 12, 2021
9cfe16d
Update VERSION
altendky May 12, 2021
305f7a6
Merge pull request #362 from altendky/main_to_development_v0.3
altendky May 12, 2021
851fb50
fix: another tuple needed to be a phase
altendky May 12, 2021
e37b4f4
Merge pull request #368 from altendky/another_phase
altendky May 12, 2021
a8e55e7
~= install_requires deps (mostly)
altendky May 12, 2021
e055364
Merge pull request #369 from ericaltendorf/altendky-patch-2
altendky May 12, 2021
e088a7b
fix: use --compress-level=0 for macOS
altendky May 13, 2021
541e4ec
Merge pull request #384 from ericaltendorf/compress_level_0
altendky May 13, 2021
23d23c3
Removes summary info that was leaking into interactive
May 13, 2021
1c4e697
Merge branch 'main' into main_to_development_v0.3.1
altendky May 13, 2021
784ebf5
Merge pull request #391 from altendky/main_to_development_v0.3.1
altendky May 13, 2021
bc719a7
Shows current date and time with plotman status
May 13, 2021
507ad7c
fix: skip so-called plot processes that are parents of others
altendky May 14, 2021
cee3f8a
chore: remove commented diagnostic code
altendky May 14, 2021
e2607ca
chore: explain the parent pid filtering
altendky May 14, 2021
2ac28f8
fix: don't corrupt display when log files not found
altendky May 14, 2021
510dab4
Merge pull request #421 from ericaltendorf/altendky-patch-2
altendky May 14, 2021
a0edac5
Merge branch 'development' into to_push_tmp_dir
altendky May 14, 2021
3bf3056
fix: return values from get_dst_directories()
altendky May 14, 2021
b208e05
refactor: move get_dst_directories() to method
altendky May 14, 2021
267b073
chore: remove trailing whitespace
altendky May 14, 2021
8580d75
Merge pull request #443 from altendky/tidy_trailing_whitespace
altendky May 14, 2021
1a34b7e
Merge branch 'development' into to_push_tmp_dir
altendky May 14, 2021
fc15d33
nit: add back a blank line...
altendky May 14, 2021
2f3a66e
nit: tweak yaml comments
altendky May 14, 2021
aa526ee
refactor: separate dst_is_tmp() and get_dst_directories() methods
altendky May 14, 2021
bfa018b
test: a few tmp as dst tests
altendky May 15, 2021
d9f3d7a
Merge branch 'development' into remove-monitor-summary
altendky May 15, 2021
8d3f132
Merge pull request #389 from rafaelsteil/remove-monitor-summary
altendky May 15, 2021
fa33c9d
Merge branch 'development' into skip_matching_plot_process_parents
altendky May 15, 2021
650dd63
add more chia cli parsers (1.1.4, 1.1.5)
altendky May 15, 2021
5bce900
Merge branch 'development' into add_more_chia_cli_parsers
altendky May 15, 2021
6eff91b
Merge pull request #464 from altendky/add_more_chia_cli_parsers
altendky May 15, 2021
5ab2009
Merge branch 'development' into skip_matching_plot_process_parents
altendky May 15, 2021
852321a
Merge pull request #418 from altendky/skip_matching_plot_process_parents
altendky May 15, 2021
adb104f
Merge branch 'development' into human_format_1024
altendky May 15, 2021
822ac20
adds -x parameter to plot command
May 15, 2021
1f2276b
calculate plot size given the parameter k
hackerzhuli May 15, 2021
71feada
converts size from float to int
hackerzhuli May 15, 2021
3ce1598
Merge branch 'development' into exclude-final-dir
altendky May 15, 2021
ffbe175
Merge pull request #455 from mruckli/exclude-final-dir
altendky May 15, 2021
c4b516a
Update src/plotman/plot_util.py
altendky May 15, 2021
96e5825
Merge branch 'development' into development
altendky May 15, 2021
cabefb7
Merge pull request #361 from hackerzhuli/development
altendky May 15, 2021
08a571f
Merge branch 'development' into status-date
altendky May 15, 2021
9eb523b
fix typo: 'cleaing' -> 'cleaning' in 'plotman kill' output
judeallred May 15, 2021
d8d940c
Merge branch 'development' into typo-fix-plotman-kill
altendky May 15, 2021
005fc15
Merge branch 'main' into main_to_development_v0.3.1_again
altendky May 15, 2021
170e085
Merge pull request #480 from altendky/main_to_development_v0.3.1_again
altendky May 15, 2021
5009023
Merge branch 'development' into typo-fix-plotman-kill
altendky May 15, 2021
917d457
Merge pull request #479 from judeallred/typo-fix-plotman-kill
altendky May 15, 2021
874cb26
Merge branch 'development' into status-date
altendky May 15, 2021
a0167ce
Merge branch 'main' into main
altendky May 15, 2021
7599426
Merge branch 'development' into main
altendky May 15, 2021
2a4af17
Merge pull request #204 from drewmullen/main
altendky May 15, 2021
6cdffb9
Merge branch 'development' into to_push_tmp_dir
altendky May 15, 2021
3f788e9
Merge pull request #234 from wisherhxl/to_push_tmp_dir
altendky May 15, 2021
65f23ea
calculates plotsize given parameter k more accurately
hackerzhuli May 16, 2021
55e8905
changes position of variable to avoid conflict
hackerzhuli May 16, 2021
c822b67
add back line that was accidently removed
hackerzhuli May 16, 2021
0ebec09
Merge branch 'development' into get_plotsize
hackerzhuli May 16, 2021
473b319
Merge branch 'development' into status-date
altendky May 16, 2021
5bd13dc
Update src/plotman/plotman.py
altendky May 16, 2021
5bff3dd
Merge pull request #410 from rafaelsteil/status-date
altendky May 16, 2021
0f250fe
Merge branch 'development' of github.com:ericaltendorf/plotman into g…
hackerzhuli May 17, 2021
77f3964
fix: removes unused import of readline module, it does not exist in W…
hackerzhuli May 17, 2021
85a217b
fix: need to subtract then multiply
altendky May 20, 2021
278fd52
Merge pull request #597 from ericaltendorf/more_parens
altendky May 20, 2021
170c4d9
fix: avoid more missing process errors
altendky May 21, 2021
36caffd
Merge pull request #605 from ericaltendorf/altendky-patch-2
altendky May 21, 2021
1201421
feat: use Gi, Ti, etc for power-of-two scaling
altendky May 22, 2021
f93ca87
Merge branch 'development' into human_format_1024
altendky May 22, 2021
1a19aa8
Merge pull request #229 from BasilHorowt/human_format_1024
altendky May 22, 2021
885b4a6
handle no dst but tmp2 specified
altendky May 30, 2021
1bda1e3
Update src/plotman/manager.py
altendky May 30, 2021
b150dbf
Merge branch 'development' into remove-unused-import-readline
altendky May 30, 2021
a0cf3bf
Merge branch 'development' into get_plotsize
altendky May 30, 2021
cc27431
add test for get_plotsize()
altendky May 30, 2021
968a212
Merge pull request #520 from hackerzhuli/remove-unused-import-readline
altendky May 30, 2021
f9af424
Merge branch 'development' into get_plotsize
altendky May 30, 2021
500ac12
Merge pull request #471 from hackerzhuli/get_plotsize
altendky May 30, 2021
ddbf3d6
ignore more FileNotFoundErrors
altendky May 30, 2021
6dbde2f
Merge branch 'development' into dst_is_tmp2
altendky May 31, 2021
51318f2
Merge pull request #702 from altendky/ignore_more_file_not_found_errors
altendky May 31, 2021
e23101c
Merge branch 'development' into dst_is_tmp2
altendky May 31, 2021
5f378d1
Merge pull request #701 from ericaltendorf/dst_is_tmp2
altendky May 31, 2021
954b4fb
simplify --no-* option handling
altendky Jun 1, 2021
80427a2
Merge branch 'development' into interactive-noauto-start
altendky Jun 1, 2021
4666b80
cleanup
altendky Jun 1, 2021
aca4599
remove tests no longer needed due to config defaults
altendky Jun 1, 2021
ec8243d
Merge pull request #305 from rafaelsteil/interactive-noauto-start
altendky Jun 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __pycache__
venv
.DS_Store
.vscode
src/plotman.egg-info
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,25 @@ archive jobs initiated. This is the one part of the interactive tool which is
stateful. There is no permanent record of these executed command lines, so if
you start a new interactive plotman session, this log is empty.

## `plotman` commands
To get a complete list of all available commands run:
```shell
plotman -h
```

You can also use `plotman <command> -h` to get help about a specific command, like
```shell
plotman interactive -h
```

## Running `plotman` as a daemon
> _PS: this section assumes that you have already configured `plotman.yaml`._

By default the command `plotman plot` will start the plotting job and continue to run on the foregroud as long as you keep the terminal window open. If you want to have it constantly running, try the following:
```shell
nohup plotman plot >> ~/plotman.log 2>&1 &
```

## Limitations and Issues

The system is tested on Linux only. Plotman should be generalizable to other
Expand Down Expand Up @@ -203,6 +222,22 @@ Installation for Linux and macOS:
4. That's it! You can now run Plotman by typing `plotman version` to verify its version.
Run `plotman --help` to learn about the available commands.

*Note:* If you see `ModuleNotFoundError: No module named 'readline'` when using `plotman` on [RHEL based linux](https://github.com/ericaltendorf/plotman/issues/195) after installing using [chia's guide](https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL#centos--red-hat--fedora), install `readline-devel` then reinstall chia starting at compiling python in a new build environment; or consider using a project like `pyenv`.

## Basic Usage:

1. Install

2. Generate initial config

3. Configure (default location can be found with `plotman config path`). Options explained in the default config file (step 2)

4. Create log directory specified in `directories: { log: "" }`

5. Start plotman: `plotman plot` or `plotman interactive`

6. Check status: `plotman status`

### Development note:

If you are forking Plotman, simply replace the installation step with `pip install --editable .[dev]` from the project root directory to install *your* version of plotman with test and development extras.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.3.1+dev
2 changes: 1 addition & 1 deletion src/plotman/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


"""Plotman module launcher.
This is a shim that allows you to run plotman via
This is a shim that allows you to run plotman via
python3 -m plotman
"""
plotman.main()
31 changes: 30 additions & 1 deletion src/plotman/_tests/configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_get_validated_configs__default(config_text):
res = configuration.get_validated_configs(config_text, '')
assert isinstance(res, configuration.PlotmanConfig)


def test_get_validated_configs__malformed(config_text):
"""Check that get_validated_configs() raises exception with invalid plotman.yaml contents."""
loaded_yaml = yaml.load(config_text, Loader=yaml.SafeLoader)
Expand Down Expand Up @@ -54,3 +53,33 @@ def test_loads_without_user_interface(config_text):
reloaded_yaml = configuration.get_validated_configs(stripped_config_text, '')

assert reloaded_yaml.user_interface == configuration.UserInterface()


def test_get_dst_directories_gets_dst():
tmp = ['/tmp']
dst = ['/dst0', '/dst1']
directories = configuration.Directories(log='', tmp=tmp, dst=dst)

assert directories.get_dst_directories() == dst


def test_get_dst_directories_gets_tmp():
tmp = ['/tmp']
directories = configuration.Directories(log='', tmp=tmp)

assert directories.get_dst_directories() == tmp


def test_dst_is_dst():
tmp = ['/tmp']
dst = ['/dst0', '/dst1']
directories = configuration.Directories(log='', tmp=tmp, dst=dst)

assert not directories.dst_is_tmp()


def test_dst_is_tmp():
tmp = ['/tmp']
directories = configuration.Directories(log='', tmp=tmp)

assert directories.dst_is_tmp()
2 changes: 1 addition & 1 deletion src/plotman/_tests/manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_dstdirs_to_furthest_phase():
{ '/plots1' : (1, 5),
'/plots2' : (3, 1),
'/plots3' : (4, 1) } )


def test_dstdirs_to_youngest_phase():
all_jobs = [ job_w_dstdir_phase('/plots1', (1, 5)),
Expand Down
10 changes: 10 additions & 0 deletions src/plotman/_tests/plot_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ def test_human_format():
assert (plot_util.human_format(3442000000, 0) == '3G')
assert (plot_util.human_format(3542000, 2) == '3.54M')
assert (plot_util.human_format(354, 0) == '354')
assert (plot_util.human_format(354, 0, True) == '354')
assert (plot_util.human_format(354, 2) == '354.00')
assert (plot_util.human_format(422399296143, 2) == '422.40G')
assert (plot_util.human_format(422399296143, 2, True) == '393.39Gi')

def test_time_format():
assert (plot_util.time_format(34) == '34s')
Expand Down Expand Up @@ -54,3 +57,10 @@ def test_list_k32_plots(fs: pyfakefs.fake_filesystem.FakeFilesystem):
[ '/t/plot-k32-0.plot',
'/t/plot-k32-1.plot',
'/t/plot-k32-5.plot' ] )


def test_get_plotsize():
assert (
[659272492, 107287518791, 221143636517, 455373353413, 936816632588]
== [plot_util.get_plotsize(n) for n in [25, 32, 33, 34, 35]]
)
29 changes: 15 additions & 14 deletions src/plotman/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import contextlib
import math
import os
import posixpath
import random
import re
import subprocess
Expand All @@ -16,16 +17,16 @@
# TODO : write-protect and delete-protect archived plots

def spawn_archive_process(dir_cfg, all_jobs):
'''Spawns a new archive process using the command created
'''Spawns a new archive process using the command created
in the archive() function. Returns archiving status and a log message to print.'''

log_message = None
archiving_status = None

# Look for running archive jobs. Be robust to finding more than one
# even though the scheduler should only run one at a time.
arch_jobs = get_running_archive_jobs(dir_cfg.archive)

if not arch_jobs:
(should_start, status_or_cmd) = archive(dir_cfg, all_jobs)
if not should_start:
Expand All @@ -37,7 +38,7 @@ def spawn_archive_process(dir_cfg, all_jobs):
shell=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
start_new_session=True)
start_new_session=True)
log_message = 'Starting archive: ' + cmd
# At least for now it seems that even if we get a new running
# archive jobs list it doesn't contain the new rsync process.
Expand All @@ -51,7 +52,7 @@ def spawn_archive_process(dir_cfg, all_jobs):
archiving_status = 'pid: ' + ', '.join(map(str, arch_jobs))

return archiving_status, log_message

def compute_priority(phase, gb_free, n_plots):
# All these values are designed around dst buffer dirs of about
# ~2TB size and containing k32 plots. TODO: Generalize, and
Expand All @@ -71,7 +72,7 @@ def compute_priority(phase, gb_free, n_plots):
priority -= 16
elif (phase >= job.Phase(3, 7)):
priority -= 32

# If a drive is getting full, we should prioritize it
if (gb_free < 1000):
priority += 1 + int((1000 - gb_free) / 100)
Expand All @@ -87,7 +88,7 @@ def compute_priority(phase, gb_free, n_plots):
def get_archdir_freebytes(arch_cfg):
archdir_freebytes = {}
df_cmd = ('ssh %s@%s df -aBK | grep " %s/"' %
(arch_cfg.rsyncd_user, arch_cfg.rsyncd_host, arch_cfg.rsyncd_path) )
(arch_cfg.rsyncd_user, arch_cfg.rsyncd_host, posixpath.normpath(arch_cfg.rsyncd_path)) )
with subprocess.Popen(df_cmd, shell=True, stdout=subprocess.PIPE) as proc:
for line in proc.stdout.readlines():
fields = line.split()
Expand Down Expand Up @@ -124,7 +125,7 @@ def get_running_archive_jobs(arch_cfg):

def archive(dir_cfg, all_jobs):
'''Configure one archive job. Needs to know all jobs so it can avoid IO
contention on the plotting dstdir drives. Returns either (False, <reason>)
contention on the plotting dstdir drives. Returns either (False, <reason>)
if we should not execute an archive job or (True, <cmd>) with the archive
command if we should.'''
if dir_cfg.archive is None:
Expand All @@ -133,13 +134,13 @@ def archive(dir_cfg, all_jobs):
dir2ph = manager.dstdirs_to_furthest_phase(all_jobs)
best_priority = -100000000
chosen_plot = None

for d in dir_cfg.dst:
dst_dir = dir_cfg.get_dst_directories()
for d in dst_dir:
ph = dir2ph.get(d, job.Phase(0, 0))
dir_plots = plot_util.list_k32_plots(d)
gb_free = plot_util.df_b(d) / plot_util.GB
n_plots = len(dir_plots)
priority = compute_priority(ph, gb_free, n_plots)
priority = compute_priority(ph, gb_free, n_plots)
if priority >= best_priority and dir_plots:
best_priority = priority
chosen_plot = dir_plots[0]
Expand All @@ -156,17 +157,17 @@ def archive(dir_cfg, all_jobs):
archdir_freebytes = get_archdir_freebytes(dir_cfg.archive)
if not archdir_freebytes:
return(False, 'No free archive dirs found.')

archdir = ''
available = [(d, space) for (d, space) in archdir_freebytes.items() if
available = [(d, space) for (d, space) in archdir_freebytes.items() if
space > 1.2 * plot_util.get_k32_plotsize()]
if len(available) > 0:
index = min(dir_cfg.archive.index, len(available) - 1)
(archdir, freespace) = sorted(available)[index]

if not archdir:
return(False, 'No archive directories found with enough free space')

msg = 'Found %s with ~%d GB free' % (archdir, freespace / plot_util.GB)

bwlimit = dir_cfg.archive.rsyncd_bwlimit
Expand Down
118 changes: 114 additions & 4 deletions src/plotman/chia.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def latest_command(self):

@commands.register(version=(1, 1, 2))
@click.command()
# https://github.com/Chia-Network/chia-blockchain/blob/v1.1.2/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/v1.1.2/chia/cmds/plots.py#L39-L83
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.2/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.2/chia/cmds/plots.py#L39-L83
# start copied code
@click.option("-k", "--size", help="Plot size", type=int, default=32, show_default=True)
@click.option("--override-k", help="Force size smaller than 32", default=False, show_default=True, is_flag=True)
Expand Down Expand Up @@ -87,8 +87,8 @@ def _cli():

@commands.register(version=(1, 1, 3))
@click.command()
# https://github.com/Chia-Network/chia-blockchain/blob/v1.1.3/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/v1.1.3/chia/cmds/plots.py#L39-L83
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.3/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.3/chia/cmds/plots.py#L39-L83
# start copied code
@click.option("-k", "--size", help="Plot size", type=int, default=32, show_default=True)
@click.option("--override-k", help="Force size smaller than 32", default=False, show_default=True, is_flag=True)
Expand Down Expand Up @@ -138,3 +138,113 @@ def _cli():
# end copied code
def _cli():
pass


@commands.register(version=(1, 1, 4))
@click.command()
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.4/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.4/chia/cmds/plots.py#L39-L83
# start copied code
@click.option("-k", "--size", help="Plot size", type=int, default=32, show_default=True)
@click.option("--override-k", help="Force size smaller than 32", default=False, show_default=True, is_flag=True)
@click.option("-n", "--num", help="Number of plots or challenges", type=int, default=1, show_default=True)
@click.option("-b", "--buffer", help="Megabytes for sort/plot buffer", type=int, default=3389, show_default=True)
@click.option("-r", "--num_threads", help="Number of threads to use", type=int, default=2, show_default=True)
@click.option("-u", "--buckets", help="Number of buckets", type=int, default=128, show_default=True)
@click.option(
"-a",
"--alt_fingerprint",
type=int,
default=None,
help="Enter the alternative fingerprint of the key you want to use",
)
@click.option(
"-c",
"--pool_contract_address",
type=str,
default=None,
help="Address of where the pool reward will be sent to. Only used if alt_fingerprint and pool public key are None",
)
@click.option("-f", "--farmer_public_key", help="Hex farmer public key", type=str, default=None)
@click.option("-p", "--pool_public_key", help="Hex public key of pool", type=str, default=None)
@click.option(
"-t",
"--tmp_dir",
help="Temporary directory for plotting files",
type=click.Path(),
default=Path("."),
show_default=True,
)
@click.option("-2", "--tmp2_dir", help="Second temporary directory for plotting files", type=click.Path(), default=None)
@click.option(
"-d",
"--final_dir",
help="Final directory for plots (relative or absolute)",
type=click.Path(),
default=Path("."),
show_default=True,
)
@click.option("-i", "--plotid", help="PlotID in hex for reproducing plots (debugging only)", type=str, default=None)
@click.option("-m", "--memo", help="Memo in hex for reproducing plots (debugging only)", type=str, default=None)
@click.option("-e", "--nobitfield", help="Disable bitfield", default=False, is_flag=True)
@click.option(
"-x", "--exclude_final_dir", help="Skips adding [final dir] to harvester for farming", default=False, is_flag=True
)
# end copied code
def _cli():
pass


@commands.register(version=(1, 1, 5))
@click.command()
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.5/LICENSE
# https://github.com/Chia-Network/chia-blockchain/blob/1.1.5/chia/cmds/plots.py#L39-L83
# start copied code
@click.option("-k", "--size", help="Plot size", type=int, default=32, show_default=True)
@click.option("--override-k", help="Force size smaller than 32", default=False, show_default=True, is_flag=True)
@click.option("-n", "--num", help="Number of plots or challenges", type=int, default=1, show_default=True)
@click.option("-b", "--buffer", help="Megabytes for sort/plot buffer", type=int, default=3389, show_default=True)
@click.option("-r", "--num_threads", help="Number of threads to use", type=int, default=2, show_default=True)
@click.option("-u", "--buckets", help="Number of buckets", type=int, default=128, show_default=True)
@click.option(
"-a",
"--alt_fingerprint",
type=int,
default=None,
help="Enter the alternative fingerprint of the key you want to use",
)
@click.option(
"-c",
"--pool_contract_address",
type=str,
default=None,
help="Address of where the pool reward will be sent to. Only used if alt_fingerprint and pool public key are None",
)
@click.option("-f", "--farmer_public_key", help="Hex farmer public key", type=str, default=None)
@click.option("-p", "--pool_public_key", help="Hex public key of pool", type=str, default=None)
@click.option(
"-t",
"--tmp_dir",
help="Temporary directory for plotting files",
type=click.Path(),
default=Path("."),
show_default=True,
)
@click.option("-2", "--tmp2_dir", help="Second temporary directory for plotting files", type=click.Path(), default=None)
@click.option(
"-d",
"--final_dir",
help="Final directory for plots (relative or absolute)",
type=click.Path(),
default=Path("."),
show_default=True,
)
@click.option("-i", "--plotid", help="PlotID in hex for reproducing plots (debugging only)", type=str, default=None)
@click.option("-m", "--memo", help="Memo in hex for reproducing plots (debugging only)", type=str, default=None)
@click.option("-e", "--nobitfield", help="Disable bitfield", default=False, is_flag=True)
@click.option(
"-x", "--exclude_final_dir", help="Skips adding [final dir] to harvester for farming", default=False, is_flag=True
)
# end copied code
def _cli():
pass
Loading