-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.py
58 lines (43 loc) · 1.96 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from dotenv import load_dotenv
from loguru import logger
import os
# We clear the environment to avoid any conflicts with changes in the .env file.
os.environ.clear()
if not load_dotenv():
logger.warning("No .env file found, test endpoint will not be functional...")
# The API key others will use to access this service
EXPECTED_ACCESS_KEY = os.getenv("EXPECTED_ACCESS_KEY")
############################
# API's wallet information #
############################
# The cold and hot key wallet names used by this service to access the bittensor network.
COLDKEY_WALLET_NAME = os.environ.get("COLDKEY_WALLET_NAME")
HOTKEY_WALLET_NAME = os.environ.get("HOTKEY_WALLET_NAME")
# Leave the WALLET_PATH as None to use the default wallet path.
WALLET_PATH = os.environ.get("WALLET_PATH")
##########################
# Which network to query #
##########################
# The subtensor network to connect to.
# None or finney = the main (prod) network
# test = testnet
# local = your own local network
SUBTENSOR_NETWORK = os.getenv("SUBTENSOR_NETWORK")
# The subnet UID to connect to.
# 1 = Subnet 1
# 61 = Subnet 1 on testnet
NETUID = int(os.environ.get("NETUID", 1))
############################
# How to query the network #
############################
# Make sure we look at unique cold keys
QUERY_UNIQUE_COLDKEYS = bool(os.environ.get("QUERY_UNIQUE_COLDKEYS", "false") == "true")
# Make sure we look at unique IPs
QUERY_UNIQUE_IPS = bool(os.environ.get("QUERY_UNIQUE_IPS", "false") == "true")
# Validator port to query (used if multiple validators are running on the same uid and we need to specify which port)
# e.g. OTF has two validators running on SN1 with the same hotkey
QUERY_VALIDATOR_PORT = os.environ.get("QUERY_VALIDATOR_PORT")
# The minimum staked tao to be considered a validator
VALIDATOR_MIN_STAKE = int(os.environ.get("VALIDATOR_MIN_STAKE", 4096))
# The interval to resync the metagraph
RESYNC_METAGRAPH_INTERVAL = int(os.environ.get("RESYNC_METAGRAPH_INTERVAL", 60))