Vim�UnDo�� ����|6�d!�+}�0�6��v^����<ͿB logger.error("could not connect to redis", connection)7 \��� _�0����\����2 "successfully connected to redis "5�_�0����\����0 "successfully connected to redis5�_�0����\����1 "successfully connected to redis"> "host={} port={}".format(self.host, self.port)5�_�1����\����` "successfully connected to redis" "host={} port={}".format(self.host, self.port)5�_�2����\����G "successfully connected to redis"(self.host, self.port)5�_� F����\����Q "successfully connected to redis", {"host": self.host, self.port)5�_� M����\����X "successfully connected to redis", {"host": self.host, "port" self.port)5�_� X����\����Y "successfully connected to redis", {"host": self.host, "port": self.port)5�_� Y����\����Z "successfully connected to redis", {"host": self.host, "port": self.port})5�_� X����\����import redis from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class MinaryRedis:# def __init__(self, host, port): self.host = host self.port = port def init_redis(self): try:S self.r = redis.StrictRedis(self.host, self.port, decode_responses=True) logger.info(Y "successfully connected to redis", {"host": self.host, "port": self.port} ) return self.r except Exception as e: logger.error(- "could not connect to redis "? "host={} port={} ".format(self.host, self.port) ) raise e5�_� ,����\�����5�_�+����\����- "could not connect to redis "5�_�,����\����, "could not connect to redis"5�_�����\����? "host={} port={} ".format(self.host, self.port)5�_�����\����import redis from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class MinaryRedis:# def __init__(self, host, port): self.host = host self.port = port def init_redis(self): try:S self.r = redis.StrictRedis(self.host, self.port, decode_responses=True) logger.info(2 "successfully connected to redis",7 {"host": self.host, "port": self.port}, ) return self.r except Exception as e: logger.error(- "could not connect to redis",7 {"host": self.host, "port": self.port}, ) raise e5�_�����\���� � 5�_�����\���� self.connection =� 5�_�@����\���� @ self.connection ={"host": self.host, "port": self.port},5�_�����\���� ? self.connection ={"host": self.host, "port": self.port}5�_�����\����7 {"host": self.host, "port": self.port},5�_�2����\����2 "successfully connected to redis",5�_�A����\����import redis from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class MinaryRedis:# def __init__(self, host, port): self.host = host self.port = port@ self.connection = {"host": self.host, "port": self.port} def init_redis(self): try:S self.r = redis.StrictRedis(self.host, self.port, decode_responses=True) logger.info(B "successfully connected to redis", self.connection ) return self.r except Exception as e: logger.error(T "could not connect to redis", {"host": self.host, "port": self.port} ) raise e5�_�.����\����T "could not connect to redis", {"host": self.host, "port": self.port}5�_�.����\����. "could not connect to redis", 5�_�7����\����import redis from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class MinaryRedis:# def __init__(self, host, port): self.host = host self.port = port@ self.connection = {"host": self.host, "port": self.port} def init_redis(self): try:S self.r = redis.StrictRedis(self.host, self.port, decode_responses=True)K logger.info("successfully connected to redis", self.connection) return self.r except Exception as e: logger.error(8 "could not connect to redis", connection ) raise e5�_� 7����\��� �B logger.error("could not connect to redis", connection)5�_� 7����\��� �G logger.error("could not connect to redis", self.connection)5�_�����\���� 5�_�����\����5�_� Y����\����Z "successfully connected to redis", {"host": self.host, "port": self.port)}5�_�1����\����1 "successfully connected to redis"5�_�1����\����3 "successfully connected to redis", 5��
VimЯUnDoхЪїл╙ y!г╪Фw▒∙╡їSЛ╒,`╘т;┘#м┴│y=Н2 "user": ""self.wallet_address,^^гLI_╨К* ^|·SїЙЛJ logger.info("Stopped {} API", format(self.__class__.__name__))5Б_╨п" ^г0Аїо░КE self.wallet_address = "{}:{}".format(address, self.worker_id)5Б_╨U ^г3sїUWЛ їVWЛїUWК5Б_╨V ^г3yїUWЛ "-rig-id"5Б_╨V ^г3{їUWЛ "rig-id"5Б_╨V ^г3ЯїUWЛ "rig-id":5Б_╨V$ ^г3жїUWЛ$ "rig-id": self.worker_id5Б_╨ V ^г4oїUWЛ% "rig-id": self.worker_id,5Б_╨ V ^г4ВїUWЛ, "api": {rig-id": self.worker_id,5Б_╨ V1 ^г4ИїUWЛ2 "api": {"worker-idid": self.worker_id,5Б_╨ V ^г4РїUWЛ3 "api": {"worker-idid": self.worker_id},5Б_╨V ^г;╫їVXМ їWXМїVXЛ5Б_╨ V ^г;▌їUWМ1 "api": {"worker-id": self.worker_id},5Б_╨W ^г;▐їVXМ "rig-id"їWXМ5Б_╨W# ^г;рїVXМ# "rig-id" self.worker_id5Б_╨V ^г;с їUV" "api": {"worker-id":},5Б_╨V ^г;чїUWЛ$ "rig-id" self.worker_id,5Б_╨V ^г;щ їЛimport jsonimport configparserimport subprocessimport shlex from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class Miner: def __init__(self):# self.miner_exec_path = None self.pool_url = None self.pool_host = None self.pool_port = None! self.pool_password = None! self.pool_username = None self.worker_id = None" self.wallet_address = None def make_cmd(self): pass( def configure(self, gpu_info, coin): pass* def set_wallet_address(self, address):% self.wallet_address = address def set_worker_id(self, id): self.worker_id = id def set_pool_url(self, url): if url: self.pool_url = url1 pool_split = self.pool_url.split(":")# if len(pool_split) > 2:( protocol = pool_split[0]H self.pool_host = "{}:{}".format(protocol, pool_split[1])3 self.pool_port = int(pool_split[2]) else:. self.pool_host = pool_split[0]3 self.pool_port = int(pool_split[1])* def set_pool_username(self, username):% self.pool_username = username* def set_pool_password(self, password):% self.pool_password = password def start_http_server(self): pass def stop_http_server(self): passclass ClaymoreMiner(Miner):# def __init__(self, miner_path):O self.miner_exec_path = "{}/claymore/./ethdcrminer64".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}/{}".format(address, self.worker_id) def make_cmd(self):6 return "{} -epool {} -ewal {} -mode 1".format(D self.miner_exec_path, self.pool_url, self.wallet_address )class XmrStakMiner(Miner):# def __init__(self, miner_path):J self.miner_exec_path = "{}/xmr-stak/./xmr-stak".format(miner_path)G self.amd_config_path = "{}/xmr-stak/amd.txt".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}.{}".format(address, self.worker_id)- def configure(self, gpu_info, coin=None):2 with open(self.amd_config_path, "w") as f:3 f.write(self.generate_config(gpu_info))$ def generate_config(self, gpus):S config = '"auto_tune" : 20,\n"platform_index" : 0,\n"gpu_threads_conf" : [' gpu_config = { "Coinmine RX 580": {! "intensity": 880,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "RX 580": {! "intensity": 880,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "RX 570": {! "intensity": 800,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "Vega 56": {" "intensity": 1932,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 8, "unroll": 8, }, "Vega 64": {" "intensity": 1932,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 8, "unroll": 8, }, "Radeon VII": {" "intensity": 1920,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 16, "unroll": 4, }, } adapter_num = 0 for gpu in gpus:# double_thread_gpu = """ {{ "index" : {0},( "intensity" : {1}, "worksize" : {2},@ "affine_to_cpu" : {3}, "strided_index" : 2, "mem_chunk" : 2,8 "unroll" : {4}, "comp_mode" : {5}, "interleave" : 40 }}, {{ "index" : {0},( "intensity" : {1}, "worksize" : {2},@ "affine_to_cpu" : {3}, "strided_index" : 2, "mem_chunk" : 2,8 "unroll" : {4}, "comp_mode" : {5}, "interleave" : 40 }},"""= intensity = gpu_config[gpu["model"]]["intensity"]; worksize = gpu_config[gpu["model"]]["worksize"]E affine_to_cpu = gpu_config[gpu["model"]]["affine_to_cpu"]7 unroll = gpu_config[gpu["model"]]["unroll"]= comp_mode = gpu_config[gpu["model"]]["comp_mode"]/ config += double_thread_gpu.format(R adapter_num, intensity, worksize, affine_to_cpu, unroll, comp_mode ) adapter_num += 1 # end gpus config += "],\n" return config def make_cmd(self): return (7 "{} -O {} -u {} --currency monero -i 5004 "2 '-p "" -r "" --noCPU --amd {}'.format(% self.miner_exec_path, self.pool_url,$ self.wallet_address,% self.amd_config_path, ) ) class ClaymoreZcashMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/claymore-zcash/./zecminer64".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}.{}".format(address, self.worker_id) def make_cmd(self):? return "{} -zpool {} -zwal {} -zpsw z -ftime 1".format(D self.miner_exec_path, self.pool_url, self.wallet_address )class NanoMiner(Miner):# def __init__(self, miner_path):L self.miner_exec_path = "{}/nanominer/./nanominer".format(miner_path)M self.miner_config_path = "{}/nanominer/config.ini".format(miner_path) def make_cmd(self):K return "{} {}".format(self.miner_exec_path, self.miner_config_path)/ def configure(self, gpu_info, coin="grin"):, config = configparser.ConfigParser()0 pool_password = self.pool_password or "" if coin == "grin":$ algorithm = "Cuckaroo29"! config[algorithm] = { "coin": coin,N "wallet": "{}/{}".format(self.wallet_address, self.worker_id),' "pool1": self.pool_url,D "rigName": "", # left blank for grinmint email form- "rigPassword": pool_password, } elif coin == "monero":& algorithm = "CryptoNightR"? # During Monero hardfork nanominer will auto switchN # from CryptoNightR to RandomX on CPU (GPU mining will be stopped)! config[algorithm] = { "coin": coin,. "wallet": self.wallet_address,' "pool1": self.pool_url,* "rigName": self.worker_id, }4 with open(self.miner_config_path, "w") as f: config.write(f)class TeamRedMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/teamredminer/./teamredminer".format(miner_path) self.pool_password = "******"G self.algorithms = {"monero": "cnr", "grin": "cuckarood29_grin"}! self.monero_cn_config = { "RX 570": "8+8", "RX 580": "8+8",% "Coinmine RX 580": "8+8", "Vega 56": "14*14", "Vega 64": "15*15", } def make_cmd(self):B return "{} {}".format(self.miner_exec_path, self.cmd_args)/ def configure(self, gpu_info, coin="grin"): self.cmd_args = ( "--algo={} " "--url=stratum+{} " "--user={}/{} " "--pass={} "/ "--api_listen=0.0.0.0:4028".format(& self.algorithms[coin], self.pool_url,$ self.wallet_address, self.worker_id,# self.pool_password, ) ) if coin == "monero":& cn_config = "--cn_config=" for gpu in gpu_info:@ cn_config += self.monero_cn_config[gpu["model"]]D self.cmd_args = "{} {}".format(self.cmd_args, cn_config)class HashtopolisMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/hashtopolis/hashtopolis.zip".format(miner_path)M self.config_path = "/app/minary/miner/config.json".format(miner_path) def make_cmd(self):8 return "python3 {}".format(self.miner_exec_path)2 def configure(self, gpu_info, coin="hashcat"):. with open(self.config_path, "w") as f:M json.dump({"url": self.pool_url, "token": self.pool_password}, f) def set_pool_url(self, url): self.pool_url = urlclass LolMiner(Miner):# def __init__(self, miner_path):J self.miner_exec_path = "{}/lolminer/./lolMiner".format(miner_path)L self.config_path = "{}/lolminer/user_config.json".format(miner_path) def make_cmd(self):5 return "{} --userCFG {} --profile {}".format(E self.miner_exec_path, self.config_path, self.coin_profile )/ def configure(self, gpu_info, coin="grin"): if coin == "grin": # 31) self.coin_profile = "GRIN_31"" coin_alg = "GRIN-AT31" # 29+ # self.coin_profile = "GRIN_29"$ # coin_alg = "GRIN-C29M". with open(self.config_path, "w") as f: json.dump( {E "DEFAULTS": {"DEVICES": "AUTO", "APIPORT": 8001},( self.coin_profile: {) "COIN": coin_alg," "POOLS": [ {7 "POOL": self.pool_host,< "PORT": str(self.pool_port),7 "USER": "******".format(G self.wallet_address, self.worker_id" ),; "PASS": self.pool_password,) "TLS": 1, } ], }, }, f, )class XmrigMiner(Miner):# def __init__(self, miner_path):D self.miner_exec_path = "{}/xmrig/./xmrig".format(miner_path)D self.config_path = "{}/xmrig/config.json".format(miner_path) def make_cmd(self):0 return "{}".format(self.miner_exec_path)1 def configure(self, gpu_info, coin="monero"): opencl = False if gpu_info: opencl = True config = { "http": { "enabled": True," "host": "0.0.0.0", "port": 53390,% "access-token": None,# "restricted": True, }, "autosave": True, "donate-level": 0, "cpu": True, "opencl": opencl, "cuda": False,% "rig-id" :self.worker_id, "pools": [ {% "coin": "monero",! "algo": None,) "url": self.pool_url,0 "user": self.wallet_address,/ "pass": self.pool_password,! "tls": False,& "keepalive": True,& "nicehash": False, } ], }. with open(self.config_path, "w") as f: json.dump(config, f)class SixMiner(Miner):# def __init__(self, miner_path):F self.miner_exec_path = "{}/6miner/./6miner".format(miner_path)B self.server_exec_path = "/app/minary/miner/./sixminer_api" def make_cmd(self):G return "{} {}".format(self.miner_exec_path, self.configuration)4 def configure(self, gpu_info, coin="handshake"):" algorithm = "hns/bl2bsha3" vendor = "amd" mode = "opencl" self.configuration = (. "--algo={} --url={} --user={}.{} "@ "--pass={} --opcl-vendor={} --mode={} --api".format( algorithm, self.pool_url,# self.pool_username, self.worker_id,# self.pool_password, vendor, mode, ) ) def start_http_server(self):W self.http_server_process = subprocess.Popen(shlex.split(self.server_exec_path))E logger.info("Started {} API".format(self.__class__.__name__)) def stop_http_server(self):$ if self.http_server_process:0 self.http_server_process.terminate()+ self.http_server_process.wait()I logger.info("Stopped {} API".format(self.__class__.__name__))5Б_╨V ^г;ЎїUV% "rig-id": self.worker_id,5Б_╨W ^г;ўїXZЛїXYЛїWYК5Б_╨Y ^г;∙їМimport jsonimport configparserimport subprocessimport shlex from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class Miner: def __init__(self):# self.miner_exec_path = None self.pool_url = None self.pool_host = None self.pool_port = None! self.pool_password = None! self.pool_username = None self.worker_id = None" self.wallet_address = None def make_cmd(self): pass( def configure(self, gpu_info, coin): pass* def set_wallet_address(self, address):% self.wallet_address = address def set_worker_id(self, id): self.worker_id = id def set_pool_url(self, url): if url: self.pool_url = url1 pool_split = self.pool_url.split(":")# if len(pool_split) > 2:( protocol = pool_split[0]H self.pool_host = "{}:{}".format(protocol, pool_split[1])3 self.pool_port = int(pool_split[2]) else:. self.pool_host = pool_split[0]3 self.pool_port = int(pool_split[1])* def set_pool_username(self, username):% self.pool_username = username* def set_pool_password(self, password):% self.pool_password = password def start_http_server(self): pass def stop_http_server(self): passclass ClaymoreMiner(Miner):# def __init__(self, miner_path):O self.miner_exec_path = "{}/claymore/./ethdcrminer64".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}/{}".format(address, self.worker_id) def make_cmd(self):6 return "{} -epool {} -ewal {} -mode 1".format(D self.miner_exec_path, self.pool_url, self.wallet_address )class XmrStakMiner(Miner):# def __init__(self, miner_path):J self.miner_exec_path = "{}/xmr-stak/./xmr-stak".format(miner_path)G self.amd_config_path = "{}/xmr-stak/amd.txt".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}.{}".format(address, self.worker_id)- def configure(self, gpu_info, coin=None):2 with open(self.amd_config_path, "w") as f:3 f.write(self.generate_config(gpu_info))$ def generate_config(self, gpus):S config = '"auto_tune" : 20,\n"platform_index" : 0,\n"gpu_threads_conf" : [' gpu_config = { "Coinmine RX 580": {! "intensity": 880,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "RX 580": {! "intensity": 880,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "RX 570": {! "intensity": 800,) "affine_to_cpu": "false",$ "comp_mode": "true", "worksize": 8, "unroll": 8, }, "Vega 56": {" "intensity": 1932,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 8, "unroll": 8, }, "Vega 64": {" "intensity": 1932,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 8, "unroll": 8, }, "Radeon VII": {" "intensity": 1920,) "affine_to_cpu": "false",% "comp_mode": "false", "worksize": 16, "unroll": 4, }, } adapter_num = 0 for gpu in gpus:# double_thread_gpu = """ {{ "index" : {0},( "intensity" : {1}, "worksize" : {2},@ "affine_to_cpu" : {3}, "strided_index" : 2, "mem_chunk" : 2,8 "unroll" : {4}, "comp_mode" : {5}, "interleave" : 40 }}, {{ "index" : {0},( "intensity" : {1}, "worksize" : {2},@ "affine_to_cpu" : {3}, "strided_index" : 2, "mem_chunk" : 2,8 "unroll" : {4}, "comp_mode" : {5}, "interleave" : 40 }},"""= intensity = gpu_config[gpu["model"]]["intensity"]; worksize = gpu_config[gpu["model"]]["worksize"]E affine_to_cpu = gpu_config[gpu["model"]]["affine_to_cpu"]7 unroll = gpu_config[gpu["model"]]["unroll"]= comp_mode = gpu_config[gpu["model"]]["comp_mode"]/ config += double_thread_gpu.format(R adapter_num, intensity, worksize, affine_to_cpu, unroll, comp_mode ) adapter_num += 1 # end gpus config += "],\n" return config def make_cmd(self): return (7 "{} -O {} -u {} --currency monero -i 5004 "2 '-p "" -r "" --noCPU --amd {}'.format(% self.miner_exec_path, self.pool_url,$ self.wallet_address,% self.amd_config_path, ) ) class ClaymoreZcashMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/claymore-zcash/./zecminer64".format(miner_path)* def set_wallet_address(self, address):E self.wallet_address = "{}.{}".format(address, self.worker_id) def make_cmd(self):? return "{} -zpool {} -zwal {} -zpsw z -ftime 1".format(D self.miner_exec_path, self.pool_url, self.wallet_address )class NanoMiner(Miner):# def __init__(self, miner_path):L self.miner_exec_path = "{}/nanominer/./nanominer".format(miner_path)M self.miner_config_path = "{}/nanominer/config.ini".format(miner_path) def make_cmd(self):K return "{} {}".format(self.miner_exec_path, self.miner_config_path)/ def configure(self, gpu_info, coin="grin"):, config = configparser.ConfigParser()0 pool_password = self.pool_password or "" if coin == "grin":$ algorithm = "Cuckaroo29"! config[algorithm] = { "coin": coin,N "wallet": "{}/{}".format(self.wallet_address, self.worker_id),' "pool1": self.pool_url,D "rigName": "", # left blank for grinmint email form- "rigPassword": pool_password, } elif coin == "monero":& algorithm = "CryptoNightR"? # During Monero hardfork nanominer will auto switchN # from CryptoNightR to RandomX on CPU (GPU mining will be stopped)! config[algorithm] = { "coin": coin,. "wallet": self.wallet_address,' "pool1": self.pool_url,* "rigName": self.worker_id, }4 with open(self.miner_config_path, "w") as f: config.write(f)class TeamRedMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/teamredminer/./teamredminer".format(miner_path) self.pool_password = "******"G self.algorithms = {"monero": "cnr", "grin": "cuckarood29_grin"}! self.monero_cn_config = { "RX 570": "8+8", "RX 580": "8+8",% "Coinmine RX 580": "8+8", "Vega 56": "14*14", "Vega 64": "15*15", } def make_cmd(self):B return "{} {}".format(self.miner_exec_path, self.cmd_args)/ def configure(self, gpu_info, coin="grin"): self.cmd_args = ( "--algo={} " "--url=stratum+{} " "--user={}/{} " "--pass={} "/ "--api_listen=0.0.0.0:4028".format(& self.algorithms[coin], self.pool_url,$ self.wallet_address, self.worker_id,# self.pool_password, ) ) if coin == "monero":& cn_config = "--cn_config=" for gpu in gpu_info:@ cn_config += self.monero_cn_config[gpu["model"]]D self.cmd_args = "{} {}".format(self.cmd_args, cn_config)class HashtopolisMiner(Miner):# def __init__(self, miner_path):R self.miner_exec_path = "{}/hashtopolis/hashtopolis.zip".format(miner_path)M self.config_path = "/app/minary/miner/config.json".format(miner_path) def make_cmd(self):8 return "python3 {}".format(self.miner_exec_path)2 def configure(self, gpu_info, coin="hashcat"):. with open(self.config_path, "w") as f:M json.dump({"url": self.pool_url, "token": self.pool_password}, f) def set_pool_url(self, url): self.pool_url = urlclass LolMiner(Miner):# def __init__(self, miner_path):J self.miner_exec_path = "{}/lolminer/./lolMiner".format(miner_path)L self.config_path = "{}/lolminer/user_config.json".format(miner_path) def make_cmd(self):5 return "{} --userCFG {} --profile {}".format(E self.miner_exec_path, self.config_path, self.coin_profile )/ def configure(self, gpu_info, coin="grin"): if coin == "grin": # 31) self.coin_profile = "GRIN_31"" coin_alg = "GRIN-AT31" # 29+ # self.coin_profile = "GRIN_29"$ # coin_alg = "GRIN-C29M". with open(self.config_path, "w") as f: json.dump( {E "DEFAULTS": {"DEVICES": "AUTO", "APIPORT": 8001},( self.coin_profile: {) "COIN": coin_alg," "POOLS": [ {7 "POOL": self.pool_host,< "PORT": str(self.pool_port),7 "USER": "******".format(G self.wallet_address, self.worker_id" ),; "PASS": self.pool_password,) "TLS": 1, } ], }, }, f, )class XmrigMiner(Miner):# def __init__(self, miner_path):D self.miner_exec_path = "{}/xmrig/./xmrig".format(miner_path)D self.config_path = "{}/xmrig/config.json".format(miner_path) def make_cmd(self):0 return "{}".format(self.miner_exec_path)1 def configure(self, gpu_info, coin="monero"): opencl = False if gpu_info: opencl = True config = { "http": { "enabled": True," "host": "0.0.0.0", "port": 53390,% "access-token": None,# "restricted": True, }, "autosave": True, "donate-level": 0, "cpu": True, "opencl": opencl, "cuda": False, "pools": [ {% "rig-id": self.worker_id,% "coin": "monero",! "algo": None,) "url": self.pool_url,0 "user": self.wallet_address,/ "pass": self.pool_password,! "tls": False,& "keepalive": True,& "nicehash": False, } ], }. with open(self.config_path, "w") as f: json.dump(config, f)class SixMiner(Miner):# def __init__(self, miner_path):F self.miner_exec_path = "{}/6miner/./6miner".format(miner_path)B self.server_exec_path = "/app/minary/miner/./sixminer_api" def make_cmd(self):G return "{} {}".format(self.miner_exec_path, self.configuration)4 def configure(self, gpu_info, coin="handshake"):" algorithm = "hns/bl2bsha3" vendor = "amd" mode = "opencl" self.configuration = (. "--algo={} --url={} --user={}.{} "@ "--pass={} --opcl-vendor={} --mode={} --api".format( algorithm, self.pool_url,# self.pool_username, self.worker_id,# self.pool_password, vendor, mode, ) ) def start_http_server(self):W self.http_server_process = subprocess.Popen(shlex.split(self.server_exec_path))E logger.info("Started {} API".format(self.__class__.__name__)) def stop_http_server(self):$ if self.http_server_process:0 self.http_server_process.terminate()+ self.http_server_process.wait()I logger.info("Stopped {} API".format(self.__class__.__name__))5Б_╨\ ^гK∙ї[]Л0 "user": self.wallet_address,5Б_╨C MNV^гL9їCFЛїCDЛ5Б_╨C MNV^гL:їCEН5Б_╨[ MNV^гL> їZ[- "rig-id": self.worker_id,5Б_╨^ MNV^гLHї]_Н2 "user": ""self.wallet_address,5Б_╨C V^гL%їCDЛїCDЛ* def set_wallet_address(self, address):% self.wallet_address = address5Б_╨\ ^гK·ї[]Л7 "user": "******"self.wallet_address,5Б_╨V ^г;фїUWЛ% "rig-id:" self.worker_id,5Б_╨ V ^г;█їUWМ. "api": {"worker-idself.worker_id},5Бчк
VimUnDoεhγ0βθέϊΕW w-WPy0?ΈG{L7ΎQ< "zcash": nanopool_hashrate("zec", self.address),:LLLL]9ξ�_Π����]/[ύυ υ5_Π����]/\υ {}5_Π����]/\υ hashrate = {}5_Π����]/\υ hashrate = {"ethereum"}5_Π����]/\υυ5_Π ����]/\«υ/from health_monitor.pool import HashrateGateway5_Π ����]/\«υ from health_monitor.pool import 5_Π (����]/\±υ(from health_monitor.pool import hashrate5_Π ����]/\Γυ! hashrate = {"ethereum": }5_Π 7����]/\Μυ9 hashrate = {"ethereum": nanopool_hashrate('eth')}5_Π D����]/\�υ,from health_monitor import BaseHealthChecker from utils import CoinmineLogger=from health_monitor.pool import hashrate as nanopool_hashrate!logger = CoinmineLogger(__name__)+class PoolHealthChecker(BaseHealthChecker):& def __init__(self, coin, address): self.coin = coin self.address = address def _is_healthy(self):' hashrate = self._get_hashrate() if hashrate: return True else: return False def _get_hashrate(self):G hashrate = {"ethereum": nanopool_hashrate('eth', self.address)} pass5_Π F����]/\ΪυG hashrate = {"ethereum": nanopool_hashrate("eth", self.address)}5_Π ����]/\άυυυ5_Π����22V2]/\έυ3"ethereum": nanopool_hashrate("eth", self.address)}5_Π����22V2]/\έυ7 "ethereum": nanopool_hashrate("eth", self.address)}5_Π����22V2]/\έυ; "ethereum": nanopool_hashrate("eth", self.address)}5_Π����22V2]/\ήυ? "ethereum": nanopool_hashrate("eth", self.address)}5_Π����22V2]/\ήυC "ethereum": nanopool_hashrate("eth", self.address)}5_Π����22V2]/\ΰυG "ethereum": nanopool_hashrate("eth", self.address)}5_Π4����22V2]/\δυE "monero": nanopool_hashrate("eth", self.address)}5_Π3����22V2]/\ηυυ5_Π����22V2]/\ιυE "monero": nanopool_hashrate("xmr", self.address)}5_Π����22V2]/\μυυ5_Π����22V2]/\νυE "monero": nanopool_hashrate("xmr", self.address)}5_Π3����22V2]/\ρυD "zcash": nanopool_hashrate("xmr", self.address)}5_Π2����22V2]/\χυC "grin": nanopool_hashrate("xmr", self.address)}5_ΠD����22V2]/\ύυD "zcash": nanopool_hashrate("zec", self.address)}5_ΠE����22V2]/]υE "monero": nanopool_hashrate("xmr", self.address)}5_ΠD����22V2]/]υD "grin": nanopool_hashrate("grin", self.address)}5_Π C����22V2]/]υC "grin": nanopool_hashrate("grin", self.address)5_Π! C����22V2]/]υ,from health_monitor import BaseHealthChecker from utils import CoinmineLogger=from health_monitor.pool import hashrate as nanopool_hashrate!logger = CoinmineLogger(__name__)+class PoolHealthChecker(BaseHealthChecker):& def __init__(self, coin, address): self.coin = coin self.address = address def _is_healthy(self):' hashrate = self._get_hashrate() if hashrate: return True else: return False def _get_hashrate(self):G hashrate = {"ethereum": nanopool_hashrate("eth", self.address),E "monero": nanopool_hashrate("xmr", self.address),D "zcash": nanopool_hashrate("zec", self.address),D "grin": nanopool_hashrate("grin", self.address), } pass5_Π "!����22V2]/]υ υ5_Π!#"����22V2]/] υ hashrate[]5_Π"$#����22V2]/]υ pass5_Π#%$����22V2]/]υ return hashrate[]5_Π$&% ����22V2]/]~υ=from health_monitor.pool import hashrate as nanopool_hashrate5_Π%'& ����22V2]/]~υ5from health_monitor.pool import as nanopool_hashrate5_Π&(' ����22V2]/] υ,from health_monitor import BaseHealthChecker from utils import CoinmineLogger2from health_monitor.pool import nanopool_hashrate!logger = CoinmineLogger(__name__)+class PoolHealthChecker(BaseHealthChecker):& def __init__(self, coin, address): self.coin = coin self.address = address def _is_healthy(self):' hashrate = self._get_hashrate() if hashrate: return True else: return False def _get_hashrate(self): hashrate = {? "ethereum": nanopool_hashrate("eth", self.address),= "monero": nanopool_hashrate("xmr", self.address),< "zcash": nanopool_hashrate("zec", self.address),< "grin": nanopool_hashrate("grin", self.address), }" return hashrate[self.coin]5_Π')(����22V2]/]ηυ υ5_Π(*)/����22V2]/]ϋυ0 logger.info("Pool side hashrate={}")5_Π)+*����22V2]/^υυ5_Π*,+����22V2]/^υA logger.info("Pool side hashrate={}".format(hashrate))5_Π+-,����22V2]/^ υA logger.warn("Pool side hashrate={}".format(hashrate))5_Π,.-����22V2]/^bυA logger.warn("Pool side hashrate={}".format(hashrate))5_Π-/.!����22V2]/_ϋ υ υ5_Π.0/"����22V2]/`Zυ" return hashrate[self.coin]5_Π/10����22V2]/`zυ print(hashrate)5_Π021#����22V2]/aΩυ. return hashrate[self.coin]["hashrate"]5_Π132(����22V2]/aΫυ3 return hashrate[self.coin].get()"hashrate"]5_Π2432����22V2]/aάυ2 return hashrate[self.coin].get("hashrate"]5_Π354����22V2]/erυυ5_Π465����22V2]/evυ1from health_monitor.pool import nanopool_hashrate5_Π5761����22V2]/evυ1from health_monitor.pool import nanopool_hashrate5_Π687����22V2]/e|υ< "grin": nanopool_hashrate("grin", self.address),5_Π798����]/l υ υ5_Π8:9 $����]/lυ & def __init__(self, coin, address):5_Π9;:����]/{υJ logger.warn("Warning! Pool side hashrate={}".format(hashrate))5_Π:<;!����]/{υK logger.error("Warning! Pool side hashrate={}".format(hashrate))5_Π;><!����]/{υJ logger.error("Warnin! Pool side hashrate={}".format(hashrate))5_Π<?=>����]/{2υ υ5_Π>@?����]/{:υ return False5_Π?A@����]/{;υ return True5_Π@BA.����]/Eυ< "grin": grinmint_hashrate("grin", self.address),5_ΠACB2����]/Iυ4 "grin": grinmint_hashrate(self.address),5_ΠBDC����]/Nυ υ5_ΠCED ����]/Pυ self.uuid5_ΠDFE ����]/Tυ self.uuid = uuid5_ΠEGF ����]/Wυ self.short_uuid = uuid5_ΠFHG %����]/Zυ 6 def __init__(self, coin, address, remedy_command):5_ΠGIH 0����]/]υ A def __init__(self, coin, address, short_uuid remedy_command):5_ΠHJI9����]/ύυ? "grin": grinmint_hashrate(self.address, self.uuid),5_ΠIKJ=����]9ξ€υ? "ethereum": nanopool_hashrate("eth", self.address),5_ΠJLK;����]9ξ¬υ= "monero": nanopool_hashrate("xmr", self.address),5_ΠKL:����]9ξυ< "zcash": nanopool_hashrate("zec", self.address),5_Π<>=����]/{*υ5_Π ����]/\Ωυ hashrate = {5ηͺ
Vim�UnDo����}}"'�q��K�j�[|u��!Km/�|φ��! logger.info(response)<2222^{_�9����996v6]�8:�8 time.sleep(0.03333 - (self.start - time.time()))5�_�8����996v6]�8:� �9:��8:�5�_�:����::6v6]�9;� time.sleep()5�_�9����::6v6]�9;� �9;�5�_�:&����;;6v6]�9;�' logger.debug("sleeping for {}")5�_�1����;;6v6]���13��12�5�_�2����<<6v6]���13�: logger.debug("sleeping for {}".format(sleep_time))5�_� 2����<<6v6]���13� logger.debug("))5�_� 2����<<6v6]���13� logger.debug("")5�_� A����<<6v6]���BD��BC��AC�5�_� C����<<6v6]��BD�. logger.debug("running animation step")5�_� C����<<6v6]��BD� logger.debug("")5�_� C����<<6v6]��BD�; logger.debug("updating state of ambiance from api")5�_� C,����<<6v6]��BD�I logger.debug("attempting to updating state of ambiance from api")5�_�D)����<<6v6]��DF��DE�5�_�E����EEV]��DF�G logger.debug("attempting to update state of ambiance from api")5�_�E����EEV]��DF�K logger.debug("attempting to update state of ambiance from api")5�_�E����EEV]��DF� logger.debug("")5�_�EB����EEV]�'�DF�C logger.debug("accumulated seconds waiting reacher 10s")5�_�EA����EEV]�/�DF�b logger.debug("accumulated seconds waiting reacher 10s".format(self.accum_ten_seconds))5�_�CD����EEV]�6�BD�G logger.debug("attempting to update state of ambiance from api")�CD�5�_�Co����EEV]�<�BD�q logger.debug("attempting to update state of ambiance from api timer={}".format(self.accum_ten_seconds))")5�_�Cn����EEV]�<��import timeUfrom thunder_and_lightning.animations import WifiSearch, WifiFound, Mining, PowerDown from utils import CoinmineLogger+from utils.requests import CoinmineRequests!logger = CoinmineLogger(__name__)class AmbianceController: def __init__( self, teensy_interface, state_json,# minary_ambiance_server_url, animation_queue, num_led=10, ): self.state = None% self.last_state_json = dict()$ self.state_json = state_json self.num_led = num_led$ self.ambiance_enabled = True0 self.teensy_interface = teensy_interfaceD self.minary_ambiance_server_url = minary_ambiance_server_url" self.accum_ten_seconds = 0. self.animation_queue = animation_queue def turn_lights_off(self): self.state.reset()= self.teensy_interface.set_lights(self.state.render())% def run_poweroff_animation(self):! if self.ambiance_enabled:9 if self.teensy_interface.serial_port.is_open:9 self.teensy_interface.serial_port.close()8 self.teensy_interface.serial_port.open()1 self.run_state_animation(PowerDown())" self.turn_lights_off()) def run_state_animation(self, state): self.state = state while True: if self.state.done: return4 self._play_audio_and_animate_one_frame()! def run_animation_step(self):. logger.debug("running animation step") self._start_timer()! self._update_state_json()% self._set_prioritized_state() if self.state:4 self._play_audio_and_animate_one_frame()) self.accum_ten_seconds += 0.033339 sleep_time = 0.03333 - (self.start - time.time()): logger.debug("sleeping for {}".format(sleep_time)) time.sleep(sleep_time) def _start_timer(self): self.start = time.time()! def _update_state_json(self):o logger.debug("attempting to update state of ambiance from api timer={}".format(self.accum_ten_seconds))* if self.accum_ten_seconds >= 10.0:k logger.debug("accumulated seconds waiting reacher 10s timer={}".format(self.accum_ten_seconds))& self.accum_ten_seconds = 03 self.state_json = CoinmineRequests.get(8 self.minary_ambiance_server_url, "state" )K self.ambiance_enabled = self.state_json.get("ambiance_enabled")% def _set_prioritized_state(self):9 if not (self.state_json == self.last_state_json): updated = set( [ item[0]< for item in set(self.state_json.items())7 ^ set(self.last_state_json.items()) ] )? logger.info("full_status diff: {}".format(updated)) field = "none" queue_list = []O if "wifi_search" in updated and self.state_json.get("wifi_search"):% field = "wifi_search"4 queue_list.append((0, WifiSearch()))M if "wifi_found" in updated and self.state_json.get("wifi_found"):$ field = "wifi_found"3 queue_list.append((0, WifiFound()))A if "coin" in updated and self.state_json.get("coin"): field = "coin"G queue_list.append((1, Mining(self.state_json["coin"])))M if "power_down" in updated and self.state_json.get("power_down"):$ field = "power_down"3 queue_list.append((0, PowerDown())); self.animation_queue.set_animations(queue_list)F next_animation = self.animation_queue.get_next_animation() if next_animation:+ self.state = next_animation logger.info(8 "triggering {} switch: {} -> {}".format(2 self.state.__class__.__name__,< self.last_state_json.get(field, "none"),/ self.state_json.get(field), ) )2 self.last_state_json = self.state_json0 def _play_audio_and_animate_one_frame(self):! if self.ambiance_enabled:, if hasattr(self.state, "index"):) if self.state.index == 0:( if self.state.sound:J self.teensy_interface.play_audio(self.state.sound)% elif self.state.done:& self.state.reset()! self.state.step()E self.teensy_interface.set_lights(self.state.render()) else:2 logger.debug("skipping animation") else:" self.turn_lights_off()5�_�5����V]�F�57�5�_�7����V]�G�79� �79�5�_�8$����V]�V�79�& logger.debug("new state=")5�_�8&����V]�X�79�) logger.debug("new state={]}")5�_�8'����V]�X�79�( logger.debug("new state={}")5�_�8����V]�e�79�; logger.debug("new state={}".format(self.state))5�_�!8����V]���79�7 logger.debug("state={}".format(self.state))5�_�" !6����V]���69��67�5�_�!#"7����V]���67 if self.state:5�_�"$#7����77V]���68�? logger.debug("setting state={}".format(self.state))5�_�#%$7����77V]���68�; logger.debug("setting state={}".format(self.state))5�_�$&%L����LP V]��#�KL logger.debug(J "accumulated seconds waiting reacher 10s timer={}".format(* self.accum_ten_seconds ) )5�_�%'&F����JFV]��%�EF logger.debug(N "attempting to update state of ambiance from api timer={}".format(& self.accum_ten_seconds ) )5�_�&('E����FFV]��(�DE5�_�')(>����EEV]�� �=>: logger.debug("sleeping for {}".format(sleep_time))5�_�(*)7����DDV]��(�673 logger.debug("state={}".format(self.state))5�_�)+*2����CCV]���12. logger.debug("running animation step")5�_�*,+7����BBV]���67? logger.debug("setting state={}".format(self.state))5�_�+-,:����^z��;=��;<��:<�5�_�,.-<����<<V^z��;=�! logger.info(response)5�_�-/.<����<<V^z��;=� logger.info(response)5�_�.0/<����<<V^z��;=� logger.info()5�_�/10<����<<V^z��;=� logger.info(sleep_timee)5�_�021<����<<V^z��;=� logger.info(sleep_time)5�_�12<7����<<V^z��;=�7 logger.info("sleep time: {}".format(sleep_time)5�_�! 6����V]���67��67� if self.state:? logger.debug("setting state={}".format(self.state))5�_�EA����EEV]�5�DF�A logger.debug("accumulated seconds waiting reacher 10s5��
Vim�UnDo��U�'�������(Ɣ��j��^��DX amdgpu_info, amdgpu_remedy_cmd, mem_clock_threshold, admin_api_url, miner_status52 \��_�-����\���!>� >5�_� ����\���!?K mem_clock_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_THRESHOLD"])5�_�����\��� ?K mem_clock_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_THRESHOLD"])5�_�C����\��� ?O mem_clock_low_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_THRESHOLD"])5�_� D����\���!?P mem_clock_high_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_THRESHOLD"])5�_�52����\���46?X amdgpu_info, amdgpu_remedy_cmd, mem_clock_threshold, admin_api_url, miner_status5�_� 5@����5'5?v?\���46?\ amdgpu_info, amdgpu_remedy_cmd, mem_clock_low_threshold, admin_api_url, miner_status�56?5�_� 5O����5'5?v?\���46?u amdgpu_info, amdgpu_remedy_cmd, mem_clock_low_threshold, mem_clock_low_threshold,admin_api_url, miner_status5�_� 5O����5'5?v?\���? import os/from utils import CoinmineLogger, SystemHelpers+from utils.requests import CoinmineRequestsXfrom health_monitor.docker import MinaryDocker, MinaryDockerCompose, DockerHealthChecker@from health_monitor.miner import AMDGPUHealthChecker, AMDGPUInfo5from health_monitor.system import SystemHealthChecker!logger = CoinmineLogger(__name__)if __name__ == "__main__":3 logger.info("Starting Coinmine Health Monitor") # Docker" minary_docker = MinaryDocker()% minary_docker.initialize_client()< compose_filename = os.environ["MINARY_COMPOSE_FILENAME"]A minary_docker_compose = MinaryDockerCompose(compose_filename): docker_remedy_cmd = "systemctl restart minary-compose"0 docker_health_checker = DockerHealthChecker(? minary_docker, minary_docker_compose, docker_remedy_cmd )! docker_health_checker.check() # AMDGPU: amdgpu_info_path = os.environ["MINARY_AMDGPU_PM_INFO"]S mem_clock_low_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_LOW_THRESHOLD"])U mem_clock_high_threshold = int(os.environ["MINARY_AMDGPU_MEMCLK_HIGH_THRESHOLD"])? minary_api_server_url = os.environ["MINARY_API_SERVER_URL"]$ amdgpu_remedy_cmd = "hardreboot" # wait for minary_api_server logger.info(3 "wait for minary_api_server: {}/{}".format(1 minary_api_server_url, "miner_status" ) )& SystemHelpers.wait_for_connection(R lambda: (CoinmineRequests.test_get(minary_api_server_url, "miner_status")) )N miner_status = CoinmineRequests.get(minary_api_server_url, "miner_status")# coin = miner_status.get("coin")X admin_api_url = CoinmineRequests.get(minary_api_server_url, "config").get("api_url")T num_of_gpus = CoinmineRequests.sanitize_redis_value(miner_status, "num_of_gpus"); amdgpu_info = AMDGPUInfo(amdgpu_info_path, num_of_gpus)0 amdgpu_health_checker = AMDGPUHealthChecker(v amdgpu_info, amdgpu_remedy_cmd, mem_clock_low_threshold, mem_clock_high_threshold,admin_api_url, miner_status )! amdgpu_health_checker.check() # SystemN mem_percent_threshold = int(os.environ["MINARY_MEMORY_PERCENT_THRESHOLD"])$ system_remedy_cmd = "hardreboot"0 system_health_checker = SystemHealthChecker(> miner_status, mem_percent_threshold, system_remedy_cmd )! system_health_checker.check()5�_� ����\���!?J mem_clock_threshol = int(os.environ["MINARY_AMDGPU_MEMCLK_THRESHOLD"])5��
VimUnDoון0l�Bg� :jw÷ר��[£b Q³°�± ?F logger.info("could not humanize wifi scan e={}".format(e))*5!!!!\�ל_�����\��gץ:T logger.info("scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�'����\��mץ:c logger.info("scanning wifi" scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�)����\��oץ:d logger.info("scanning wifi", scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�*����\��qץ:e logger.info("scanning wifi", {scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�6����\��sץ:f logger.info("scanning wifi", {"scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�7����\��tץ:g logger.info("scanning wifi", {"scan_number"={} scan={}".format(scan_count, self.wifi_scan))5_�8����\��uץ:d logger.info("scanning wifi", {"scan_number" scan={}".format(scan_count, self.wifi_scan))5_� 7����\��xץ:d logger.info("scanning wifi", {"scan_number" scan={}".format(scan_count, self.wifi_scan))5_� C����\��zץ:p logger.info("scanning wifi", {"scan_number": scan_count scan={}".format(scan_count, self.wifi_scan))5_� E����\��~ץ:q logger.info("scanning wifi", {"scan_number": scan_count, scan={}".format(scan_count, self.wifi_scan))5_� J����\��ץ:r logger.info("scanning wifi", {"scan_number": scan_count, "scan={}".format(scan_count, self.wifi_scan))5_� K����\��ץ:s logger.info("scanning wifi", {"scan_number": scan_count, "scan"={}".format(scan_count, self.wifi_scan))5_� K����\��ץ:h logger.info("scanning wifi", {"scan_number": scan_count, "scan"(scan_count, self.wifi_scan))5_� L����\��ץ:\ logger.info("scanning wifi", {"scan_number": scan_count, "scan" self.wifi_scan))5_�[����\��ץ:\ logger.info("scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan)5_�[����\��ץ:from time import sleep from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class Scanner: def __init__(self, netman): self.wifi_scan = {} self.netman = netman def scan_wifi(self):- logger.info("starting wifi scanning") scan_count = 03 self.wifi_scan = self._humanize_wifi_scan()! while not self.wifi_scan:] logger.info("scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}) scan_count += 1 sleep(0.5)7 self.wifi_scan = self._humanize_wifi_scan()P logger.info("scan_number={} scan={}".format(scan_count, self.wifi_scan)) # Helper methods" def _humanize_wifi_scan(self): try: wifi_list = []P wlan_device = self.netman.NetworkManager.GetDeviceByIpIface("wlan0")4 for ap in wlan_device.GetAccessPoints():L wifi_list.append({"ssid": ap.Ssid, "strength": ap.Strength}) wifi_list.reverse(); logger.info("successfully humanized wifi scan")7 return Scanner._merge_like_ssids(wifi_list) except Exception as e:F logger.info("could not humanize wifi scan e={}".format(e)) raise e @staticmethod% def _merge_like_ssids(wifi_list): new_wifi_list = []+ strength_sorted_wifi_scan = sorted(@ wifi_list, key=lambda k: k["strength"], reverse=True ). for wifi in strength_sorted_wifi_scan:) if wifi not in new_wifi_list:X duplicate_ssid = Scanner._find_dict_in_list(new_wifi_list, wifi["ssid"]) if (* duplicate_ssid is NoneD or duplicate_ssid["strength"] < wifi["strength"] ):. new_wifi_list.append(wifi) return new_wifi_list @staticmethod* def _find_dict_in_list(my_list, ssid):M return next((item for item in my_list if item["ssid"] == ssid), None)5_�����\��§ץ<ץ<5_�����\��×ץ=P logger.info("scan_number={} scan={}".format(scan_count, self.wifi_scan))5_�����\��×ץ= logger.info(T "scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}5_�����\��«ץ<Y logger.info( "scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}5_�����\��¬ץ<X logger.info("scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}5_�a����\��·ץ<a logger.info("finished scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}5_�a����\��¸ץ<from time import sleep from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class Scanner: def __init__(self, netman): self.wifi_scan = {} self.netman = netman def scan_wifi(self):- logger.info("starting wifi scanning") scan_count = 03 self.wifi_scan = self._humanize_wifi_scan()! while not self.wifi_scan: logger.info(T "scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan} ) scan_count += 1 sleep(0.5)7 self.wifi_scan = self._humanize_wifi_scan()b logger.info("finished scanning wifi", {"scan_number": scan_count, "scan": self.wifi_scan}) # Helper methods" def _humanize_wifi_scan(self): try: wifi_list = []P wlan_device = self.netman.NetworkManager.GetDeviceByIpIface("wlan0")4 for ap in wlan_device.GetAccessPoints():L wifi_list.append({"ssid": ap.Ssid, "strength": ap.Strength}) wifi_list.reverse(); logger.info("successfully humanized wifi scan")7 return Scanner._merge_like_ssids(wifi_list) except Exception as e:F logger.info("could not humanize wifi scan e={}".format(e)) raise e @staticmethod% def _merge_like_ssids(wifi_list): new_wifi_list = []+ strength_sorted_wifi_scan = sorted(@ wifi_list, key=lambda k: k["strength"], reverse=True ). for wifi in strength_sorted_wifi_scan:) if wifi not in new_wifi_list:X duplicate_ssid = Scanner._find_dict_in_list(new_wifi_list, wifi["ssid"]) if (* duplicate_ssid is NoneD or duplicate_ssid["strength"] < wifi["strength"] ):. new_wifi_list.append(wifi) return new_wifi_list @staticmethod* def _find_dict_in_list(my_list, ssid):M return next((item for item in my_list if item["ssid"] == ssid), None)5_�*5����\���ץ)+?F logger.info("could not humanize wifi scan e={}".format(e))5_�*5����\���ץ)+?5 logger.info("could not humanize wifi scan5_�*8����\���ץ)+?: logger.info("could not humanize wifi scan", ""5_�*:����\���ץ)+?< logger.info("could not humanize wifi scan", {}""5_�*:����\���ץ)+?; logger.info("could not humanize wifi scan", {""5_�*@����\���ץ)+?@ logger.info("could not humanize wifi scan", {"error"5_� *F����\���ץ)+?F logger.info("could not humanize wifi scan", {"error": e}))5_�! *A����\�לץ)+?E logger.info("could not humanize wifi scan", {"error": e})ץ*+?5_� !*G����\�לץ)+?I logger.info("could not humanize wifi scan", {"error": str(e})5_�����\���ץ5ח×
Vim�UnDo�gN|��{|7�N$D�.�N[��$g_6�d F�FI,]B,�_�����]$�<�1 �05�_�����]$�R�2 logger.warn)5�_�6����]$�`�3 �25�_�@����]@z��3@from thunder_and_lightning.controllers import AmbianceController5�_�+U����]@z��*,3V ambiance = AmbianceController(teensy_interface, state, minary_ambiance_server_url)5�_�*D����]@z��*,4 �*,35�_�+"����]@z��4 import os import sysPfrom thunder_and_lightning.controllers import AmbianceController, AnimationQueue<from thunder_and_lightning.interfaces import TeensyInterface5from thunder_and_lightning.helpers import SerialUtils<from utils import SystemHelpers, CoinmineLogger, sentry_init+from utils.requests import CoinmineRequests sentry_init()if __name__ == "__main__":% logger = CoinmineLogger(__name__)5 script_path = os.environ["MINARY_TL_SCRIPT_PATH"]I minary_ambiance_server_url = os.environ["MINARY_AMBIANCE_SERVER_URL"]2 logger.info("Starting Light and Sound Worker")6 # Open the connection to the Lights & Sound Device% # and check that it is up to date/ teensy_path = SerialUtils.get_teensy_port() if not teensy_path:9 logger.warn("No teensy device detected! Exiting") sys.exit(1)@ teensy_interface = TeensyInterface(teensy_path, script_path)& teensy_interface.set_serial_port()? if teensy_interface.update_firmware_if_version_different():3 teensy_path = SerialUtils.get_teensy_port()D teensy_interface = TeensyInterface(teensy_path, script_path)* teensy_interface.set_serial_port()0 fw_hash = teensy_interface.get_version()K logger.info("Light & Sound updated to firmware {}".format(fw_hash))3 teensy_interface.flash_audio_files_if_changed() logger.info(S "waiting for connection: {}/{}".format(minary_ambiance_server_url, "state") )& SystemHelpers.wait_for_connection(N lambda: CoinmineRequests.test_get(minary_ambiance_server_url, "state") )E state = CoinmineRequests.get(minary_ambiance_server_url, "state")# animation_queue= AnimationQueueg ambiance = AmbianceController(teensy_interface, state, minary_ambiance_server_url, animation_queue) try: while True:) ambiance.run_animation_step() except Exception as e:L logger.error("Could not run light and sound service e={}".format(e)) sys.exit(1)5�_� +$����]@���*,6$ animation_queue = AnimationQueue5�_� 2����]@�M�247 �2465�_� ����]@�T�8�75�_� 4����]@���34 time.sleep(5)5�_� ����0v]@�o �import time5�_� ���� V]B,\�6 # Open the connection to the Lights & Sound Device% # and check that it is up to date/ teensy_path = SerialUtils.get_teensy_port() if not teensy_path:9 logger.warn("No teensy device detected! Exiting") sys.exit(1)@ teensy_interface = TeensyInterface(teensy_path, script_path)& teensy_interface.set_serial_port()? if teensy_interface.update_firmware_if_version_different():3 teensy_path = SerialUtils.get_teensy_port()D teensy_interface = TeensyInterface(teensy_path, script_path)* teensy_interface.set_serial_port()0 fw_hash = teensy_interface.get_version()K logger.info("Light & Sound updated to firmware {}".format(fw_hash))5�_� ����V]B,\�3 teensy_interface.flash_audio_files_if_changed()5�_�����V]B,]�5�_�����V]B,a�<from thunder_and_lightning.interfaces import TeensyInterface5from thunder_and_lightning.helpers import SerialUtils5�_�����V]B,��5 script_path = os.environ["MINARY_TL_SCRIPT_PATH"]5�_� ����V]B,� � "� "5�_�����V]B,�� 5 script_path = os.environ["MINARY_TL_SCRIPT_PATH"]5�_�����V]B,��*� *5�_�����V]B,��+5�_�����V]B,��6 # Open the connection to the Lights & Sound Device% # and check that it is up to date5�_�����V]B,��*�*5�_�����V]B,��5from thunder_and_lightning.helpers import SerialUtils5�_�����V]B,��*�*5�_�����V]B,��+�+5��
Vim�UnDo��_�y�R(�=?4�`��,�cf��j�u�l����1C logger.info("amdgpu info={}".format(all_info[gpu_num]))\��<_�����\����15�_�����\����3Q mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[�3 �25�_�P����\����2Q mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[5�_�R����\����1R mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[ 5�_�P����\����1Q mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[ 05�_�R����\����0S mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[ 05�_�����\����1import subprocessimport shlex import re from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class AMDGPUInfo:) def __init__(self, cmd, num_of_gpus):' self.cmd = "cat {}".format(cmd)& self.num_of_gpus = num_of_gpus def get_all_info(self): all_info = {}6 for adapter_num in range(0, self.num_of_gpus):2 gpu_num = "GPU {}".format(adapter_num)K all_info[gpu_num] = AMDGPUInfo._get_info(self.cmd, adapter_num)C logger.info("amdgpu info={}".format(all_info[gpu_num])) return all_info @staticmethod$ def _get_info(cmd, adapter_num):B full_cmd = "{}/{}/amdgpu_pm_info".format(cmd, adapter_num)Q raw_info = subprocess.check_output(shlex.split(full_cmd)).decode("utf-8")Q mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[ 0 ].strip()R core_clock = re.findall(r"^(.*)\sMHz\s\(SCLK\)$", raw_info, re.MULTILINE)[ 0 ].strip()V vdd = re.findall(r"^(.*)\smV\s\(VDDGFX\)$", raw_info, re.MULTILINE)[0].strip()W avg_watts = re.findall(r"^(.*)\sW\s\(average\sGPU\)$", raw_info, re.MULTILINE)[ 0 ].strip()R temp = re.findall(r"^GPU\sTemperature\:(.*)\sC$", raw_info, re.MULTILINE)[ 0 ].strip() return {( "MEM_CLOCK": int(mem_clock),* "CORE_CLOCK": int(core_clock), "VDD": int(vdd),* "AVG_WATTS": float(avg_watts), "TEMP": int(temp), }5�_� ����\����1 0 ].strip()5�_� ����\����0 0 ].strip()5�_� ����\����0import subprocessimport shlex import re from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class AMDGPUInfo:) def __init__(self, cmd, num_of_gpus):' self.cmd = "cat {}".format(cmd)& self.num_of_gpus = num_of_gpus def get_all_info(self): all_info = {}6 for adapter_num in range(0, self.num_of_gpus):2 gpu_num = "GPU {}".format(adapter_num)K all_info[gpu_num] = AMDGPUInfo._get_info(self.cmd, adapter_num)C logger.info("amdgpu info={}".format(all_info[gpu_num])) return all_info @staticmethod$ def _get_info(cmd, adapter_num):B full_cmd = "{}/{}/amdgpu_pm_info".format(cmd, adapter_num)Q raw_info = subprocess.check_output(shlex.split(full_cmd)).decode("utf-8")Q mem_clock = re.findall(r"^(.*)\sMHz\s\(MCLK\)$", raw_info, re.MULTILINE)[ 0].strip()R core_clock = re.findall(r"^(.*)\sMHz\s\(SCLK\)$", raw_info, re.MULTILINE)[ 0 ].strip()V vdd = re.findall(r"^(.*)\smV\s\(VDDGFX\)$", raw_info, re.MULTILINE)[0].strip()W avg_watts = re.findall(r"^(.*)\sW\s\(average\sGPU\)$", raw_info, re.MULTILINE)[ 0 ].strip()R temp = re.findall(r"^GPU\sTemperature\:(.*)\sC$", raw_info, re.MULTILINE)[ 0 ].strip() return {( "MEM_CLOCK": int(mem_clock),* "CORE_CLOCK": int(core_clock), "VDD": int(vdd),* "AVG_WATTS": float(avg_watts), "TEMP": int(temp), }5�_� ����\��!�1C logger.info("amdgpu info={}".format(all_info[gpu_num]))5�_�/����\��&�1M logger.info("collected amdgpu info={}".format(all_info[gpu_num]))5�_� 0����\��7�1O logger.info("collected amdgpu info", {}".format(all_info[gpu_num]))5�_�0����\��8�1F logger.info("collected amdgpu info",at(all_info[gpu_num]))5�_�0����\��9�1C logger.info("collected amdgpu info",all_info[gpu_num]))5�_�D����\��;�1D logger.info("collected amdgpu info", all_info[gpu_num]))5�_� 0����\��3�1; logger.info("collected amdgpu info",[gpu_num]))5��
Vim�UnDo�WR ��4�^d�Y�l�k���z���WNt�9&7 mods = amdgpu_mod_factory.get_mod_list(FEFF\�Y_� ����\��C�(* def mod_gpus(self, overclocked=False):5�_� ����\��F�(. def mod_amd_gpus(self, overclocked=False):5�_�%����\��J�$&( def _mod_gpu(self, mods):5�_�%����\��O�$&( def _run_gpu(self, mods):5�_�����\��b�(# self._mod.gpu(mods)5�_� ����\��h�(( self._rub_cnds.gpu(mods)5�_� +����\����(- def mod_amdgpus(self, overclocked=False):5�_� ����\���( overclocked,5�_� ����\���(+ amdgpu_ind[overclocked,5�_� ����\�� �(, amdgpu_info[overclocked,5�_� ,����\���(- amdgpu_info["overclocked,5�_�����\���(/ amdgpu_info["overclocked"],5�_�����%v%\���(! memory_clock,�(5�_�����\��4�(" memory_voltage,�(�(# memory_voltage,% memory_dpm_level, core_clock,! core_voltage,# core_dpm_level, fan_percent,5�_�3����$\��8�(4 self.amdgpu_info["memory_voltage,5�_�4����$\��9�(5 self.amdgpu_info["memory_voltage=,5�_�2����$\��D�(3 self.amdgpu_info["memory_clock,5�_�4����$\��H�(5 self.amdgpu_info["memory_voltage],5�_�5����$\��L�(6 self.amdgpu_info["memory_dpm_level,5�_�/����$\��O�(0 self.amdgpu_info["core_clock,5�_� 1����$\��Q�(2 self.amdgpu_info["core_voltage,5�_�" 3����$\��R�(4 self.amdgpu_info["core_dpm_level,5�_� #!"0����$\��T�(1 self.amdgpu_info["fan_percent,5�_�"$#����$\��W�(import subprocess from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class OverclockController:8 def __init__(self, amdgpu_info, amdgpu_mod_factory):& self.amdgpu_info = amdgpu_info4 self.amdgpu_mod_factory = amdgpu_mod_factory def mod_amdgpus(self): if self.amdgpu_info: adapter_num = 0- for gpu_info in self.amdgpu_info:< mods = self.amdgpu_mod_factory.get_mod_list( adapter_num,4 self.amdgpu_info["overclocked"],5 self.amdgpu_info["memory_clock"],6 self.amdgpu_info["memory_voltage"],8 self.amdgpu_info["memory_dpm_level"],2 self.amdgpu_info["core_clock"],4 self.amdgpu_info["core_voltage"],6 self.amdgpu_info["core_dpm_level"],3 self.amdgpu_info["fan_percent"], )( self._run_cmds.gpu(mods) logger.info(E "modified amd adapter_num={} gpu_info={}".format(- adapter_num, gpu_info ) ) adapter_num += 1 def _run_cmds(self, mods): for mod in mods:+ subprocess.run(mod, shell=True)5 logger.info("running mod={}".format(mod))5�_�#%$%����$\��x�$&( def _run_cmds(self, mods):5�_�$&%%����$\��y�$&( def _run_cmds(smods):5�_�%'&$����$\��z�$&)�$&(5�_�&('%����$\����$&) @staticmethid5�_�')()!����$\����(5 logger.info("running mod={}".format(mod))5�_�(*)����((V(\����) adapter_num,5�_�)+*$����((V(\����)0 self.amdgpu_infoadapter_num,5�_�*,+1����((V(\����)2 self.amdgpu_info["adapter_num,5�_�+-,����((V(\���� adapter_num = 05�_�,.-"����((V(\����!" adapter_num += 15�_�-/.����((V(\���� '- adapter_num, gpu_info5�_�.0/(����((V(\��� � '2 self.adapter_num, gpu_info5�_�/10 ����((V(\�� �' def mod_amdgpus(self):5�_�021 "����((V(\�-� '8 def __init__(self, amdgpu_info, amdgpu_mod_factory):5�_�132 $����((V(\�4� ': def __init__(self, amdgpu_info{}, amdgpu_mod_factory):5�_�243 9����((V(\�=� '; def __init__(self, amdgpu_info=[], amdgpu_mod_factory):5�_�354���� v\�� 'class OverclockController:5�_�465 ���� v\�)�' def mod_gpus(self):5�_�576!���� v\�2�'- for gpu_info in self.amdgpu_info:5�_�687 ���� v\�4� & self.amdgpu_info = amdgpu_info5�_�798 ���� v\�8� &@ def __init__(self, amdgpu_info=[], amdgpu_mod_factory=None):5�_�8:9 ���� v\�9 �&import subprocess from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class GPUModController:1 def __init__(self, amdgpu_mod_factory=None):4 self.amdgpu_mod_factory = amdgpu_mod_factory$ def mod_gpus(self, amdgpu_info): if self.amdgpu_info:( for gpu_info in amdgpu_info:< mods = self.amdgpu_mod_factory.get_mod_list(4 self.amdgpu_info["adapter_num"],4 self.amdgpu_info["overclocked"],5 self.amdgpu_info["memory_clock"],7 self.amdgpu_info["memory_voltage"],9 self.amdgpu_info["memory_dpm_level"],3 self.amdgpu_info["core_clock"],5 self.amdgpu_info["core_voltage"],7 self.amdgpu_info["core_dpm_level"],4 self.amdgpu_info["fan_percent"], )( self._run_cmds.gpu(mods) logger.info(E "modified amd adapter_num={} gpu_info={}".format(A self.amdgpu_info["adapter_num"], gpu_info ) ) @staticmethod def _run_cmds(mods): for mod in mods:+ subprocess.run(mod, shell=True)= logger.info("running cmd for mod={}".format(mod))5�_�9;:���� v\�=�&< mods = self.amdgpu_mod_factory.get_mod_list(5�_�:<;���� v\�?�&4 self.amdgpu_info["adapter_num"],5�_�;=<���� v\�?�&4 self.amdgpu_info["overclocked"],5�_�<>=����
Vim�UnDo��8�o� ϖ�(����6��_v�8���,�(+9 logger.warn("No teensy device detected! Exiting")^q8�_�����^q8��+9 logger.warn("No teensy device detected! Exiting")5�_� =����++v]���+@ minary_ambiance_server_url = os.environ["MINARY_SERVER_URL"]5�_� 4����++v]���+D minary_ambiance_server_url = os.environ["MINARY_API_SERVER_URL"]5�_� ����++v]���+? minary_api_server_url = os.environ["MINARY_API_SERVER_URL"]5�_�>����++v]���+N "waiting for connection: {}/{}".format(minary_api_server_url, "state")5�_�9����++v]���+I lambda: CoinmineRequests.test_get(minary_api_server_url, "state")5�_�0����++v]��� +@ state = CoinmineRequests.get(minary_api_server_url, "state")5�_� "0����++v]���!#+G teensy_interface, state, minary_api_server_url, animation_queue5�_� "*����v]� �,) import os import sysDfrom thunder_and_lightning.utils import SerialUtils, TeensyInterfacePfrom thunder_and_lightning.controllers import AmbianceController, AnimationQueue<from utils import SystemHelpers, CoinmineLogger, sentry_init+from utils.requests import CoinmineRequests sentry_init()if __name__ == "__main__":% logger = CoinmineLogger(__name__)? minary_api_server_url = os.environ["MINARY_API_SERVER_URL"]5 script_path = os.environ["MINARY_TL_SCRIPT_PATH"]2 logger.info("Starting Light and Sound Worker")/ teensy_path = SerialUtils.get_teensy_port() if not teensy_path:9 logger.warn("No teensy device detected! Exiting") sys.exit(1)@ teensy_interface = TeensyInterface(teensy_path, script_path)& teensy_interface.set_serial_port()W logger.info("waiting for connection: {}/{}".format(minary_api_server_url, "state"))& SystemHelpers.wait_for_connection(I lambda: CoinmineRequests.test_get(minary_api_server_url, "state") )@ state = CoinmineRequests.get(minary_api_server_url, "state")& animation_queue = AnimationQueue()" ambiance = AmbianceController(G teensy_interface, state, minary_api_server_url, animation_queue ) try: while True:) ambiance.run_animation_step() except Exception as e:L logger.error("Could not run light and sound service e={}".format(e)) sys.exit(1)5�_� >����v]�"��)G state = CoinmineRequests.get(minary_api_server_url, "miner_status")5�_� G����v]�"��)P lambda: CoinmineRequests.test_get(minary_api_server_url, "miner_status")5��
Vim�UnDo�Tf����T��0����2�Q��% <1�<��(2LLLL\�m�_�����\���<<<<<<< Updated upstream5�_�����V\���=======) for amd_gpu in self.amd_gpus:K self.overclock_factory.run_cmds(coin, amd_gpu, adapter_num)5�_�����V\���>>>>>>> Stashed changes5�_�����"V\�Er�3 elif self.amd_gpu_info and not overclocked: adapter_num = 0. for gpu_info in self.amd_gpu_info:9 AMD_RX500.set_default_clocks(adapter_num)J AMD_RX500.set_fan(adapter_num, self.overclock_factory.fan) logger.info(- "default clocks set for "N "adapter_num={} gpu_info={}".format(adapter_num, gpu_info) ) adapter_num += 15�_� ����V\�Ew�- if self.amd_gpu_info and overclocked:5�_� ���� v\�E��J AMD_RX500.set_fan(adapter_num, self.overclock_factory.fan)5�_� 0���� v\�F0�X self.overclock_factory.run_cmds(coin, gpu_info["amd_type"], adapter_num)5�_����� v\�ߢ� from utils import CoinmineLogger"from overclockers import AMD_RX500!logger = CoinmineLogger(__name__)class OverclockController:8 def __init__(self, amd_gpu_info, overclock_factory):( self.amd_gpu_info = amd_gpu_info2 self.overclock_factory = overclock_factory6 def overclock_gpus(self, coin, overclocked=False): if self.amd_gpu_info: adapter_num = 0. for gpu_info in self.amd_gpu_info:e self.overclock_factory.run_cmds(overclocked, coin, gpu_info["amd_type"], adapter_num) logger.info(D "overclocked adapter_num={} gpu_info={}".format(- adapter_num, gpu_info ) ) adapter_num += 15�_�����v\�ߦ�"from overclockers import AMD_RX5005�_�/����v\����0 self.overclock_factory.run_cmds(5�_� ����v\�G� 2 self.overclock_factory = overclock_factory5�_� /����v\�P� / self.amd_gpu_modder = overclock_factory5�_�6����v\�U �8 def __init__(self, amd_gpu_info, overclock_factory):5�_�&����v\�_ �4 self.overclock_factory.run_all_mods(5�_�'����v\�t�1 self.amd_gpu_modder.run_all_mods(5�_�'����v\���' self.amd_gpu_modder.run5�_�)����v\���) self.amd_gpu_modder.run()5�_�(����v\���( self.amd_gpu_modder.run(5�_�3����v\���3 self.amd_gpu_modder.run(adapter_num5�_�$����v\�f� from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class OverclockController:5 def __init__(self, amd_gpu_info, amd_gpu_modder):( self.amd_gpu_info = amd_gpu_info, self.amd_gpu_modder = amd_gpu_modder6 def overclock_gpus(self, coin, overclocked=False): if self.amd_gpu_info: adapter_num = 0. for gpu_info in self.amd_gpu_info:4 self.amd_gpu_modder.run(adapter_num,H overclocked, coin, gpu_info["amd_type"], adapter_num ) logger.info(D "overclocked adapter_num={} gpu_info={}".format(- adapter_num, gpu_info ) ) adapter_num += 15�_� ����v\�\�� , self.amd_gpu_modder = amd_gpu_modder5�_� 1����v\�\�� 1 self.amd_gpu_mod_factory = amd_gpu_modder5�_� '����v\�\�� 6 self.amd_gpu_mod_factory = amd_gpu_mod_factory5�_�! ����v\�\�� 5 self.amd_gpu_mod_factory = amdgpu_mod_factory5�_� "!����v\�\�� ( self.amd_gpu_info = amd_gpu_info5�_�!#"����v\�\�� ' self.amdgpu_info = amd_gpu_info5�_�"$#����v\�\��5 def __init__(self, amd_gpu_info, amd_gpu_modder):5�_�#%$'����v\�\��4 def __init__(self, amdgpu_info, amd_gpu_modder):5�_�$&%1����v\�\��3 def __init__(self, amdgpu_info, amdgpu_modder):5�_�%'&5����v\�\��7 def __init__(self, amdgpu_info, amdgpu_mod_factor):5�_�&('����v\�\�� if self.amd_gpu_info:5�_�')($����v\�\�� . for gpu_info in self.amd_gpu_info:5�_�(*)����v\�\��( self.amd_gpu_modder.run(5�_�)+*"����v\�\��' self.amdgpu_modder.run(5�_�*,+&����v\�\��+ self.amdgpu_mod_factor.run(5�_�+-,+����v\�\��, self.amdgpu_mod_factory.run(5�_�,.-����v\�^8� �5�_�-/.����v\�^C� def _overclock_gpu(self)5�_�.0/����v\�^D� �5�_�/10����v\�^^� def _overclock_gpu(self):5�_�021����v\�^b�" def _overclock_gpu(self, mod):5�_�132����v\�^h� 6 def overclock_gpus(self, coin, overclocked=False):5�_�243����v\�^q� for 5�_�354����v\�^u� for mod in mods:w 5�_�465����v\�^w� def _mod_gpu(self, mod):5�_�576����v\�^x� �5�_�687����v\�^{� s5�_�798����v\�^|��5�_�8:9����v\�^��import subprocess5�_�9;:����v\�^���5�_�:<;����v\�^��5�_�;=<����v\�^� � for mod in mods: 5�_�<>=����v\�^�� �5�_�=?>)����v\�^�� �5�_�>@?(����v\�^��) logger.info('running mod={}')5�_�?A@2����v\�^��import subprocess from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class OverclockController:8 def __init__(self, amdgpu_info, amdgpu_mod_factory):& self.amdgpu_info = amdgpu_info4 self.amdgpu_mod_factory = amdgpu_mod_factory0 def mod_gpus(self, coin, overclocked=False): if self.amdgpu_info: adapter_num = 0- for gpu_info in self.amdgpu_info:5 self.amdgpu_mod_factory.get_mod_list(U adapter_num, overclocked, coin, gpu_info["amd_type"], adapter_num ) logger.info(D "overclocked adapter_num={} gpu_info={}".format(- adapter_num, gpu_info ) ) adapter_num += 1 def _mod_gpu(self, mods): for mod in mods:+ subprocess.run(mod, shell=True)5 logger.info('running mod={}'.format(mod))5�_�@BA����v\�^�� �5�_�ACB����v\�^�� _mod.gpu5�_�BDC����v\�^�� self._mod.gpu5�_�CED����v\�^��5 self.amdgpu_mod_factory.get_mod_list(5�_�DFE����v\�^��D "overclocked adapter_num={} gpu_info={}".format(5�_�EGF����v\�^��B "modifiedd adapter_num={} gpu_info={}".format(5�_�FHG����v\�`P�5�_�GIH ����\�m�� 0 def mod_gpus(self, coin, overclocked=False):5�_�HJI2����\�m�� U adapter_num, overclocked, coin, gpu_info["amd_type"], adapter_num5�_�IKJ����\�m��[ adapter_num, overclocked, memory_clc, gpu_info["amd_type"], adapter_num5�_�JLK����\�m���5�_�KL����\�m��(import subprocess from utils import CoinmineLogger!logger = CoinmineLogger(__name__)class OverclockController:8 def __init__(self, amdgpu_info, amdgpu_mod_factory):& self.amdgpu_info = amdgpu_info4 self.amdgpu_mod_factory = amdgpu_mod_factory* def mod_gpus(self, overclocked=False): if self.amdgpu_info: adapter_num = 0- for gpu_info in self.amdgpu_info:< mods = self.amdgpu_mod_factory.get_mod_list( adapter_num, overclocked, memory_clock, memory_voltage, memory_dpm_level, core_clock, core_voltage, core_dpm_level, fan_percent, )# self._mod.gpu(mods) logger.info(E "modified amd adapter_num={} gpu_info={}".format(- adapter_num, gpu_info ) ) adapter_num += 1 def _mod_gpu(self, mods): for mod in mods:+ subprocess.run(mod, shell=True)5 logger.info("running mod={}".format(mod))5�_�����v\��p :rom utils import CoinmineLogger5�_� ����\�CS�5�_� ����!V\�CW�! adapter_num = 0* for gpu_info in self.amd_gpu_info:T self.overclock_factory.run_cmds(coin, gpu_info["amd_type"], adapter_num)F AMD_RX500.set_fan(adapter_num, self.overclock_factory.fan) logger.info(@ "overclocked adapter_num={} gpu_info={}".format() adapter_num, gpu_info ) ) adapter_num += 15�_� ����V\�CZ�"5�_� ����V\�CZ� from utils import CoinmineLogger"from overclockers import AMD_RX500!logger = CoinmineLogger(__name__)class OverclockController:8 def __init__(self, amd_gpu_info, overclock_factory):( self.amd_gpu_info = amd_gpu_info2 self.overclock_factory = overclock_factory6 def overclock_gpus(self, coin, overclocked=False): adapter_num = 0* for gpu_info in self.amd_gpu_info:T self.overclock_factory.run_cmds(coin, gpu_info["amd_type"], adapter_num)F AMD_RX500.set_fan(adapter_num, self.overclock_factory.fan) logger.info(V "overclocked adapter_num={} gpu_info={}".format(adapter_num, gpu_info) ) adapter_num += 15�_� ����\�CT�5�_�����V\���5�_�����V\���5��