diff --git a/precog/utils/config.py b/precog/utils/config.py index 2b7cb79..91984bb 100644 --- a/precog/utils/config.py +++ b/precog/utils/config.py @@ -19,6 +19,7 @@ import argparse import os import subprocess +from typing import Optional import bittensor as bt @@ -275,11 +276,10 @@ def to_string(bt_config: bt.Config): return string.strip() -def config(neuron_type: str = "validator"): +def config(parser: Optional[argparse.ArgumentParser] = argparse.ArgumentParser(), neuron_type: str = "validator"): """ Returns the configuration object specific to this miner or validator after adding relevant arguments. """ - parser = argparse.ArgumentParser() bt.wallet.add_args(parser) bt.subtensor.add_args(parser) bt.logging.add_args(parser) diff --git a/precog/validators/validator.py b/precog/validators/validator.py index a9b6680..d20bd4f 100755 --- a/precog/validators/validator.py +++ b/precog/validators/validator.py @@ -1,3 +1,4 @@ +import argparse import asyncio from pathlib import Path @@ -7,7 +8,7 @@ class Validator: def __init__(self): - self.config = config(neuron_type="validator") + self.config = config(parser=argparse.ArgumentParser(), neuron_type="validator") print(self.config) full_path = Path( f"{self.config.logging.logging_dir}/{self.config.wallet.name}/{self.config.wallet.hotkey}/netuid{self.config.netuid}/validator"