feature: add support for M50S++VL30, update docs, fix hammer bug, and handle errors with data on unknown types of miners

This commit is contained in:
Brett Rowan
2024-12-31 13:04:20 -07:00
parent 66a8932ea3
commit f7a0188104
12 changed files with 50 additions and 5 deletions

View File

@@ -372,6 +372,13 @@
show_root_heading: false show_root_heading: false
heading_level: 4 heading_level: 4
## S19j Pro Dual (ePIC)
::: pyasic.miners.antminer.epic.X19.S19.ePICS19jProDual
handler: python
options:
show_root_heading: false
heading_level: 4
## S19j Pro (Hive) ## S19j Pro (Hive)
::: pyasic.miners.antminer.hiveon.X19.S19.HiveonS19jPro ::: pyasic.miners.antminer.hiveon.X19.S19.HiveonS19jPro
handler: python handler: python

View File

@@ -306,6 +306,7 @@ details {
<li><a href="../whatsminer/M5X#m50s_1_1-vk10-stock">M50S++ VK10 (Stock)</a></li> <li><a href="../whatsminer/M5X#m50s_1_1-vk10-stock">M50S++ VK10 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m50s_1_1-vk20-stock">M50S++ VK20 (Stock)</a></li> <li><a href="../whatsminer/M5X#m50s_1_1-vk20-stock">M50S++ VK20 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m50s_1_1-vk30-stock">M50S++ VK30 (Stock)</a></li> <li><a href="../whatsminer/M5X#m50s_1_1-vk30-stock">M50S++ VK30 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m50s_1_1-vl30-stock">M50S++ VL30 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m53-vh30-stock">M53 VH30 (Stock)</a></li> <li><a href="../whatsminer/M5X#m53-vh30-stock">M53 VH30 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m53s-vh30-stock">M53S VH30 (Stock)</a></li> <li><a href="../whatsminer/M5X#m53s-vh30-stock">M53S VH30 (Stock)</a></li>
<li><a href="../whatsminer/M5X#m53s-vj40-stock">M53S VJ40 (Stock)</a></li> <li><a href="../whatsminer/M5X#m53s-vj40-stock">M53S VJ40 (Stock)</a></li>
@@ -566,6 +567,7 @@ details {
<li><a href="../antminer/X19#s19j-pro_1-epic">S19j Pro+ (ePIC)</a></li> <li><a href="../antminer/X19#s19j-pro_1-epic">S19j Pro+ (ePIC)</a></li>
<li><a href="../antminer/X19#s19k-pro-epic">S19k Pro (ePIC)</a></li> <li><a href="../antminer/X19#s19k-pro-epic">S19k Pro (ePIC)</a></li>
<li><a href="../antminer/X19#s19-xp-epic">S19 XP (ePIC)</a></li> <li><a href="../antminer/X19#s19-xp-epic">S19 XP (ePIC)</a></li>
<li><a href="../antminer/X19#s19j-pro-dual-epic">S19j Pro Dual (ePIC)</a></li>
</ul> </ul>
</details> </details>
<details> <details>

View File

@@ -204,6 +204,13 @@
show_root_heading: false show_root_heading: false
heading_level: 4 heading_level: 4
## M50S++ VL30 (Stock)
::: pyasic.miners.whatsminer.btminer.M5X.M50S_Plus_Plus.BTMinerM50SPlusPlusVL30
handler: python
options:
show_root_heading: false
heading_level: 4
## M53 VH30 (Stock) ## M53 VH30 (Stock)
::: pyasic.miners.whatsminer.btminer.M5X.M53.BTMinerM53VH30 ::: pyasic.miners.whatsminer.btminer.M5X.M53.BTMinerM53VH30
handler: python handler: python

View File

@@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from .hashrate.base import AlgoHashRateType from .hashrate.base import AlgoHashRateType, GenericHashrate
from .hashrate.unit.base import AlgoHashRateUnitType from .hashrate.unit.base import AlgoHashRateUnitType, GenericUnit
class MinerAlgoMeta(type): class MinerAlgoMeta(type):
@@ -14,3 +14,10 @@ class MinerAlgoMeta(type):
class MinerAlgoType(metaclass=MinerAlgoMeta): class MinerAlgoType(metaclass=MinerAlgoMeta):
hashrate: type[AlgoHashRateType] hashrate: type[AlgoHashRateType]
unit: type[AlgoHashRateUnitType] unit: type[AlgoHashRateUnitType]
class GenericAlgo(MinerAlgoType):
hashrate: type[GenericHashrate] = GenericHashrate
unit: type[GenericUnit] = GenericUnit
name = "Generic (Unknown)"

View File

@@ -252,6 +252,7 @@ class WhatsminerModels(MinerModelType):
M50SPlusPlusVK10 = "M50S++ VK10" M50SPlusPlusVK10 = "M50S++ VK10"
M50SPlusPlusVK20 = "M50S++ VK20" M50SPlusPlusVK20 = "M50S++ VK20"
M50SPlusPlusVK30 = "M50S++ VK30" M50SPlusPlusVK30 = "M50S++ VK30"
M50SPlusPlusVL30 = "M50S++ VL30"
M53VH30 = "M53 VH30" M53VH30 = "M53 VH30"
M53SVH30 = "M53S VH30" M53SVH30 = "M53S VH30"
M53SVJ40 = "M53S VJ40" M53SVJ40 = "M53S VJ40"

View File

@@ -229,7 +229,7 @@ class BlackMiner(StockFirmware):
hashrate = boards[1].get(f"chain_rate{i}") hashrate = boards[1].get(f"chain_rate{i}")
if hashrate: if hashrate:
hashboard.hashrate = self.algo.hashrate( hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=self.algo.unit.MH rate=float(hashrate), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
chips = boards[1].get(f"chain_acn{i}") chips = boards[1].get(f"chain_acn{i}")

View File

@@ -24,6 +24,7 @@ from pyasic.data.device import DeviceInfo
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.data.pools import PoolMetrics from pyasic.data.pools import PoolMetrics
from pyasic.device.algorithm import MinerAlgoType from pyasic.device.algorithm import MinerAlgoType
from pyasic.device.algorithm.base import GenericAlgo
from pyasic.device.algorithm.hashrate import AlgoHashRate from pyasic.device.algorithm.hashrate import AlgoHashRate
from pyasic.device.firmware import MinerFirmware from pyasic.device.firmware import MinerFirmware
from pyasic.device.makes import MinerMake from pyasic.device.makes import MinerMake
@@ -46,7 +47,7 @@ class MinerProtocol(Protocol):
make: MinerMake = None make: MinerMake = None
raw_model: MinerModelType = None raw_model: MinerModelType = None
firmware: MinerFirmware = None firmware: MinerFirmware = None
algo: type[MinerAlgoType] = None algo: type[MinerAlgoType] = GenericAlgo
expected_hashboards: int = None expected_hashboards: int = None
expected_chips: int = None expected_chips: int = None

View File

@@ -42,3 +42,11 @@ class M50SPlusPlusVK30(WhatsMinerMake):
expected_fans = 2 expected_fans = 2
expected_hashboards = 3 expected_hashboards = 3
algo = MinerAlgo.SHA256 algo = MinerAlgo.SHA256
class M50SPlusPlusVL30(WhatsMinerMake):
raw_model = MinerModel.WHATSMINER.M50SPlusPlusVL30
expected_fans = 2
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -41,7 +41,12 @@ from .M50S import (
M50SVJ30, M50SVJ30,
) )
from .M50S_Plus import M50SPlusVH30, M50SPlusVH40, M50SPlusVJ30, M50SPlusVK20 from .M50S_Plus import M50SPlusVH30, M50SPlusVH40, M50SPlusVJ30, M50SPlusVK20
from .M50S_Plus_Plus import M50SPlusPlusVK10, M50SPlusPlusVK20, M50SPlusPlusVK30 from .M50S_Plus_Plus import (
M50SPlusPlusVK10,
M50SPlusPlusVK20,
M50SPlusPlusVK30,
M50SPlusPlusVL30,
)
from .M53 import M53VH30 from .M53 import M53VH30
from .M53S import M53SVH30, M53SVJ40 from .M53S import M53SVH30, M53SVJ40
from .M53S_Plus import M53SPlusVJ30 from .M53S_Plus import M53SPlusVJ30

View File

@@ -303,6 +303,7 @@ MINER_CLASSES = {
"M50S++VK10": BTMinerM50SPlusPlusVK10, "M50S++VK10": BTMinerM50SPlusPlusVK10,
"M50S++VK20": BTMinerM50SPlusPlusVK20, "M50S++VK20": BTMinerM50SPlusPlusVK20,
"M50S++VK30": BTMinerM50SPlusPlusVK30, "M50S++VK30": BTMinerM50SPlusPlusVK30,
"M50S++VL30": BTMinerM50SPlusPlusVL30,
"M53VH30": BTMinerM53VH30, "M53VH30": BTMinerM53VH30,
"M53SVH30": BTMinerM53SVH30, "M53SVH30": BTMinerM53SVH30,
"M53SVJ40": BTMinerM53SVJ40, "M53SVJ40": BTMinerM53SVJ40,

View File

@@ -19,6 +19,7 @@ from pyasic.miners.device.models.whatsminer import ( # noqa - ignore _module im
M50SPlusPlusVK10, M50SPlusPlusVK10,
M50SPlusPlusVK20, M50SPlusPlusVK20,
M50SPlusPlusVK30, M50SPlusPlusVK30,
M50SPlusPlusVL30,
) )
@@ -32,3 +33,7 @@ class BTMinerM50SPlusPlusVK20(M50SPlusPlusVK20, M5X):
class BTMinerM50SPlusPlusVK30(M50SPlusPlusVK30, M5X): class BTMinerM50SPlusPlusVK30(M50SPlusPlusVK30, M5X):
pass pass
class BTMinerM50SPlusPlusVL30(M50SPlusPlusVL30, M5X):
pass

View File

@@ -50,6 +50,7 @@ from .M50S_Plus_Plus import (
BTMinerM50SPlusPlusVK10, BTMinerM50SPlusPlusVK10,
BTMinerM50SPlusPlusVK20, BTMinerM50SPlusPlusVK20,
BTMinerM50SPlusPlusVK30, BTMinerM50SPlusPlusVK30,
BTMinerM50SPlusPlusVL30,
) )
from .M53 import BTMinerM53VH30 from .M53 import BTMinerM53VH30
from .M53S import BTMinerM53SVH30, BTMinerM53SVJ40 from .M53S import BTMinerM53SVH30, BTMinerM53SVJ40