feature: add alternate algorithm handlers (#240)

* feature: handle all hashrate algorithm conversions for antminers

* feature: handle all hashrate algorithm conversions for auradine

* feature: handle all hashrate algorithm conversions for avalonminers

* feature: handle all hashrate algorithm conversions for bitaxe

* feature: handle all hashrate algorithm conversions for epic

* feature: handle all hashrate algorithm conversions for goldshell

* refactor: clean up imports

* feature: handle all hashrate algorithm conversions for hammer

* feature: handle all hashrate algorithm conversions for iceriver

* feature: handle all hashrate algorithm conversions for innosilicon

* feature: handle all hashrate algorithm conversions for whatsminer

* tests: update tests to check if miners have board, fan, and algo values

* feature: finish updating all miners with boards, fans, and algos

* feature: update algorithm default values

* feature: add algorithm hashrate values

* feature: improve hashrate types, and use `self.algo` inside miners

---------

Co-authored-by: Upstream Data <brett@upstreamdata.ca>
This commit is contained in:
Brett Rowan
2024-11-21 13:44:17 -07:00
committed by GitHub
parent d66739e2c9
commit c00802e311
171 changed files with 2436 additions and 229 deletions

View File

@@ -24,12 +24,12 @@ from pydantic import BaseModel, Field, computed_field, field_serializer
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.config.mining import MiningModePowerTune from pyasic.config.mining import MiningModePowerTune
from pyasic.data.pools import PoolMetrics, Scheme from pyasic.data.pools import PoolMetrics, Scheme
from pyasic.device.algorithm.hashrate import AlgoHashRateType
from .boards import HashBoard from .boards import HashBoard
from .device import DeviceInfo from .device import DeviceInfo
from .error_codes import BraiinsOSError, InnosiliconError, WhatsminerError, X19Error from .error_codes import BraiinsOSError, InnosiliconError, WhatsminerError, X19Error
from .fans import Fan from .fans import Fan
from .hashrate import AlgoHashRate, AlgoHashRateType, HashUnit
class MinerData(BaseModel): class MinerData(BaseModel):
@@ -49,7 +49,6 @@ class MinerData(BaseModel):
fw_ver: The current firmware version on the miner as a str. fw_ver: The current firmware version on the miner as a str.
hostname: The network hostname of the miner as a str. hostname: The network hostname of the miner as a str.
hashrate: The hashrate of the miner in TH/s as a float. Calculated automatically. hashrate: The hashrate of the miner in TH/s as a float. Calculated automatically.
_hashrate: Backup for hashrate found via API instead of hashboards.
expected_hashrate: The factory nominal hashrate of the miner in TH/s as a float. expected_hashrate: The factory nominal hashrate of the miner in TH/s as a float.
hashboards: A list of [`HashBoard`][pyasic.data.HashBoard]s on the miner with their statistics. hashboards: A list of [`HashBoard`][pyasic.data.HashBoard]s on the miner with their statistics.
temperature_avg: The average temperature across the boards. Calculated automatically. temperature_avg: The average temperature across the boards. Calculated automatically.

View File

@@ -18,7 +18,7 @@ from typing import Any
from pydantic import BaseModel, field_serializer from pydantic import BaseModel, field_serializer
from .hashrate import AlgoHashRateType from pyasic.device.algorithm.hashrate import AlgoHashRateType
class HashBoard(BaseModel): class HashBoard(BaseModel):

View File

@@ -1,16 +0,0 @@
from enum import Enum
from pyasic.data.hashrate.base import AlgoHashRateType
from pyasic.data.hashrate.sha256 import SHA256HashRate
from pyasic.device.algorithm.sha256 import SHA256Unit
class AlgoHashRate(Enum):
SHA256 = SHA256HashRate
def __call__(self, *args, **kwargs):
return self.value(*args, **kwargs)
class HashUnit:
SHA256 = SHA256Unit

View File

@@ -1,5 +0,0 @@
from pydantic import BaseModel
class AlgoHashRateType(BaseModel):
pass

View File

@@ -1,6 +1,26 @@
from pyasic.device.algorithm.base import MinerAlgoType from .base import MinerAlgoType
from pyasic.device.algorithm.sha256 import SHA256Algo from .blake256 import Blake256Algo
from .eaglesong import EaglesongAlgo
from .equihash import EquihashAlgo
from .ethash import EtHashAlgo
from .handshake import HandshakeAlgo
from .hashrate import *
from .hashrate.unit import *
from .kadena import KadenaAlgo
from .kheavyhash import KHeavyHashAlgo
from .scrypt import ScryptAlgo
from .sha256 import SHA256Algo
from .x11 import X11Algo
class MinerAlgo: class MinerAlgo:
SHA256 = SHA256Algo SHA256 = SHA256Algo
SCRYPT = ScryptAlgo
KHEAVYHASH = KHeavyHashAlgo
KADENA = KadenaAlgo
HANDSHAKE = HandshakeAlgo
X11 = X11Algo
BLAKE256 = Blake256Algo
EAGLESONG = EaglesongAlgo
ETHASH = EtHashAlgo
EQUIHASH = EquihashAlgo

View File

@@ -1,7 +1,9 @@
from __future__ import annotations from __future__ import annotations
from enum import IntEnum from .hashrate.base import AlgoHashRateType
from .hashrate.unit.base import AlgoHashRateUnitType
class MinerAlgoType(str): class MinerAlgoType(str):
pass hashrate: type[AlgoHashRateType]
unit: type[AlgoHashRateUnitType]

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import Blake256HashRate
from .hashrate.unit import Blake256Unit
# make this json serializable
class _Blake256Algo(MinerAlgoType):
hashrate = Blake256HashRate
unit = Blake256Unit
def __repr__(self):
return "Blake256Algo"
Blake256Algo = _Blake256Algo("Blake256")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import EaglesongHashRate
from .hashrate.unit import EaglesongUnit
# make this json serializable
class _EaglesongAlgo(MinerAlgoType):
hashrate = EaglesongHashRate
unit = EaglesongUnit
def __repr__(self):
return "EaglesongAlgo"
EaglesongAlgo = _EaglesongAlgo("Eaglesong")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import EquihashHashRate
from .hashrate.unit import EquihashUnit
# make this json serializable
class _EquihashAlgo(MinerAlgoType):
hashrate = EquihashHashRate
unit = EquihashUnit
def __repr__(self):
return "EquihashAlgo"
EquihashAlgo = _EquihashAlgo("Equihash")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import EtHashHashRate
from .hashrate.unit import EtHashUnit
# make this json serializable
class _EtHashAlgo(MinerAlgoType):
hashrate = EtHashHashRate
unit = EtHashUnit
def __repr__(self):
return "EtHashAlgo"
EtHashAlgo = _EtHashAlgo("EtHash")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import HandshakeHashRate
from .hashrate.unit import HandshakeUnit
# make this json serializable
class _HandshakeAlgo(MinerAlgoType):
hashrate = HandshakeHashRate
unit = HandshakeUnit
def __repr__(self):
return "HandshakeAlgo"
HandshakeAlgo = _HandshakeAlgo("Handshake")

View File

@@ -0,0 +1,24 @@
from .base import AlgoHashRateType
from .blake256 import Blake256HashRate
from .eaglesong import EaglesongHashRate
from .equihash import EquihashHashRate
from .ethash import EtHashHashRate
from .handshake import HandshakeHashRate
from .kadena import KadenaHashRate
from .kheavyhash import KHeavyHashHashRate
from .scrypt import ScryptHashRate
from .sha256 import SHA256HashRate
from .x11 import X11HashRate
class AlgoHashRate:
SHA256 = SHA256HashRate
SCRYPT = ScryptHashRate
KHEAVYHASH = KHeavyHashHashRate
KADENA = KadenaHashRate
HANDSHAKE = HandshakeHashRate
X11 = X11HashRate
BLAKE256 = Blake256HashRate
EAGLESONG = EaglesongHashRate
ETHASH = EtHashHashRate
EQUIHASH = EquihashHashRate

View File

@@ -0,0 +1,26 @@
from abc import ABC, abstractmethod
from pydantic import BaseModel
from .unit.base import AlgoHashRateUnitType
class AlgoHashRateType(BaseModel, ABC):
unit: AlgoHashRateUnitType
rate: float
@abstractmethod
def into(self, other: "AlgoHashRateUnitType"):
pass
def __float__(self):
return float(self.rate)
def __int__(self):
return int(self.rate)
def __repr__(self):
return f"{self.rate} {str(self.unit)}"
def __round__(self, n: int = None):
return round(self.rate, n)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.blake256 import Blake256Unit
from .unit import HashUnit
class Blake256HashRate(AlgoHashRateType):
rate: float
unit: Blake256Unit = HashUnit.BLAKE256.default
def __add__(self, other: Blake256HashRate | int | float) -> Blake256HashRate:
if isinstance(other, Blake256HashRate):
return Blake256HashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return Blake256HashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: Blake256HashRate | int | float) -> Blake256HashRate:
if isinstance(other, Blake256HashRate):
return Blake256HashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return Blake256HashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: Blake256HashRate | int | float):
if isinstance(other, Blake256HashRate):
return Blake256HashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return Blake256HashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: Blake256HashRate | int | float):
if isinstance(other, Blake256HashRate):
return Blake256HashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return Blake256HashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: Blake256HashRate | int | float):
if isinstance(other, Blake256HashRate):
return Blake256HashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return Blake256HashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: Blake256Unit) -> Blake256HashRate:
return Blake256HashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.eaglesong import EaglesongUnit
from .unit import HashUnit
class EaglesongHashRate(AlgoHashRateType):
rate: float
unit: EaglesongUnit = HashUnit.EAGLESONG.default
def __add__(self, other: EaglesongHashRate | int | float) -> EaglesongHashRate:
if isinstance(other, EaglesongHashRate):
return EaglesongHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return EaglesongHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: EaglesongHashRate | int | float) -> EaglesongHashRate:
if isinstance(other, EaglesongHashRate):
return EaglesongHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return EaglesongHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: EaglesongHashRate | int | float):
if isinstance(other, EaglesongHashRate):
return EaglesongHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return EaglesongHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: EaglesongHashRate | int | float):
if isinstance(other, EaglesongHashRate):
return EaglesongHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return EaglesongHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: EaglesongHashRate | int | float):
if isinstance(other, EaglesongHashRate):
return EaglesongHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return EaglesongHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: EaglesongUnit) -> EaglesongHashRate:
return EaglesongHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.equihash import EquihashUnit
from .unit import HashUnit
class EquihashHashRate(AlgoHashRateType):
rate: float
unit: EquihashUnit = HashUnit.ETHASH.default
def __add__(self, other: EquihashHashRate | int | float) -> EquihashHashRate:
if isinstance(other, EquihashHashRate):
return EquihashHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return EquihashHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: EquihashHashRate | int | float) -> EquihashHashRate:
if isinstance(other, EquihashHashRate):
return EquihashHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return EquihashHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: EquihashHashRate | int | float):
if isinstance(other, EquihashHashRate):
return EquihashHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return EquihashHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: EquihashHashRate | int | float):
if isinstance(other, EquihashHashRate):
return EquihashHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return EquihashHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: EquihashHashRate | int | float):
if isinstance(other, EquihashHashRate):
return EquihashHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return EquihashHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: EquihashUnit) -> EquihashHashRate:
return EquihashHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.ethash import EtHashUnit
from .unit import HashUnit
class EtHashHashRate(AlgoHashRateType):
rate: float
unit: EtHashUnit = HashUnit.ETHASH.default
def __add__(self, other: EtHashHashRate | int | float) -> EtHashHashRate:
if isinstance(other, EtHashHashRate):
return EtHashHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return EtHashHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: EtHashHashRate | int | float) -> EtHashHashRate:
if isinstance(other, EtHashHashRate):
return EtHashHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return EtHashHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: EtHashHashRate | int | float):
if isinstance(other, EtHashHashRate):
return EtHashHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return EtHashHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: EtHashHashRate | int | float):
if isinstance(other, EtHashHashRate):
return EtHashHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return EtHashHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: EtHashHashRate | int | float):
if isinstance(other, EtHashHashRate):
return EtHashHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return EtHashHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: EtHashUnit) -> EtHashHashRate:
return EtHashHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.handshake import HandshakeUnit
from .unit import HashUnit
class HandshakeHashRate(AlgoHashRateType):
rate: float
unit: HandshakeUnit = HashUnit.HANDSHAKE.default
def __add__(self, other: HandshakeHashRate | int | float) -> HandshakeHashRate:
if isinstance(other, HandshakeHashRate):
return HandshakeHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return HandshakeHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: HandshakeHashRate | int | float) -> HandshakeHashRate:
if isinstance(other, HandshakeHashRate):
return HandshakeHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return HandshakeHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: HandshakeHashRate | int | float):
if isinstance(other, HandshakeHashRate):
return HandshakeHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return HandshakeHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: HandshakeHashRate | int | float):
if isinstance(other, HandshakeHashRate):
return HandshakeHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return HandshakeHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: HandshakeHashRate | int | float):
if isinstance(other, HandshakeHashRate):
return HandshakeHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return HandshakeHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: HandshakeUnit) -> HandshakeHashRate:
return HandshakeHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.kadena import KadenaUnit
from .unit import HashUnit
class KadenaHashRate(AlgoHashRateType):
rate: float
unit: KadenaUnit = HashUnit.KADENA.default
def __add__(self, other: KadenaHashRate | int | float) -> KadenaHashRate:
if isinstance(other, KadenaHashRate):
return KadenaHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return KadenaHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: KadenaHashRate | int | float) -> KadenaHashRate:
if isinstance(other, KadenaHashRate):
return KadenaHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return KadenaHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: KadenaHashRate | int | float):
if isinstance(other, KadenaHashRate):
return KadenaHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return KadenaHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: KadenaHashRate | int | float):
if isinstance(other, KadenaHashRate):
return KadenaHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return KadenaHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: KadenaHashRate | int | float):
if isinstance(other, KadenaHashRate):
return KadenaHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return KadenaHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: KadenaUnit) -> KadenaHashRate:
return KadenaHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.kheavyhash import KHeavyHashUnit
from .unit import HashUnit
class KHeavyHashHashRate(AlgoHashRateType):
rate: float
unit: KHeavyHashUnit = HashUnit.KHEAVYHASH.default
def __add__(self, other: KHeavyHashHashRate | int | float) -> KHeavyHashHashRate:
if isinstance(other, KHeavyHashHashRate):
return KHeavyHashHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return KHeavyHashHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: KHeavyHashHashRate | int | float) -> KHeavyHashHashRate:
if isinstance(other, KHeavyHashHashRate):
return KHeavyHashHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return KHeavyHashHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: KHeavyHashHashRate | int | float):
if isinstance(other, KHeavyHashHashRate):
return KHeavyHashHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return KHeavyHashHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: KHeavyHashHashRate | int | float):
if isinstance(other, KHeavyHashHashRate):
return KHeavyHashHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return KHeavyHashHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: KHeavyHashHashRate | int | float):
if isinstance(other, KHeavyHashHashRate):
return KHeavyHashHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return KHeavyHashHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: KHeavyHashUnit) -> KHeavyHashHashRate:
return KHeavyHashHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.scrypt import ScryptUnit
from .unit import HashUnit
class ScryptHashRate(AlgoHashRateType):
rate: float
unit: ScryptUnit = HashUnit.SCRYPT.default
def __add__(self, other: ScryptHashRate | int | float) -> ScryptHashRate:
if isinstance(other, ScryptHashRate):
return ScryptHashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return ScryptHashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: ScryptHashRate | int | float) -> ScryptHashRate:
if isinstance(other, ScryptHashRate):
return ScryptHashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return ScryptHashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: ScryptHashRate | int | float):
if isinstance(other, ScryptHashRate):
return ScryptHashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return ScryptHashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: ScryptHashRate | int | float):
if isinstance(other, ScryptHashRate):
return ScryptHashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return ScryptHashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: ScryptHashRate | int | float):
if isinstance(other, ScryptHashRate):
return ScryptHashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return ScryptHashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: ScryptUnit) -> ScryptHashRate:
return ScryptHashRate(
rate=self.rate / (other.value / self.unit.value), unit=other
)

View File

@@ -1,25 +1,14 @@
from __future__ import annotations from __future__ import annotations
from pyasic.data.hashrate.base import AlgoHashRateType from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm import MinerAlgo from pyasic.device.algorithm.hashrate.unit.sha256 import SHA256Unit
from pyasic.device.algorithm.sha256 import SHA256Unit
from .unit import HashUnit
class SHA256HashRate(AlgoHashRateType): class SHA256HashRate(AlgoHashRateType):
rate: float rate: float
unit: SHA256Unit = MinerAlgo.SHA256.unit.default unit: SHA256Unit = HashUnit.SHA256.default
def __float__(self):
return float(self.rate)
def __int__(self):
return int(self.rate)
def __repr__(self):
return f"{self.rate} {str(self.unit)}"
def __round__(self, n: int = None):
return round(self.rate, n)
def __add__(self, other: SHA256HashRate | int | float) -> SHA256HashRate: def __add__(self, other: SHA256HashRate | int | float) -> SHA256HashRate:
if isinstance(other, SHA256HashRate): if isinstance(other, SHA256HashRate):

View File

@@ -0,0 +1,23 @@
from .blake256 import Blake256Unit
from .eaglesong import EaglesongUnit
from .equihash import EquihashUnit
from .ethash import EtHashUnit
from .handshake import HandshakeUnit
from .kadena import KadenaUnit
from .kheavyhash import KHeavyHashUnit
from .scrypt import ScryptUnit
from .sha256 import SHA256Unit
from .x11 import X11Unit
class HashUnit:
SHA256 = SHA256Unit
SCRYPT = ScryptUnit
KHEAVYHASH = KHeavyHashUnit
KADENA = KadenaUnit
HANDSHAKE = HandshakeUnit
X11 = X11Unit
BLAKE256 = Blake256Unit
EAGLESONG = EaglesongUnit
ETHASH = EtHashUnit
EQUIHASH = EquihashUnit

View File

@@ -0,0 +1,17 @@
from enum import IntEnum
class AlgoHashRateUnitType(IntEnum):
H: int
KH: int
MH: int
GH: int
TH: int
PH: int
EH: int
ZH: int
default: int
@classmethod
def from_str(cls, value):
return cls.default

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class Blake256Unit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class EaglesongUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class EquihashUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = KH
def __str__(self):
if self.value == self.H:
return "Sol/s"
if self.value == self.KH:
return "KSol/s"
if self.value == self.MH:
return "MSol/s"
if self.value == self.GH:
return "GSol/s"
if self.value == self.TH:
return "TSol/s"
if self.value == self.PH:
return "PSol/s"
if self.value == self.EH:
return "ESol/s"
if self.value == self.ZH:
return "ZSol/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class EtHashUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = MH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class HandshakeUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class KadenaUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class KHeavyHashUnit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from enum import IntEnum
class ScryptUnit(IntEnum):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = GH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class SHA256Unit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,57 @@
from __future__ import annotations
from .base import AlgoHashRateUnitType
class X11Unit(AlgoHashRateUnitType):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = GH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)

View File

@@ -0,0 +1,49 @@
from __future__ import annotations
from pyasic.device.algorithm.hashrate.base import AlgoHashRateType
from pyasic.device.algorithm.hashrate.unit.x11 import X11Unit
from .unit import HashUnit
class X11HashRate(AlgoHashRateType):
rate: float
unit: X11Unit = HashUnit.X11.default
def __add__(self, other: X11HashRate | int | float) -> X11HashRate:
if isinstance(other, X11HashRate):
return X11HashRate(
rate=self.rate + other.into(self.unit).rate, unit=self.unit
)
return X11HashRate(rate=self.rate + other, unit=self.unit)
def __sub__(self, other: X11HashRate | int | float) -> X11HashRate:
if isinstance(other, X11HashRate):
return X11HashRate(
rate=self.rate - other.into(self.unit).rate, unit=self.unit
)
return X11HashRate(rate=self.rate - other, unit=self.unit)
def __truediv__(self, other: X11HashRate | int | float):
if isinstance(other, X11HashRate):
return X11HashRate(
rate=self.rate / other.into(self.unit).rate, unit=self.unit
)
return X11HashRate(rate=self.rate / other, unit=self.unit)
def __floordiv__(self, other: X11HashRate | int | float):
if isinstance(other, X11HashRate):
return X11HashRate(
rate=self.rate // other.into(self.unit).rate, unit=self.unit
)
return X11HashRate(rate=self.rate // other, unit=self.unit)
def __mul__(self, other: X11HashRate | int | float):
if isinstance(other, X11HashRate):
return X11HashRate(
rate=self.rate * other.into(self.unit).rate, unit=self.unit
)
return X11HashRate(rate=self.rate * other, unit=self.unit)
def into(self, other: X11Unit) -> X11HashRate:
return X11HashRate(rate=self.rate / (other.value / self.unit.value), unit=other)

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import KadenaHashRate
from .hashrate.unit import KadenaUnit
# make this json serializable
class _KadenaAlgo(MinerAlgoType):
hashrate = KadenaHashRate
unit = KadenaUnit
def __repr__(self):
return "KadenaAlgo"
KadenaAlgo = _KadenaAlgo("Kadena")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import KHeavyHashHashRate
from .hashrate.unit import KHeavyHashUnit
# make this json serializable
class _KHeavyHashAlgo(MinerAlgoType):
hashrate = KHeavyHashHashRate
unit = KHeavyHashUnit
def __repr__(self):
return "KHeavyHashAlgo"
KHeavyHashAlgo = _KHeavyHashAlgo("KHeavyHash")

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import ScryptHashRate
from .hashrate.unit import ScryptUnit
# make this json serializable
class _ScryptAlgo(MinerAlgoType):
hashrate = ScryptHashRate
unit = ScryptUnit
def __repr__(self):
return "ScryptAlgo"
ScryptAlgo = _ScryptAlgo("Scrypt")

View File

@@ -1,66 +1,13 @@
from __future__ import annotations from __future__ import annotations
from enum import IntEnum
from .base import MinerAlgoType from .base import MinerAlgoType
from .hashrate import SHA256HashRate
from .hashrate.unit import SHA256Unit
class SHA256Unit(IntEnum):
H = 1
KH = int(H) * 1000
MH = int(KH) * 1000
GH = int(MH) * 1000
TH = int(GH) * 1000
PH = int(TH) * 1000
EH = int(PH) * 1000
ZH = int(EH) * 1000
default = TH
def __str__(self):
if self.value == self.H:
return "H/s"
if self.value == self.KH:
return "KH/s"
if self.value == self.MH:
return "MH/s"
if self.value == self.GH:
return "GH/s"
if self.value == self.TH:
return "TH/s"
if self.value == self.PH:
return "PH/s"
if self.value == self.EH:
return "EH/s"
if self.value == self.ZH:
return "ZH/s"
@classmethod
def from_str(cls, value: str):
if value == "H":
return cls.H
elif value == "KH":
return cls.KH
elif value == "MH":
return cls.MH
elif value == "GH":
return cls.GH
elif value == "TH":
return cls.TH
elif value == "PH":
return cls.PH
elif value == "EH":
return cls.EH
elif value == "ZH":
return cls.ZH
return cls.default
def __repr__(self):
return str(self)
# make this json serializable # make this json serializable
class _SHA256Algo(MinerAlgoType): class _SHA256Algo(MinerAlgoType):
hashrate = SHA256HashRate
unit = SHA256Unit unit = SHA256Unit
def __repr__(self): def __repr__(self):

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
from .base import MinerAlgoType
from .hashrate import X11HashRate
from .hashrate.unit import X11Unit
# make this json serializable
class _X11Algo(MinerAlgoType):
hashrate = X11HashRate
unit = X11Unit
def __repr__(self):
return "X11Algo"
X11Algo = _X11Algo("X11")

View File

@@ -18,7 +18,8 @@ from typing import List, Optional
import asyncssh import asyncssh
from pyasic.data import AlgoHashRate, HashBoard, HashUnit from pyasic.data import HashBoard
from pyasic.device.algorithm import AlgoHashRate, HashUnit
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.backends import Hiveon from pyasic.miners.backends import Hiveon
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand

View File

@@ -16,12 +16,13 @@
import logging import logging
from pathlib import Path from pathlib import Path
from typing import List, Optional, Union from typing import List, Optional
from pyasic.config import MinerConfig, MiningModeConfig from pyasic.config import MinerConfig, MiningModeConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData, X19Error from pyasic.data.error_codes import MinerErrorData, X19Error
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.backends.bmminer import BMMiner from pyasic.miners.backends.bmminer import BMMiner
from pyasic.miners.backends.cgminer import CGMiner from pyasic.miners.backends.cgminer import CGMiner
@@ -260,8 +261,8 @@ class AntminerModern(BMMiner):
if rpc_stats is not None: if rpc_stats is not None:
try: try:
for board in rpc_stats["STATS"][0]["chain"]: for board in rpc_stats["STATS"][0]["chain"]:
hashboards[board["index"]].hashrate = AlgoHashRate.SHA256( hashboards[board["index"]].hashrate = self.algo.hashrate(
rate=board["rate_real"], unit=HashUnit.SHA256.GH rate=board["rate_real"], unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[board["index"]].chips = board["asic_num"] hashboards[board["index"]].chips = board["asic_num"]
board_temp_data = list( board_temp_data = list(
@@ -317,8 +318,8 @@ class AntminerModern(BMMiner):
rate_unit = rpc_stats["STATS"][1]["rate_unit"] rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError: except KeyError:
rate_unit = "GH" rate_unit = "GH"
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_rate), unit=HashUnit.SHA256.from_str(rate_unit) rate=float(expected_rate), unit=self.algo.unit.from_str(rate_unit)
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass
@@ -624,8 +625,8 @@ class AntminerOld(CGMiner):
hashrate = boards[1].get(f"chain_rate{i}") hashrate = boards[1].get(f"chain_rate{i}")
if hashrate: if hashrate:
hashboard.hashrate = AlgoHashRate.SHA256( hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.GH 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

@@ -18,7 +18,8 @@ from enum import Enum
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import ( from pyasic.miners.data import (
DataFunction, DataFunction,
@@ -292,9 +293,9 @@ class Auradine(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 5s"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -322,8 +323,8 @@ class Auradine(StockFirmware):
try: try:
for board in rpc_devs["DEVS"]: for board in rpc_devs["DEVS"]:
b_id = board["ID"] - 1 b_id = board["ID"] - 1
hashboards[b_id].hashrate = AlgoHashRate.SHA256( hashboards[b_id].hashrate = self.algo.hashrate(
rate=float(board["MHS 5s"]), unit=HashUnit.SHA256.MH rate=float(board["MHS 5s"]), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[b_id].temp = round(float(board["Temperature"])) hashboards[b_id].temp = round(float(board["Temperature"]))
hashboards[b_id].missing = False hashboards[b_id].missing = False

View File

@@ -17,7 +17,8 @@
import re import re
from typing import List, Optional from typing import List, Optional
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.backends.cgminer import CGMiner from pyasic.miners.backends.cgminer import CGMiner
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
@@ -183,8 +184,8 @@ class AvalonMiner(CGMiner):
if rpc_devs is not None: if rpc_devs is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_devs["DEVS"][0]["MHS 1m"]), unit=HashUnit.SHA256.MH rate=float(rpc_devs["DEVS"][0]["MHS 1m"]), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (KeyError, IndexError, ValueError, TypeError): except (KeyError, IndexError, ValueError, TypeError):
pass pass
@@ -216,8 +217,8 @@ class AvalonMiner(CGMiner):
try: try:
board_hr = parsed_stats["MGHS"][board] board_hr = parsed_stats["MGHS"][board]
hashboards[board].hashrate = AlgoHashRate.SHA256( hashboards[board].hashrate = self.algo.hashrate(
rate=float(board_hr), unit=HashUnit.SHA256.GH rate=float(board_hr), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass
@@ -252,8 +253,8 @@ class AvalonMiner(CGMiner):
try: try:
unparsed_stats = rpc_stats["STATS"][0]["MM ID0"] unparsed_stats = rpc_stats["STATS"][0]["MM ID0"]
parsed_stats = self.parse_stats(unparsed_stats) parsed_stats = self.parse_stats(unparsed_stats)
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(parsed_stats["GHSmm"][0]), unit=HashUnit.SHA256.GH rate=float(parsed_stats["GHSmm"][0]), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (IndexError, KeyError, ValueError, TypeError): except (IndexError, KeyError, ValueError, TypeError):
pass pass

View File

@@ -17,8 +17,9 @@
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
from pyasic.miners.device.firmware import StockFirmware from pyasic.miners.device.firmware import StockFirmware
@@ -120,9 +121,9 @@ class BFGMiner(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 20s"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 20s"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -167,8 +168,8 @@ class BFGMiner(StockFirmware):
hashrate = boards[1].get(f"chain_rate{i}") hashrate = boards[1].get(f"chain_rate{i}")
if hashrate: if hashrate:
hashboard.hashrate = AlgoHashRate.SHA256( hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.GH 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}")
@@ -260,8 +261,8 @@ class BFGMiner(StockFirmware):
rate_unit = rpc_stats["STATS"][1]["rate_unit"] rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError: except KeyError:
rate_unit = "GH" rate_unit = "GH"
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_rate), unit=HashUnit.SHA256.from_str(rate_unit) rate=float(expected_rate), unit=self.algo.unit.from_str(rate_unit)
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass

View File

@@ -1,8 +1,9 @@
from typing import List, Optional from typing import List, Optional
from pyasic import APIError, MinerConfig from pyasic import APIError, MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.device import MinerFirmware from pyasic.device.algorithm import AlgoHashRate
from pyasic.device.firmware import MinerFirmware
from pyasic.miners.base import BaseMiner from pyasic.miners.base import BaseMiner
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand
from pyasic.web.bitaxe import BitAxeWebAPI from pyasic.web.bitaxe import BitAxeWebAPI
@@ -93,8 +94,8 @@ class BitAxe(BaseMiner):
if web_system_info is not None: if web_system_info is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(web_system_info["hashRate"]), unit=HashUnit.SHA256.GH rate=float(web_system_info["hashRate"]), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except KeyError: except KeyError:
pass pass
@@ -123,9 +124,9 @@ class BitAxe(BaseMiner):
try: try:
return [ return [
HashBoard( HashBoard(
hashrate=AlgoHashRate.SHA256( hashrate=self.algo.hashrate(
rate=float(web_system_info["hashRate"]), rate=float(web_system_info["hashRate"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default), ).into(self.algo.unit.default),
chip_temp=web_system_info.get("temp"), chip_temp=web_system_info.get("temp"),
temp=web_system_info.get("vrTemp"), temp=web_system_info.get("vrTemp"),

View File

@@ -17,8 +17,9 @@
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
from pyasic.miners.device.firmware import StockFirmware from pyasic.miners.device.firmware import StockFirmware
@@ -124,9 +125,9 @@ class BMMiner(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -184,8 +185,8 @@ class BMMiner(StockFirmware):
hashrate = boards[1].get(f"chain_rate{i}") hashrate = boards[1].get(f"chain_rate{i}")
if hashrate: if hashrate:
hashboard.hashrate = AlgoHashRate.SHA256( hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.GH 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}")
@@ -246,8 +247,8 @@ class BMMiner(StockFirmware):
rate_unit = rpc_stats["STATS"][1]["rate_unit"] rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError: except KeyError:
rate_unit = "GH" rate_unit = "GH"
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_rate), unit=HashUnit.SHA256.from_str(rate_unit) rate=float(expected_rate), unit=self.algo.unit.from_str(rate_unit)
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass

View File

@@ -29,9 +29,10 @@ except ImportError:
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.config.mining import MiningModePowerTune from pyasic.config.mining import MiningModePowerTune
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import BraiinsOSError, MinerErrorData from pyasic.data.error_codes import BraiinsOSError, MinerErrorData
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate, AlgoHashRateType
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import ( from pyasic.miners.data import (
DataFunction, DataFunction,
@@ -222,7 +223,7 @@ class BOSMiner(BraiinsOSFirmware):
cfg = await self.get_config() cfg = await self.get_config()
if cfg is None: if cfg is None:
return False return False
cfg.mining_mode = MiningModePowerTune(wattage) cfg.mining_mode = MiningModePowerTune(power=wattage)
await self.send_config(cfg) await self.send_config(cfg)
except APIError: except APIError:
raise raise
@@ -362,9 +363,9 @@ class BOSMiner(BraiinsOSFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (KeyError, IndexError, ValueError, TypeError): except (KeyError, IndexError, ValueError, TypeError):
pass pass
@@ -435,8 +436,8 @@ class BOSMiner(BraiinsOSFirmware):
for board in rpc_devs["DEVS"]: for board in rpc_devs["DEVS"]:
_id = board["ID"] - offset _id = board["ID"] - offset
hashboards[_id].hashrate = AlgoHashRate.SHA256( hashboards[_id].hashrate = self.algo.hashrate(
rate=float(board["MHS 1m"]), unit=HashUnit.SHA256.MH rate=float(board["MHS 1m"]), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (IndexError, KeyError): except (IndexError, KeyError):
pass pass
@@ -534,7 +535,7 @@ class BOSMiner(BraiinsOSFirmware):
async def _get_expected_hashrate( async def _get_expected_hashrate(
self, rpc_devs: dict = None self, rpc_devs: dict = None
) -> Optional[AlgoHashRate]: ) -> Optional[AlgoHashRateType]:
if rpc_devs is None: if rpc_devs is None:
try: try:
rpc_devs = await self.rpc.devs() rpc_devs = await self.rpc.devs()
@@ -546,18 +547,20 @@ class BOSMiner(BraiinsOSFirmware):
hr_list = [] hr_list = []
for board in rpc_devs["DEVS"]: for board in rpc_devs["DEVS"]:
expected_hashrate = float(board["Nominal MHS"] / 1000000) expected_hashrate = float(board["Nominal MHS"])
if expected_hashrate: if expected_hashrate:
hr_list.append(expected_hashrate) hr_list.append(expected_hashrate)
if len(hr_list) == 0: if len(hr_list) == 0:
return AlgoHashRate.SHA256(rate=float(0)) return self.algo.hashrate(
rate=float(0), unit=self.algo.unit.default
)
else: else:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float( rate=float(
(sum(hr_list) / len(hr_list)) * self.expected_hashboards (sum(hr_list) / len(hr_list)) * self.expected_hashboards
), ),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (IndexError, KeyError): except (IndexError, KeyError):
pass pass
@@ -895,9 +898,9 @@ class BOSer(BraiinsOSFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (KeyError, IndexError, ValueError, TypeError): except (KeyError, IndexError, ValueError, TypeError):
pass pass
@@ -913,11 +916,11 @@ class BOSer(BraiinsOSFirmware):
if grpc_miner_details is not None: if grpc_miner_details is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float( rate=float(
grpc_miner_details["stickerHashrate"]["gigahashPerSecond"] grpc_miner_details["stickerHashrate"]["gigahashPerSecond"]
), ),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass
@@ -949,13 +952,13 @@ class BOSer(BraiinsOSFirmware):
) )
if board.get("stats") is not None: if board.get("stats") is not None:
if not board["stats"]["realHashrate"]["last5S"] == {}: if not board["stats"]["realHashrate"]["last5S"] == {}:
hashboards[idx].hashrate = AlgoHashRate.SHA256( hashboards[idx].hashrate = self.algo.hashrate(
rate=float( rate=float(
board["stats"]["realHashrate"]["last5S"][ board["stats"]["realHashrate"]["last5S"][
"gigahashPerSecond" "gigahashPerSecond"
] ]
), ),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[idx].missing = False hashboards[idx].missing = False

View File

@@ -21,9 +21,10 @@ from typing import List, Optional
import aiofiles import aiofiles
from pyasic.config import MinerConfig, MiningModeConfig from pyasic.config import MinerConfig, MiningModeConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData, WhatsminerError from pyasic.data.error_codes import MinerErrorData, WhatsminerError
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
from pyasic.miners.device.firmware import StockFirmware from pyasic.miners.device.firmware import StockFirmware
@@ -403,9 +404,9 @@ class BTMiner(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass
@@ -434,8 +435,8 @@ class BTMiner(StockFirmware):
self.expected_hashboards += 1 self.expected_hashboards += 1
hashboards[board["ASC"]].chip_temp = round(board["Chip Temp Avg"]) hashboards[board["ASC"]].chip_temp = round(board["Chip Temp Avg"])
hashboards[board["ASC"]].temp = round(board["Temperature"]) hashboards[board["ASC"]].temp = round(board["Temperature"])
hashboards[board["ASC"]].hashrate = AlgoHashRate.SHA256( hashboards[board["ASC"]].hashrate = self.algo.hashrate(
rate=float(board["MHS 1m"]), unit=HashUnit.SHA256.MH rate=float(board["MHS 1m"]), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[board["ASC"]].chips = board["Effective Chips"] hashboards[board["ASC"]].chips = board["Effective Chips"]
hashboards[board["ASC"]].serial_number = board["PCB SN"] hashboards[board["ASC"]].serial_number = board["PCB SN"]
@@ -584,8 +585,8 @@ class BTMiner(StockFirmware):
try: try:
expected_hashrate = rpc_summary["SUMMARY"][0]["Factory GHS"] expected_hashrate = rpc_summary["SUMMARY"][0]["Factory GHS"]
if expected_hashrate: if expected_hashrate:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_hashrate), unit=HashUnit.SHA256.GH rate=float(expected_hashrate), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:

View File

@@ -17,8 +17,8 @@
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, HashUnit
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
from pyasic.miners.device.firmware import StockFirmware from pyasic.miners.device.firmware import StockFirmware
@@ -123,9 +123,9 @@ class CGMiner(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass

View File

@@ -18,9 +18,10 @@ from pathlib import Path
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData, X19Error from pyasic.data.error_codes import MinerErrorData, X19Error
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.logger import logger from pyasic.logger import logger
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand
@@ -234,9 +235,9 @@ class ePIC(ePICFirmware):
if web_summary["HBs"] is not None: if web_summary["HBs"] is not None:
for hb in web_summary["HBs"]: for hb in web_summary["HBs"]:
hashrate += hb["Hashrate"][0] hashrate += hb["Hashrate"][0]
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.MH rate=float(hashrate), unit=self.algo.unit.MH
).into(HashUnit.SHA256.TH) ).into(self.algo.unit.TH)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -260,8 +261,8 @@ class ePIC(ePICFirmware):
ideal = hb["Hashrate"][1] / 100 ideal = hb["Hashrate"][1] / 100
hashrate += hb["Hashrate"][0] / ideal hashrate += hb["Hashrate"][0] / ideal
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.MH rate=float(hashrate), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -352,8 +353,8 @@ class ePIC(ePICFirmware):
hashrate = hb["Hashrate"][0] hashrate = hb["Hashrate"][0]
# Update the Hashboard object # Update the Hashboard object
hb_list[hb["Index"]].missing = False hb_list[hb["Index"]].missing = False
hb_list[hb["Index"]].hashrate = AlgoHashRate.SHA256( hb_list[hb["Index"]].hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.MH rate=float(hashrate), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hb_list[hb["Index"]].chips = num_of_chips hb_list[hb["Index"]].chips = num_of_chips
hb_list[hb["Index"]].temp = int(hb["Temperature"]) hb_list[hb["Index"]].temp = int(hb["Temperature"])

View File

@@ -16,7 +16,7 @@
from typing import List from typing import List
from pyasic.config import MinerConfig, MiningModeConfig from pyasic.config import MinerConfig, MiningModeConfig
from pyasic.data import AlgoHashRate, HashBoard, HashUnit from pyasic.data import HashBoard
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.logger import logger from pyasic.logger import logger
from pyasic.miners.backends import BFGMiner from pyasic.miners.backends import BFGMiner
@@ -162,8 +162,8 @@ class GoldshellMiner(BFGMiner):
if board.get("ID") is not None: if board.get("ID") is not None:
try: try:
b_id = board["ID"] b_id = board["ID"]
hashboards[b_id].hashrate = AlgoHashRate.SHA256( hashboards[b_id].hashrate = self.algo.hashrate(
rate=float(board["MHS 20s"]), unit=HashUnit.SHA256.MH rate=float(board["MHS 20s"]), unit=self.algo.unit.MH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[b_id].temp = board["tstemp-2"] hashboards[b_id].temp = board["tstemp-2"]
hashboards[b_id].missing = False hashboards[b_id].missing = False

View File

@@ -17,9 +17,10 @@
from typing import List, Optional from typing import List, Optional
from pyasic import MinerConfig from pyasic import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData, X19Error from pyasic.data.error_codes import MinerErrorData, X19Error
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import ( from pyasic.miners.data import (
DataFunction, DataFunction,
@@ -171,9 +172,9 @@ class BlackMiner(StockFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -231,8 +232,8 @@ 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 = AlgoHashRate.SHA256( hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.GH 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}")
@@ -364,8 +365,8 @@ class BlackMiner(StockFirmware):
rate_unit = rpc_stats["STATS"][1]["rate_unit"] rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError: except KeyError:
rate_unit = "GH" rate_unit = "GH"
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_rate), unit=HashUnit.SHA256.from_str(rate_unit) rate=float(expected_rate), unit=self.algo.unit.from_str(rate_unit)
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass

View File

@@ -1,9 +1,9 @@
from typing import List, Optional from typing import List, Optional
from pyasic import MinerConfig from pyasic import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device import MinerAlgo from pyasic.device.algorithm import AlgoHashRate, MinerAlgo
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand
from pyasic.miners.device.firmware import StockFirmware from pyasic.miners.device.firmware import StockFirmware
@@ -131,7 +131,7 @@ class IceRiver(StockFirmware):
if web_userpanel is not None: if web_userpanel is not None:
try: try:
base_unit = web_userpanel["userpanel"]["data"]["unit"] base_unit = web_userpanel["userpanel"]["data"]["unit"]
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float( rate=float(
web_userpanel["userpanel"]["data"]["rtpow"].replace( web_userpanel["userpanel"]["data"]["rtpow"].replace(
base_unit, "" base_unit, ""
@@ -187,9 +187,9 @@ class IceRiver(StockFirmware):
idx = int(board["no"] - 1) idx = int(board["no"] - 1)
hb_list[idx].chip_temp = round(board["outtmp"]) hb_list[idx].chip_temp = round(board["outtmp"])
hb_list[idx].temp = round(board["intmp"]) hb_list[idx].temp = round(board["intmp"])
hb_list[idx].hashrate = AlgoHashRate.SHA256( hb_list[idx].hashrate = self.algo.hashrate(
rate=float(board["rtpow"].replace("G", "")), rate=float(board["rtpow"].replace("G", "")),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hb_list[idx].chips = int(board["chipnum"]) hb_list[idx].chips = int(board["chipnum"])
hb_list[idx].missing = False hb_list[idx].missing = False

View File

@@ -16,10 +16,11 @@
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.data.error_codes.innosilicon import InnosiliconError from pyasic.data.error_codes.innosilicon import InnosiliconError
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.backends import CGMiner from pyasic.miners.backends import CGMiner
from pyasic.miners.data import ( from pyasic.miners.data import (
@@ -186,23 +187,23 @@ class Innosilicon(CGMiner):
if web_get_all is not None: if web_get_all is not None:
try: try:
if "Hash Rate H" in web_get_all["total_hash"].keys(): if "Hash Rate H" in web_get_all["total_hash"].keys():
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(web_get_all["total_hash"]["Hash Rate H"]), rate=float(web_get_all["total_hash"]["Hash Rate H"]),
unit=HashUnit.SHA256.H, unit=self.algo.unit.H,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
elif "Hash Rate" in web_get_all["total_hash"].keys(): elif "Hash Rate" in web_get_all["total_hash"].keys():
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(web_get_all["total_hash"]["Hash Rate"]), rate=float(web_get_all["total_hash"]["Hash Rate"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except KeyError: except KeyError:
pass pass
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]), rate=float(rpc_summary["SUMMARY"][0]["MHS 1m"]),
unit=HashUnit.SHA256.MH, unit=self.algo.unit.MH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (KeyError, IndexError): except (KeyError, IndexError):
pass pass
@@ -255,8 +256,8 @@ class Innosilicon(CGMiner):
hashrate = board.get("Hash Rate H") hashrate = board.get("Hash Rate H")
if hashrate: if hashrate:
hashboards[idx].hashrate = AlgoHashRate.SHA256( hashboards[idx].hashrate = self.algo.hashrate(
rate=float(hashrate), unit=HashUnit.SHA256.H rate=float(hashrate), unit=self.algo.unit.H
).into(self.algo.unit.default) ).into(self.algo.unit.default)
chip_temp = board.get("Temp max") chip_temp = board.get("Temp max")

View File

@@ -17,8 +17,9 @@ import logging
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand
from pyasic.miners.device.firmware import LuxOSFirmware from pyasic.miners.device.firmware import LuxOSFirmware
@@ -178,9 +179,9 @@ class LUXMiner(LuxOSFirmware):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass
@@ -202,9 +203,9 @@ class LUXMiner(LuxOSFirmware):
board_stats = rpc_stats["STATS"][1] board_stats = rpc_stats["STATS"][1]
for idx in range(3): for idx in range(3):
board_n = idx + 1 board_n = idx + 1
hashboards[idx].hashrate = AlgoHashRate.SHA256( hashboards[idx].hashrate = self.algo.hashrate(
rate=float(board_stats[f"chain_rate{board_n}"]), rate=float(board_stats[f"chain_rate{board_n}"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[idx].chips = int(board_stats[f"chain_acn{board_n}"]) hashboards[idx].chips = int(board_stats[f"chain_acn{board_n}"])
chip_temp_data = list( chip_temp_data = list(
@@ -276,8 +277,8 @@ class LUXMiner(LuxOSFirmware):
rate_unit = rpc_stats["STATS"][1]["rate_unit"] rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError: except KeyError:
rate_unit = "GH" rate_unit = "GH"
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(expected_rate), unit=HashUnit.SHA256.from_str(rate_unit) rate=float(expected_rate), unit=self.algo.unit.from_str(rate_unit)
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass

View File

@@ -2,8 +2,9 @@ from typing import List, Optional
from pyasic import MinerConfig from pyasic import MinerConfig
from pyasic.config import MiningModeConfig from pyasic.config import MiningModeConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit from pyasic.data import Fan, HashBoard
from pyasic.data.pools import PoolMetrics, PoolUrl from pyasic.data.pools import PoolMetrics, PoolUrl
from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand
from pyasic.miners.device.firmware import MaraFirmware from pyasic.miners.device.firmware import MaraFirmware
@@ -178,8 +179,8 @@ class MaraMiner(MaraFirmware):
try: try:
for hb in web_hashboards["hashboards"]: for hb in web_hashboards["hashboards"]:
idx = hb["index"] idx = hb["index"]
hashboards[idx].hashrate = AlgoHashRate.SHA256( hashboards[idx].hashrate = self.algo.hashrate(
rate=float(hb["hashrate_average"]), unit=HashUnit.SHA256.GH rate=float(hb["hashrate_average"]), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
hashboards[idx].temp = round( hashboards[idx].temp = round(
sum(hb["temperature_pcb"]) / len(hb["temperature_pcb"]) sum(hb["temperature_pcb"]) / len(hb["temperature_pcb"])
@@ -242,8 +243,8 @@ class MaraMiner(MaraFirmware):
if web_brief is not None: if web_brief is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(web_brief["hashrate_realtime"]), unit=HashUnit.SHA256.TH rate=float(web_brief["hashrate_realtime"]), unit=self.algo.unit.TH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass
@@ -290,8 +291,8 @@ class MaraMiner(MaraFirmware):
if web_brief is not None: if web_brief is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(web_brief["hashrate_ideal"]), unit=HashUnit.SHA256.GH rate=float(web_brief["hashrate_ideal"]), unit=self.algo.unit.GH
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except LookupError: except LookupError:
pass pass

View File

@@ -15,8 +15,9 @@
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.device.algorithm import AlgoHashRate
from pyasic.miners.base import BaseMiner from pyasic.miners.base import BaseMiner
from pyasic.rpc.unknown import UnknownRPCAPI from pyasic.rpc.unknown import UnknownRPCAPI

View File

@@ -17,7 +17,7 @@
from typing import Optional from typing import Optional
from pyasic import MinerConfig from pyasic import MinerConfig
from pyasic.data import AlgoHashRate, HashUnit from pyasic.device.algorithm import AlgoHashRate
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.backends.bmminer import BMMiner from pyasic.miners.backends.bmminer import BMMiner
from pyasic.miners.data import ( from pyasic.miners.data import (
@@ -207,9 +207,9 @@ class VNish(VNishFirmware, BMMiner):
if rpc_summary is not None: if rpc_summary is not None:
try: try:
return AlgoHashRate.SHA256( return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]), rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=HashUnit.SHA256.GH, unit=self.algo.unit.GH,
).into(self.algo.unit.default) ).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError): except (LookupError, ValueError, TypeError):
pass pass

View File

@@ -19,14 +19,15 @@ import warnings
from typing import List, Optional, Protocol, Tuple, Type, TypeVar, Union from typing import List, Optional, Protocol, Tuple, Type, TypeVar, Union
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import AlgoHashRate, Fan, HashBoard, MinerData from pyasic.data import Fan, HashBoard, MinerData
from pyasic.data.device import DeviceInfo 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 import MinerModel from pyasic.device.algorithm import MinerAlgoType
from pyasic.device.algorithm import MinerAlgo 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
from pyasic.device.models import MinerModelType
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.logger import logger from pyasic.logger import logger
from pyasic.miners.data import DataLocations, DataOptions, RPCAPICommand, WebAPICommand from pyasic.miners.data import DataLocations, DataOptions, RPCAPICommand, WebAPICommand
@@ -43,13 +44,13 @@ class MinerProtocol(Protocol):
ssh: _ssh_cls = None ssh: _ssh_cls = None
make: MinerMake = None make: MinerMake = None
raw_model: MinerModel = None raw_model: MinerModelType = None
firmware: MinerFirmware = None firmware: MinerFirmware = None
algo = MinerAlgo.SHA256 algo: MinerAlgoType = None
expected_hashboards: int = 3 expected_hashboards: int = None
expected_chips: int = None expected_chips: int = None
expected_fans: int = 2 expected_fans: int = None
data_locations: DataLocations = None data_locations: DataLocations = None

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,9 +22,15 @@ class Z15(AntMinerMake):
raw_model = MinerModel.ANTMINER.Z15 raw_model = MinerModel.ANTMINER.Z15
expected_chips = 3 expected_chips = 3
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.EQUIHASH
class Z15Pro(AntMinerMake): class Z15Pro(AntMinerMake):
raw_model = MinerModel.ANTMINER.Z15Pro raw_model = MinerModel.ANTMINER.Z15Pro
expected_chips = 6 expected_chips = 6
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.EQUIHASH

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,6 +23,8 @@ class S17(AntMinerMake):
expected_chips = 48 expected_chips = 48
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S17Plus(AntMinerMake): class S17Plus(AntMinerMake):
@@ -29,6 +32,8 @@ class S17Plus(AntMinerMake):
expected_chips = 65 expected_chips = 65
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S17Pro(AntMinerMake): class S17Pro(AntMinerMake):
@@ -36,6 +41,8 @@ class S17Pro(AntMinerMake):
expected_chips = 48 expected_chips = 48
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S17e(AntMinerMake): class S17e(AntMinerMake):
@@ -43,3 +50,5 @@ class S17e(AntMinerMake):
expected_chips = 135 expected_chips = 135
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,6 +23,8 @@ class T17(AntMinerMake):
expected_chips = 30 expected_chips = 30
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class T17Plus(AntMinerMake): class T17Plus(AntMinerMake):
@@ -29,6 +32,8 @@ class T17Plus(AntMinerMake):
expected_chips = 44 expected_chips = 44
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class T17e(AntMinerMake): class T17e(AntMinerMake):
@@ -36,3 +41,5 @@ class T17e(AntMinerMake):
expected_chips = 78 expected_chips = 78
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,6 +23,8 @@ class S19(AntMinerMake):
expected_chips = 76 expected_chips = 76
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19NoPIC(AntMinerMake): class S19NoPIC(AntMinerMake):
@@ -29,6 +32,8 @@ class S19NoPIC(AntMinerMake):
expected_chips = 88 expected_chips = 88
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19Pro(AntMinerMake): class S19Pro(AntMinerMake):
@@ -36,6 +41,8 @@ class S19Pro(AntMinerMake):
expected_chips = 114 expected_chips = 114
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19i(AntMinerMake): class S19i(AntMinerMake):
@@ -43,6 +50,8 @@ class S19i(AntMinerMake):
expected_chips = 80 expected_chips = 80
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19Plus(AntMinerMake): class S19Plus(AntMinerMake):
@@ -50,6 +59,8 @@ class S19Plus(AntMinerMake):
expected_chips = 80 expected_chips = 80
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19ProPlus(AntMinerMake): class S19ProPlus(AntMinerMake):
@@ -57,6 +68,8 @@ class S19ProPlus(AntMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19XP(AntMinerMake): class S19XP(AntMinerMake):
@@ -64,6 +77,8 @@ class S19XP(AntMinerMake):
expected_chips = 110 expected_chips = 110
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19a(AntMinerMake): class S19a(AntMinerMake):
@@ -71,6 +86,8 @@ class S19a(AntMinerMake):
expected_chips = 72 expected_chips = 72
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19aPro(AntMinerMake): class S19aPro(AntMinerMake):
@@ -78,6 +95,8 @@ class S19aPro(AntMinerMake):
expected_chips = 100 expected_chips = 100
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19j(AntMinerMake): class S19j(AntMinerMake):
@@ -85,6 +104,8 @@ class S19j(AntMinerMake):
expected_chips = 114 expected_chips = 114
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19jNoPIC(AntMinerMake): class S19jNoPIC(AntMinerMake):
@@ -92,6 +113,8 @@ class S19jNoPIC(AntMinerMake):
expected_chips = 88 expected_chips = 88
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19jPro(AntMinerMake): class S19jPro(AntMinerMake):
@@ -99,6 +122,8 @@ class S19jPro(AntMinerMake):
expected_chips = 126 expected_chips = 126
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19jProNoPIC(AntMinerMake): class S19jProNoPIC(AntMinerMake):
@@ -106,6 +131,8 @@ class S19jProNoPIC(AntMinerMake):
expected_chips = 126 expected_chips = 126
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19jProPlus(AntMinerMake): class S19jProPlus(AntMinerMake):
@@ -113,6 +140,8 @@ class S19jProPlus(AntMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19jProPlusNoPIC(AntMinerMake): class S19jProPlusNoPIC(AntMinerMake):
@@ -120,6 +149,8 @@ class S19jProPlusNoPIC(AntMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19kPro(AntMinerMake): class S19kPro(AntMinerMake):
@@ -127,6 +158,8 @@ class S19kPro(AntMinerMake):
expected_chips = 77 expected_chips = 77
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19kProNoPIC(AntMinerMake): class S19kProNoPIC(AntMinerMake):
@@ -134,6 +167,8 @@ class S19kProNoPIC(AntMinerMake):
expected_chips = 77 expected_chips = 77
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19L(AntMinerMake): class S19L(AntMinerMake):
@@ -141,6 +176,8 @@ class S19L(AntMinerMake):
expected_chips = 76 expected_chips = 76
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S19Hydro(AntMinerMake): class S19Hydro(AntMinerMake):
@@ -149,6 +186,7 @@ class S19Hydro(AntMinerMake):
expected_chips = 104 expected_chips = 104
expected_hashboards = 4 expected_hashboards = 4
expected_fans = 0 expected_fans = 0
algo = MinerAlgo.SHA256
class S19ProHydro(AntMinerMake): class S19ProHydro(AntMinerMake):
@@ -157,6 +195,7 @@ class S19ProHydro(AntMinerMake):
expected_chips = 180 expected_chips = 180
expected_hashboards = 4 expected_hashboards = 4
expected_fans = 0 expected_fans = 0
algo = MinerAlgo.SHA256
class S19ProPlusHydro(AntMinerMake): class S19ProPlusHydro(AntMinerMake):
@@ -165,6 +204,7 @@ class S19ProPlusHydro(AntMinerMake):
expected_chips = 180 expected_chips = 180
expected_hashboards = 4 expected_hashboards = 4
expected_fans = 0 expected_fans = 0
algo = MinerAlgo.SHA256
class S19KPro(AntMinerMake): class S19KPro(AntMinerMake):
@@ -172,3 +212,5 @@ class S19KPro(AntMinerMake):
expected_chips = 77 expected_chips = 77
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,3 +23,5 @@ class T19(AntMinerMake):
expected_chips = 76 expected_chips = 76
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,6 +23,8 @@ class S21(AntMinerMake):
expected_chips = 108 expected_chips = 108
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class S21Pro(AntMinerMake): class S21Pro(AntMinerMake):
@@ -29,3 +32,5 @@ class S21Pro(AntMinerMake):
expected_chips = 65 expected_chips = 65
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,3 +23,5 @@ class T21(AntMinerMake):
expected_chips = 108 expected_chips = 108
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class D3(AntMinerMake):
raw_model = MinerModel.ANTMINER.D3 raw_model = MinerModel.ANTMINER.D3
expected_chips = 60 expected_chips = 60
expected_hashboards = 3
expected_fans = 4
algo = MinerAlgo.X11

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class HS3(AntMinerMake):
raw_model = MinerModel.ANTMINER.HS3 raw_model = MinerModel.ANTMINER.HS3
expected_chips = 92 expected_chips = 92
expected_hashboards = 3
expected_fans = 4
algo = MinerAlgo.HANDSHAKE

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class KA3(AntMinerMake):
raw_model = MinerModel.ANTMINER.KA3 raw_model = MinerModel.ANTMINER.KA3
expected_chips = 92 expected_chips = 92
expected_hashboards = 3
expected_fans = 4
algo = MinerAlgo.KADENA

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,3 +23,5 @@ class KS3(AntMinerMake):
expected_chips = 92 expected_chips = 92
expected_fans = 2 expected_fans = 2
expected_hashboards = 3
algo = MinerAlgo.KHEAVYHASH

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class L3Plus(AntMinerMake):
raw_model = MinerModel.ANTMINER.L3Plus raw_model = MinerModel.ANTMINER.L3Plus
expected_chips = 72 expected_chips = 72
expected_hashboards = 4
expected_fans = 2
algo = MinerAlgo.SCRYPT

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class DR5(AntMinerMake):
raw_model = MinerModel.ANTMINER.DR5 raw_model = MinerModel.ANTMINER.DR5
expected_chips = 72 expected_chips = 72
expected_fans = 2
expected_hashboards = 3
algo = MinerAlgo.BLAKE256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class KS5(AntMinerMake):
raw_model = MinerModel.ANTMINER.KS5 raw_model = MinerModel.ANTMINER.KS5
expected_chips = 92 expected_chips = 92
expected_hashboards = 3
expected_fans = 4
algo = MinerAlgo.KHEAVYHASH

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,3 +23,5 @@ class D7(AntMinerMake):
expected_fans = 4 expected_fans = 4
expected_chips = 70 expected_chips = 70
expected_hashboards = 3
algo = MinerAlgo.X11

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,4 +22,6 @@ class K7(AntMinerMake):
raw_model = MinerModel.ANTMINER.K7 raw_model = MinerModel.ANTMINER.K7
expected_chips = 92 expected_chips = 92
expected_fans = 4 expected_fans = 2
expected_hashboards = 3
algo = MinerAlgo.EAGLESONG

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -22,3 +23,5 @@ class L7(AntMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SCRYPT

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class D9(AntMinerMake):
raw_model = MinerModel.ANTMINER.D9 raw_model = MinerModel.ANTMINER.D9
expected_chips = 126 expected_chips = 126
expected_hashboards = 3
expected_fans = 4
algo = MinerAlgo.X11

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -23,3 +24,4 @@ class E9Pro(AntMinerMake):
expected_chips = 8 expected_chips = 8
expected_hashboards = 2 expected_hashboards = 2
expected_fans = 4 expected_fans = 4
algo = MinerAlgo.ETHASH

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,15 +22,24 @@ class S9(AntMinerMake):
raw_model = MinerModel.ANTMINER.S9 raw_model = MinerModel.ANTMINER.S9
expected_chips = 63 expected_chips = 63
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256
class S9i(AntMinerMake): class S9i(AntMinerMake):
raw_model = MinerModel.ANTMINER.S9i raw_model = MinerModel.ANTMINER.S9i
expected_chips = 63 expected_chips = 63
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256
class S9j(AntMinerMake): class S9j(AntMinerMake):
raw_model = MinerModel.ANTMINER.S9j raw_model = MinerModel.ANTMINER.S9j
expected_chips = 63 expected_chips = 63
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AntMinerMake from pyasic.miners.device.makes import AntMinerMake
@@ -21,3 +22,6 @@ class T9(AntMinerMake):
raw_model = MinerModel.ANTMINER.T9 raw_model = MinerModel.ANTMINER.T9
expected_chips = 54 expected_chips = 54
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -6,3 +7,5 @@ class AuradineAD2500(AuradineMake):
raw_model = MinerModel.AURADINE.AD2500 raw_model = MinerModel.AURADINE.AD2500
expected_fans = 0 expected_fans = 0
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -6,3 +7,5 @@ class AuradineAD3500(AuradineMake):
raw_model = MinerModel.AURADINE.AD3500 raw_model = MinerModel.AURADINE.AD3500
expected_fans = 0 expected_fans = 0
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -6,3 +7,5 @@ class AuradineAI2500(AuradineMake):
raw_model = MinerModel.AURADINE.AI2500 raw_model = MinerModel.AURADINE.AI2500
expected_fans = 0 expected_fans = 0
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -6,3 +7,5 @@ class AuradineAI3680(AuradineMake):
raw_model = MinerModel.AURADINE.AI3680 raw_model = MinerModel.AURADINE.AI3680
expected_fans = 0 expected_fans = 0
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -7,3 +8,5 @@ class AuradineAT1500(AuradineMake):
expected_chips = 132 expected_chips = 132
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -1,3 +1,4 @@
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AuradineMake from pyasic.miners.device.makes import AuradineMake
@@ -6,9 +7,13 @@ class AuradineAT2860(AuradineMake):
raw_model = MinerModel.AURADINE.AT2860 raw_model = MinerModel.AURADINE.AT2860
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
class AuradineAT2880(AuradineMake): class AuradineAT2880(AuradineMake):
raw_model = MinerModel.AURADINE.AT2880 raw_model = MinerModel.AURADINE.AT2880
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -21,3 +22,6 @@ class Avalon1026(AvalonMinerMake):
raw_model = MinerModel.AVALONMINER.Avalon1026 raw_model = MinerModel.AVALONMINER.Avalon1026
expected_chips = 80 expected_chips = 80
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -21,3 +22,6 @@ class Avalon1047(AvalonMinerMake):
raw_model = MinerModel.AVALONMINER.Avalon1047 raw_model = MinerModel.AVALONMINER.Avalon1047
expected_chips = 80 expected_chips = 80
expected_hashboards = 3
expected_fans = 2
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -21,3 +22,5 @@ class Avalon1066(AvalonMinerMake):
raw_model = MinerModel.AVALONMINER.Avalon1066 raw_model = MinerModel.AVALONMINER.Avalon1066
expected_chips = 114 expected_chips = 114
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -22,3 +23,5 @@ class Avalon1166Pro(AvalonMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -22,3 +23,5 @@ class Avalon1246(AvalonMinerMake):
expected_chips = 120 expected_chips = 120
expected_fans = 4 expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon721(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 18 expected_chips = 18
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon741(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 22 expected_chips = 22
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon761(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 18 expected_chips = 18
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon821(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 26 expected_chips = 26
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon841(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 26 expected_chips = 26
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon851(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 26 expected_chips = 26
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -23,3 +24,4 @@ class Avalon921(AvalonMinerMake):
expected_hashboards = 4 expected_hashboards = 4
expected_chips = 26 expected_chips = 26
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

View File

@@ -1,4 +1,5 @@
from pyasic.device import MinerModel from pyasic.device.algorithm import MinerAlgo
from pyasic.device.models import MinerModel
from pyasic.miners.device.makes import AvalonMinerMake from pyasic.miners.device.makes import AvalonMinerMake
@@ -8,3 +9,4 @@ class AvalonNano3(AvalonMinerMake):
expected_hashboards = 1 expected_hashboards = 1
expected_chips = 10 expected_chips = 10
expected_fans = 1 expected_fans = 1
algo = MinerAlgo.SHA256

Some files were not shown because too many files have changed in this diff Show More