Skip to content

Commit 34758a6

Browse files
authored
Merge branch 'staging' into fix/thewhaleking/str-formatting-for-alpha
2 parents ff2150a + aacf074 commit 34758a6

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

bittensor/core/settings.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
from munch import munchify
88

99

10+
READ_ONLY = os.getenv("READ_ONLY") == "1"
11+
1012
HOME_DIR = Path.home()
1113
USER_BITTENSOR_DIR = HOME_DIR / ".bittensor"
1214
WALLETS_DIR = USER_BITTENSOR_DIR / "wallets"
1315
MINERS_DIR = USER_BITTENSOR_DIR / "miners"
1416

1517

16-
# Create dirs if they don't exist
17-
WALLETS_DIR.mkdir(parents=True, exist_ok=True)
18-
MINERS_DIR.mkdir(parents=True, exist_ok=True)
18+
if not READ_ONLY:
19+
# Create dirs if they don't exist
20+
WALLETS_DIR.mkdir(parents=True, exist_ok=True)
21+
MINERS_DIR.mkdir(parents=True, exist_ok=True)
1922

2023
# Bittensor networks name
2124
NETWORKS = ["finney", "test", "archive", "local", "subvortex", "rao", "latent-lite"]

bittensor/utils/btlogging/loggingmachine.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from statemachine import State, StateMachine
1818

19+
from bittensor.core.settings import READ_ONLY
1920
from bittensor.core.config import Config
2021
from bittensor.utils.btlogging.console import BittensorConsole
2122
from .defines import (
@@ -584,9 +585,12 @@ def add_args(cls, parser: argparse.ArgumentParser, prefix: str = None):
584585
default_logging_info = os.getenv("BT_LOGGING_INFO") or False
585586
default_logging_trace = os.getenv("BT_LOGGING_TRACE") or False
586587
default_logging_record_log = os.getenv("BT_LOGGING_RECORD_LOG") or False
587-
default_logging_logging_dir = os.getenv(
588-
"BT_LOGGING_LOGGING_DIR"
589-
) or os.path.join("~", ".bittensor", "miners")
588+
default_logging_logging_dir = (
589+
None
590+
if READ_ONLY
591+
else os.getenv("BT_LOGGING_LOGGING_DIR")
592+
or os.path.join("~", ".bittensor", "miners")
593+
)
590594
parser.add_argument(
591595
"--" + prefix_str + "logging.debug",
592596
action="store_true",

0 commit comments

Comments
 (0)