Skip to content

Commit

Permalink
move env vars check to main()
Browse files Browse the repository at this point in the history
  • Loading branch information
mpnowacki-reef committed Dec 7, 2024
1 parent 415d65c commit 393c31d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/bittensor_prometheus/read_wallet_and_substitute_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
BITTENSOR_WALLET_NAME = os.environ.get("BITTENSOR_WALLET_NAME")
BITTENSOR_WALLET_HOTKEY_NAME = os.environ.get("BITTENSOR_WALLET_HOTKEY_NAME")

if not BITTENSOR_WALLET_NAME or not BITTENSOR_WALLET_HOTKEY_NAME:
raise RuntimeError("You must set BITTENSOR_WALLET_NAME and BITTENSOR_WALLET_HOTKEY_NAME env vars")


def get_wallet() -> bittensor.wallet:
wallet = bittensor.wallet(
Expand All @@ -27,6 +24,8 @@ def read_and_substitute_config(hotkey: str):


def main():
if not BITTENSOR_WALLET_NAME or not BITTENSOR_WALLET_HOTKEY_NAME:
raise RuntimeError("You must set BITTENSOR_WALLET_NAME and BITTENSOR_WALLET_HOTKEY_NAME env vars")
wallet = get_wallet()
read_and_substitute_config(wallet.hotkey.ss58_address)

Expand Down

0 comments on commit 393c31d

Please sign in to comment.