Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae835dbdb2 | ||
|
|
d59f29b582 | ||
|
|
c7d6f6cd9f | ||
|
|
bf19232ad9 | ||
|
|
b495f22f31 | ||
|
|
78213c682b | ||
|
|
3706c8fb75 | ||
|
|
ed9d386dc2 | ||
|
|
1183b5deb2 | ||
|
|
c4676438a8 | ||
|
|
5ea9126c77 | ||
|
|
853756ebcb | ||
|
|
05e82b85c5 | ||
|
|
9c4c8503d6 | ||
|
|
e25cc1d85e | ||
|
|
8e37d72337 | ||
|
|
f84a054ecc | ||
|
|
6b54607588 |
@@ -46,6 +46,7 @@ class BaseMinerAPI:
|
||||
parameters: Union[str, int, bool] = None,
|
||||
ignore_errors: bool = False,
|
||||
allow_warning: bool = True,
|
||||
**kwargs
|
||||
) -> dict:
|
||||
"""Send an API command to the miner and return the result.
|
||||
|
||||
@@ -65,7 +66,7 @@ class BaseMinerAPI:
|
||||
else ""
|
||||
)
|
||||
# create the command
|
||||
cmd = {"command": command}
|
||||
cmd = {"command": command, **kwargs}
|
||||
if parameters:
|
||||
cmd["parameter"] = parameters
|
||||
|
||||
|
||||
@@ -638,6 +638,13 @@ class MinerConfig:
|
||||
cfg["hash_chain_global"] = {}
|
||||
cfg["hash_chain_global"]["asic_boost"] = self.asicboost
|
||||
|
||||
if self.minimum_fans is not None or self.fan_speed is not None:
|
||||
cfg["fan_control"] = {}
|
||||
if self.minimum_fans is not None:
|
||||
cfg["fan_control"]["min_fans"] = self.minimum_fans
|
||||
if self.fan_speed is not None:
|
||||
cfg["fan_control"]["speed"] = self.fan_speed
|
||||
|
||||
if any(
|
||||
[
|
||||
getattr(self, item)
|
||||
|
||||
@@ -96,7 +96,9 @@ class MinerData:
|
||||
right_chips: The number of chips online in the left board as an int.
|
||||
total_chips: The total number of chips on all boards. Calculated automatically.
|
||||
ideal_chips: The ideal number of chips in the miner as an int.
|
||||
percent_ideal: The percent of total chips out of the ideal count. Calculated automatically.
|
||||
percent_ideal_chips: The percent of total chips out of the ideal count. Calculated automatically.
|
||||
percent_ideal_hashrate: The percent of total hashrate out of the ideal hashrate. Calculated automatically.
|
||||
percent_ideal_wattage: The percent of total wattage out of the ideal wattage. Calculated automatically.
|
||||
nominal: Whether the number of chips in the miner is nominal. Calculated automatically.
|
||||
pool_split: The pool split as a str.
|
||||
pool_1_url: The first pool url on the miner as a str.
|
||||
@@ -116,7 +118,8 @@ class MinerData:
|
||||
api_ver: str = "Unknown"
|
||||
fw_ver: str = "Unknown"
|
||||
hostname: str = "Unknown"
|
||||
hashrate: float = 0
|
||||
hashrate: float = field(init=False)
|
||||
_hashrate: float = 0
|
||||
nominal_hashrate: float = 0
|
||||
hashboards: List[HashBoard] = field(default_factory=list)
|
||||
ideal_hashboards: int = 1
|
||||
@@ -144,7 +147,9 @@ class MinerData:
|
||||
right_chips: int = field(init=False)
|
||||
total_chips: int = field(init=False)
|
||||
ideal_chips: int = 1
|
||||
percent_ideal: float = field(init=False)
|
||||
percent_ideal_chips: float = field(init=False)
|
||||
percent_ideal_hashrate: float = field(init=False)
|
||||
percent_ideal_wattage: float = field(init=False)
|
||||
nominal: int = field(init=False)
|
||||
pool_split: str = "0"
|
||||
pool_1_url: str = "Unknown"
|
||||
@@ -213,6 +218,16 @@ class MinerData:
|
||||
setattr(cp, key, item & other_item)
|
||||
return cp
|
||||
|
||||
@property
|
||||
def hashrate(self): # noqa - Skip PyCharm inspection
|
||||
if len(self.hashboards) > 0:
|
||||
return round(sum(map(lambda x: x.hashrate, self.hashboards)), 2)
|
||||
return self._hashrate
|
||||
|
||||
@hashrate.setter
|
||||
def hashrate(self, val):
|
||||
self._hashrate = val
|
||||
|
||||
@property
|
||||
def fan_1(self): # noqa - Skip PyCharm inspection
|
||||
if len(self.fans) > 0:
|
||||
@@ -411,13 +426,33 @@ class MinerData:
|
||||
pass
|
||||
|
||||
@property
|
||||
def percent_ideal(self): # noqa - Skip PyCharm inspection
|
||||
def percent_ideal_chips(self): # noqa - Skip PyCharm inspection
|
||||
if self.total_chips == 0 or self.ideal_chips == 0:
|
||||
return 0
|
||||
return round((self.total_chips / self.ideal_chips) * 100)
|
||||
|
||||
@percent_ideal.setter
|
||||
def percent_ideal(self, val):
|
||||
@percent_ideal_chips.setter
|
||||
def percent_ideal_chips(self, val):
|
||||
pass
|
||||
|
||||
@property
|
||||
def percent_ideal_hashrate(self): # noqa - Skip PyCharm inspection
|
||||
if self.hashrate == 0 or self.nominal_hashrate == 0:
|
||||
return 0
|
||||
return round((self.hashrate / self.nominal_hashrate) * 100)
|
||||
|
||||
@percent_ideal_hashrate.setter
|
||||
def percent_ideal_hashrate(self, val):
|
||||
pass
|
||||
|
||||
@property
|
||||
def percent_ideal_wattage(self): # noqa - Skip PyCharm inspection
|
||||
if self.wattage_limit == 0 or self.wattage == 0:
|
||||
return 0
|
||||
return round((self.wattage / self.wattage_limit) * 100)
|
||||
|
||||
@percent_ideal_wattage.setter
|
||||
def percent_ideal_wattage(self, val):
|
||||
pass
|
||||
|
||||
@property
|
||||
|
||||
@@ -28,25 +28,25 @@ from pyasic.errors import APIError
|
||||
from pyasic.miners.base import BaseMiner
|
||||
|
||||
BMMINER_DATA_LOC = {
|
||||
"mac": {"cmd": "mac", "kwargs": {}},
|
||||
"model": {"cmd": "model", "kwargs": {"api_devdetails": {"api": "devdetails"}}},
|
||||
"api_ver": {"cmd": "api_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||
"fw_ver": {"cmd": "fw_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||
"hostname": {"cmd": "hostname", "kwargs": {}},
|
||||
"hashrate": {"cmd": "hashrate", "kwargs": {"api_summary": {"api": "summary"}}},
|
||||
"mac": {"cmd": "get_mac", "kwargs": {}},
|
||||
"model": {"cmd": "get_model", "kwargs": {}},
|
||||
"api_ver": {"cmd": "get_api_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||
"fw_ver": {"cmd": "get_fw_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||
"hostname": {"cmd": "get_hostname", "kwargs": {}},
|
||||
"hashrate": {"cmd": "get_hashrate", "kwargs": {"api_summary": {"api": "summary"}}},
|
||||
"nominal_hashrate": {
|
||||
"cmd": "nominal_hashrate",
|
||||
"cmd": "get_nominal_hashrate",
|
||||
"kwargs": {"api_stats": {"api": "stats"}},
|
||||
},
|
||||
"hashboards": {"cmd": "hashboards", "kwargs": {"api_stats": {"api": "stats"}}},
|
||||
"env_temp": {"cmd": "env_temp", "kwargs": {}},
|
||||
"wattage": {"cmd": "wattage", "kwargs": {}},
|
||||
"wattage_limit": {"cmd": "wattage_limit", "kwargs": {}},
|
||||
"fans": {"cmd": "fans", "kwargs": {"api_stats": {"api": "stats"}}},
|
||||
"fan_psu": {"cmd": "fan_psu", "kwargs": {}},
|
||||
"errors": {"cmd": "errors", "kwargs": {}},
|
||||
"fault_light": {"cmd": "fault_light", "kwargs": {}},
|
||||
"pools": {"cmd": "pools", "kwargs": {"api_pools": {"api": "pools"}}},
|
||||
"hashboards": {"cmd": "get_hashboards", "kwargs": {"api_stats": {"api": "stats"}}},
|
||||
"env_temp": {"cmd": "get_env_temp", "kwargs": {}},
|
||||
"wattage": {"cmd": "get_wattage", "kwargs": {}},
|
||||
"wattage_limit": {"cmd": "get_wattage_limit", "kwargs": {}},
|
||||
"fans": {"cmd": "get_fans", "kwargs": {"api_stats": {"api": "stats"}}},
|
||||
"fan_psu": {"cmd": "get_fan_psu", "kwargs": {}},
|
||||
"errors": {"cmd": "get_errors", "kwargs": {}},
|
||||
"fault_light": {"cmd": "get_fault_light", "kwargs": {}},
|
||||
"pools": {"cmd": "get_pools", "kwargs": {"api_pools": {"api": "pools"}}},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pyasic.miners.backends import BMMiner
|
||||
|
||||
|
||||
@@ -22,3 +24,6 @@ class Hiveon(BMMiner):
|
||||
super().__init__(ip, api_ver)
|
||||
# static data
|
||||
self.api_type = "Hiveon"
|
||||
|
||||
async def get_model(self) -> Optional[str]:
|
||||
return self.model + " (Hiveon)"
|
||||
|
||||
@@ -58,8 +58,8 @@ class VNish(BMMiner):
|
||||
# data gathering locations
|
||||
self.data_locations = VNISH_DATA_LOC
|
||||
|
||||
async def get_model(self, api_stats: dict = None) -> Optional[str]:
|
||||
return self.model + "(VNISH)"
|
||||
async def get_model(self) -> Optional[str]:
|
||||
return self.model + " (VNISH)"
|
||||
|
||||
async def restart_backend(self) -> bool:
|
||||
data = await self.web.restart_vnish()
|
||||
|
||||
@@ -225,10 +225,7 @@ class M30SPlusPlusVH100(WhatsMiner): # noqa - ignore ABC method implementation
|
||||
super().__init__(ip, api_ver)
|
||||
self.ip = ip
|
||||
self.model = "M30S++ VH100"
|
||||
self.nominal_chips = 0
|
||||
warnings.warn(
|
||||
"Unknown chip count for miner type M30S++ VH100, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
|
||||
)
|
||||
self.nominal_chips = 82
|
||||
self.fan_count = 2
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@ class M33SPlusPlusVH20(WhatsMiner): # noqa - ignore ABC method implementation
|
||||
self.ip = ip
|
||||
self.model = "M33S++ VH20"
|
||||
self.ideal_hashboards = 4
|
||||
self.nominal_chips = 0
|
||||
warnings.warn(
|
||||
"Unknown chip count for miner type M30S++ VH20, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
|
||||
)
|
||||
self.nominal_chips = 112
|
||||
self.fan_count = 0
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class HiveonT9(Hiveon, T9):
|
||||
.upper()
|
||||
)
|
||||
return mac
|
||||
except (TypeError, ValueError, asyncssh.Error, OSError):
|
||||
except (TypeError, ValueError, asyncssh.Error, OSError, AttributeError):
|
||||
pass
|
||||
|
||||
async def get_hashboards(self, api_stats: dict = None) -> List[HashBoard]:
|
||||
@@ -62,13 +62,16 @@ class HiveonT9(Hiveon, T9):
|
||||
try:
|
||||
hashboard.board_temp = api_stats["STATS"][1][f"temp{chipset}"]
|
||||
hashboard.chip_temp = api_stats["STATS"][1][f"temp2_{chipset}"]
|
||||
hashrate += api_stats["STATS"][1][f"chain_rate{chipset}"]
|
||||
chips += api_stats["STATS"][1][f"chain_acn{chipset}"]
|
||||
except (KeyError, IndexError):
|
||||
pass
|
||||
else:
|
||||
hashboard.missing = False
|
||||
hashboard.hashrate = hashrate
|
||||
try:
|
||||
hashrate += api_stats["STATS"][1][f"chain_rate{chipset}"]
|
||||
chips += api_stats["STATS"][1][f"chain_acn{chipset}"]
|
||||
except (KeyError, IndexError):
|
||||
pass
|
||||
hashboard.hashrate = round(hashrate / 1000, 2)
|
||||
hashboard.chips = chips
|
||||
hashboards.append(hashboard)
|
||||
|
||||
|
||||
16
pyasic/miners/dsh/__init__.py
Normal file
16
pyasic/miners/dsh/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .antminer import *
|
||||
16
pyasic/miners/dsh/_types/__init__.py
Normal file
16
pyasic/miners/dsh/_types/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .antminer import *
|
||||
27
pyasic/miners/dsh/_types/antminer/X3/D3.py
Normal file
27
pyasic/miners/dsh/_types/antminer/X3/D3.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from pyasic.miners.makes import AntMiner
|
||||
|
||||
|
||||
class D3(AntMiner): # noqa - ignore ABC method implementation
|
||||
def __init__(self, ip: str, api_ver: str = "0.0.0"):
|
||||
super().__init__(ip, api_ver)
|
||||
self.ip = ip
|
||||
self.model = "D3"
|
||||
self.nominal_chips = 60
|
||||
self.ideal_hashboards = 3
|
||||
self.fan_count = 2
|
||||
16
pyasic/miners/dsh/_types/antminer/X3/__init__.py
Normal file
16
pyasic/miners/dsh/_types/antminer/X3/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .D3 import D3
|
||||
16
pyasic/miners/dsh/_types/antminer/__init__.py
Normal file
16
pyasic/miners/dsh/_types/antminer/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .X3 import *
|
||||
16
pyasic/miners/dsh/antminer/__init__.py
Normal file
16
pyasic/miners/dsh/antminer/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .cgminer import *
|
||||
24
pyasic/miners/dsh/antminer/cgminer/X3/D3.py
Normal file
24
pyasic/miners/dsh/antminer/cgminer/X3/D3.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from pyasic.miners.backends import AntminerOld
|
||||
from pyasic.miners.dsh._types import D3 # noqa - Ignore access to _module
|
||||
|
||||
|
||||
class CGMinerD3(AntminerOld, D3):
|
||||
def __init__(self, ip: str, api_ver: str = "0.0.0"):
|
||||
super().__init__(ip, api_ver)
|
||||
self.supports_shutdown = False
|
||||
16
pyasic/miners/dsh/antminer/cgminer/X3/__init__.py
Normal file
16
pyasic/miners/dsh/antminer/cgminer/X3/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .D3 import CGMinerD3
|
||||
16
pyasic/miners/dsh/antminer/cgminer/__init__.py
Normal file
16
pyasic/miners/dsh/antminer/cgminer/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .X3 import *
|
||||
25
pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py
Normal file
25
pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from pyasic.miners.makes import AntMiner
|
||||
|
||||
|
||||
class L3Plus(AntMiner): # noqa - ignore ABC method implementation
|
||||
def __init__(self, ip: str, api_ver: str = "0.0.0"):
|
||||
super().__init__(ip, api_ver)
|
||||
self.ip = ip
|
||||
self.model = "L3+"
|
||||
self.nominal_chips = 72
|
||||
self.fan_count = 2
|
||||
16
pyasic/miners/ltc/_types/antminer/X3/__init__.py
Normal file
16
pyasic/miners/ltc/_types/antminer/X3/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .L3_Plus import L3Plus
|
||||
@@ -13,4 +13,5 @@
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .X3 import *
|
||||
from .X7 import *
|
||||
|
||||
@@ -14,3 +14,4 @@
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .bmminer import *
|
||||
from .vnish import *
|
||||
|
||||
23
pyasic/miners/ltc/antminer/bmminer/X3/L3_Plus.py
Normal file
23
pyasic/miners/ltc/antminer/bmminer/X3/L3_Plus.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from pyasic.miners.backends import AntminerOld
|
||||
from pyasic.miners.ltc._types import L3Plus # noqa - Ignore access to _module
|
||||
|
||||
|
||||
class BMMinerL3Plus(AntminerOld, L3Plus):
|
||||
def __init__(self, ip: str, api_ver: str = "0.0.0"):
|
||||
super().__init__(ip, api_ver)
|
||||
17
pyasic/miners/ltc/antminer/bmminer/X3/__init__.py
Normal file
17
pyasic/miners/ltc/antminer/bmminer/X3/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from .L3_Plus import BMMinerL3Plus
|
||||
@@ -13,7 +13,6 @@
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from pyasic.miners.backends import AntminerModern
|
||||
from pyasic.miners.ltc._types import L7 # noqa - Ignore access to _module
|
||||
|
||||
|
||||
@@ -13,5 +13,4 @@
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from .L7 import BMMinerL7
|
||||
|
||||
@@ -13,4 +13,5 @@
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .X3 import *
|
||||
from .X7 import *
|
||||
|
||||
23
pyasic/miners/ltc/antminer/vnish/X3/L3_Plus.py
Normal file
23
pyasic/miners/ltc/antminer/vnish/X3/L3_Plus.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from pyasic.miners.backends import VNish
|
||||
from pyasic.miners.ltc._types import L3Plus # noqa - Ignore access to _module
|
||||
|
||||
|
||||
class VnishL3Plus(VNish, L3Plus):
|
||||
def __init__(self, ip: str, api_ver: str = "0.0.0"):
|
||||
super().__init__(ip, api_ver)
|
||||
17
pyasic/miners/ltc/antminer/vnish/X3/__init__.py
Normal file
17
pyasic/miners/ltc/antminer/vnish/X3/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
from .L3_Plus import VnishL3Plus
|
||||
16
pyasic/miners/ltc/antminer/vnish/__init__.py
Normal file
16
pyasic/miners/ltc/antminer/vnish/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright 2022 Upstream Data Inc -
|
||||
# -
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
||||
# you may not use this file except in compliance with the License. -
|
||||
# You may obtain a copy of the License at -
|
||||
# -
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 -
|
||||
# -
|
||||
# Unless required by applicable law or agreed to in writing, software -
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, -
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
||||
# See the License for the specific language governing permissions and -
|
||||
# limitations under the License. -
|
||||
# ------------------------------------------------------------------------------
|
||||
from .X3 import *
|
||||
@@ -36,6 +36,7 @@ from pyasic.miners.base import AnyMiner
|
||||
from pyasic.miners.btc import *
|
||||
from pyasic.miners.ckb import *
|
||||
from pyasic.miners.dcr import *
|
||||
from pyasic.miners.dsh import *
|
||||
from pyasic.miners.etc import *
|
||||
from pyasic.miners.hns import *
|
||||
from pyasic.miners.kda import *
|
||||
@@ -50,10 +51,19 @@ MINER_CLASSES = {
|
||||
"Default": CGMinerDR5,
|
||||
"CGMiner": CGMinerDR5,
|
||||
},
|
||||
"ANTMINER D3": {
|
||||
"Default": CGMinerD3,
|
||||
"CGMiner": CGMinerD3,
|
||||
},
|
||||
"ANTMINER HS3": {
|
||||
"Default": CGMinerHS3,
|
||||
"CGMiner": CGMinerHS3,
|
||||
},
|
||||
"ANTMINER L3+": {
|
||||
"Default": BMMinerL3Plus,
|
||||
"BMMiner": BMMinerL3Plus,
|
||||
"VNish": VnishL3Plus,
|
||||
},
|
||||
"ANTMINER L7": {
|
||||
"Default": BMMinerL7,
|
||||
"BMMiner": BMMinerL7,
|
||||
@@ -632,9 +642,6 @@ class MinerFactory(metaclass=Singleton):
|
||||
logging.warning(f"{ip}: Get Miner Timed Out")
|
||||
miner = self._select_miner_from_classes(ip, model, api, ver, api_ver)
|
||||
|
||||
# once we have the miner, get the api and firmware version
|
||||
# await miner.get_version()
|
||||
|
||||
# save the miner to the cache at its IP if its not unknown
|
||||
if not isinstance(miner, UnknownMiner):
|
||||
self.miners[ip] = miner
|
||||
@@ -846,6 +853,12 @@ class MinerFactory(metaclass=Singleton):
|
||||
# def antminer, get from web
|
||||
sysinfo = await self.__get_system_info_from_web(str(ip))
|
||||
model = sysinfo["minertype"].upper()
|
||||
if "VNISH" in model:
|
||||
api = "VNish"
|
||||
for split_point in [" BB", " XILINX", " (VNISH"]:
|
||||
if split_point in model:
|
||||
model = model.split(split_point)[0]
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -98,6 +98,8 @@ class VNishWebAPI(BaseWebAPI):
|
||||
pass
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
async def multicommand(
|
||||
self, *commands: str, ignore_errors: bool = False, allow_warning: bool = True
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pyasic"
|
||||
version = "0.33.1"
|
||||
version = "0.33.8"
|
||||
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
||||
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
||||
repository = "https://github.com/UpstreamData/pyasic"
|
||||
|
||||
Reference in New Issue
Block a user