@@ -73,6 +73,8 @@ def get_validated_configs(config_text: str, config_path: str, preset_target_defi
73
73
74
74
if loaded .plotting .type == "chia" :
75
75
if loaded .plotting .chia is None :
76
+ # TODO: fix all the `TODO: use the configured executable` so this is not
77
+ # needed.
76
78
raise ConfigurationException (
77
79
"chia selected as plotter but plotting: chia: was not specified in the config" ,
78
80
)
@@ -81,6 +83,12 @@ def get_validated_configs(config_text: str, config_path: str, preset_target_defi
81
83
raise ConfigurationException (
82
84
"Chia Network plotter accepts up to one of plotting: pool_pk: and pool_contract_address: but both are specified" ,
83
85
)
86
+
87
+ executable_name = os .path .basename (loaded .plotting .chia .executable )
88
+ if executable_name != "chia" :
89
+ raise ConfigurationException (
90
+ "plotting: chia: executable: must refer to an executable named chia"
91
+ )
84
92
elif loaded .plotting .type == "madmax" :
85
93
if loaded .plotting .madmax is None :
86
94
raise ConfigurationException (
@@ -101,6 +109,14 @@ def get_validated_configs(config_text: str, config_path: str, preset_target_defi
101
109
"madMAx plotter accepts only one of plotting: pool_pk: and pool_contract_address: but both are specified" ,
102
110
)
103
111
112
+ executable_name = os .path .basename (loaded .plotting .madmax .executable )
113
+ if executable_name != "chia_plot" :
114
+ # TODO: fix all the `TODO: use the configured executable` so this is not
115
+ # needed.
116
+ raise ConfigurationException (
117
+ "plotting: madmax: executable: must refer to an executable named chia_plot"
118
+ )
119
+
104
120
if loaded .archiving is not None :
105
121
preset_target_objects = yaml .safe_load (preset_target_definitions_text )
106
122
preset_target_schema = desert .schema (PresetTargetDefinitions )
@@ -312,6 +328,7 @@ class Scheduling:
312
328
313
329
@attr .frozen
314
330
class ChiaPlotterOptions :
331
+ executable : str = "chia"
315
332
n_threads : int = 2
316
333
n_buckets : int = 128
317
334
k : Optional [int ] = 32
@@ -321,6 +338,7 @@ class ChiaPlotterOptions:
321
338
322
339
@attr .frozen
323
340
class MadmaxPlotterOptions :
341
+ executable : str = "chia_plot"
324
342
n_threads : int = 4
325
343
n_buckets : int = 256
326
344
@@ -369,9 +387,15 @@ class PlotmanConfig:
369
387
@contextlib .contextmanager
370
388
def setup (self ) -> Generator [None , None , None ]:
371
389
if self .plotting .type == 'chia' :
390
+ if self .plotting .chia is None :
391
+ message = (
392
+ "internal plotman error, please report the full traceback and your"
393
+ + " full configuration file"
394
+ )
395
+ raise Exception (message )
372
396
if self .plotting .pool_contract_address is not None :
373
397
completed_process = subprocess .run (
374
- args = [' chia' , 'version' ],
398
+ args = [self . plotting . chia . executable , 'version' ],
375
399
capture_output = True ,
376
400
check = True ,
377
401
encoding = 'utf-8' ,
@@ -384,9 +408,16 @@ def setup(self) -> Generator[None, None, None]:
384
408
f' plots but found: { version } '
385
409
)
386
410
elif self .plotting .type == 'madmax' :
411
+ if self .plotting .madmax is None :
412
+ message = (
413
+ "internal plotman error, please report the full traceback and your"
414
+ + " full configuration file"
415
+ )
416
+ raise Exception (message )
417
+
387
418
if self .plotting .pool_contract_address is not None :
388
419
completed_process = subprocess .run (
389
- args = ['chia_plot' , '--help' ],
420
+ args = [self . plotting . madmax . executable , '--help' ],
390
421
capture_output = True ,
391
422
check = True ,
392
423
encoding = 'utf-8' ,
0 commit comments