Merge branch 'UpstreamData:master' into add_blockminer_support
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
[](https://github.com/UpstreamData/pyasic/commits/master/)
|
[](https://github.com/UpstreamData/pyasic/commits/master/)
|
||||||
|
|
||||||
[](https://github.com/psf/black)
|
[](https://github.com/psf/black)
|
||||||
[](https://pyasic.readthedocs.io/en/latest/)
|
[](https://docs.pyasic.org)
|
||||||
[](https://github.com/UpstreamData/pyasic/blob/master/LICENSE.txt)
|
[](https://github.com/UpstreamData/pyasic/blob/master/LICENSE.txt)
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
Welcome to `pyasic`! `pyasic` uses an asynchronous method of communicating with ASIC miners on your network, which makes it super fast.
|
Welcome to `pyasic`! `pyasic` uses an asynchronous method of communicating with ASIC miners on your network, which makes it super fast.
|
||||||
|
|
||||||
[Click here to view supported miner types](miners/supported_types.md)
|
[Click here to view supported miner types](https://docs.pyasic.org/en/latest/miners/supported_types/)
|
||||||
|
|
||||||
---
|
---
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ class MinerData:
|
|||||||
percent_expected_wattage: float = field(init=False)
|
percent_expected_wattage: float = field(init=False)
|
||||||
nominal: bool = field(init=False)
|
nominal: bool = field(init=False)
|
||||||
config: MinerConfig = None
|
config: MinerConfig = None
|
||||||
errors: List[Union[WhatsminerError, BraiinsOSError, X19Error, InnosiliconError]] = (
|
errors: List[
|
||||||
field(default_factory=list)
|
Union[WhatsminerError, BraiinsOSError, X19Error, InnosiliconError]
|
||||||
)
|
] = field(default_factory=list)
|
||||||
fault_light: Union[bool, None] = None
|
fault_light: Union[bool, None] = None
|
||||||
efficiency: int = field(init=False)
|
efficiency: int = field(init=False)
|
||||||
is_mining: bool = True
|
is_mining: bool = True
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ class AntminerModern(BMMiner):
|
|||||||
data_locations = ANTMINER_MODERN_DATA_LOC
|
data_locations = ANTMINER_MODERN_DATA_LOC
|
||||||
|
|
||||||
supports_shutdown = True
|
supports_shutdown = True
|
||||||
|
supports_power_modes = True
|
||||||
|
|
||||||
async def get_config(self) -> MinerConfig:
|
async def get_config(self) -> MinerConfig:
|
||||||
data = await self.web.get_miner_conf()
|
data = await self.web.get_miner_conf()
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ class Auradine(BaseMiner):
|
|||||||
data_locations = AURADINE_DATA_LOC
|
data_locations = AURADINE_DATA_LOC
|
||||||
|
|
||||||
supports_shutdown = True
|
supports_shutdown = True
|
||||||
|
supports_power_modes = True
|
||||||
supports_autotuning = True
|
supports_autotuning = True
|
||||||
|
|
||||||
async def fault_light_on(self) -> bool:
|
async def fault_light_on(self) -> bool:
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class BTMiner(BaseMiner):
|
|||||||
data_locations = BTMINER_DATA_LOC
|
data_locations = BTMINER_DATA_LOC
|
||||||
|
|
||||||
supports_shutdown = True
|
supports_shutdown = True
|
||||||
|
supports_power_modes = True
|
||||||
|
|
||||||
async def _reset_rpc_pwd_to_admin(self, pwd: str):
|
async def _reset_rpc_pwd_to_admin(self, pwd: str):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class GoldshellMiner(BFGMiner):
|
|||||||
data_locations = GOLDSHELL_DATA_LOC
|
data_locations = GOLDSHELL_DATA_LOC
|
||||||
|
|
||||||
supports_shutdown = True
|
supports_shutdown = True
|
||||||
|
supports_power_modes = True
|
||||||
|
|
||||||
async def get_config(self) -> MinerConfig:
|
async def get_config(self) -> MinerConfig:
|
||||||
# get pool data
|
# get pool data
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class MinerProtocol(Protocol):
|
|||||||
data_locations: DataLocations = None
|
data_locations: DataLocations = None
|
||||||
|
|
||||||
supports_shutdown: bool = False
|
supports_shutdown: bool = False
|
||||||
|
supports_power_modes: bool = False
|
||||||
supports_autotuning: bool = False
|
supports_autotuning: bool = False
|
||||||
|
|
||||||
api_ver: str = None
|
api_ver: str = None
|
||||||
@@ -68,7 +69,12 @@ class MinerProtocol(Protocol):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def model(self) -> str:
|
def model(self) -> str:
|
||||||
model_data = [self.raw_model if self.raw_model is not None else "Unknown"]
|
if self.raw_model is not None:
|
||||||
|
model_data = [self.raw_model]
|
||||||
|
elif self.make is not None:
|
||||||
|
model_data = [self.make]
|
||||||
|
else:
|
||||||
|
model_data = ["Unknown"]
|
||||||
if self.firmware is not None:
|
if self.firmware is not None:
|
||||||
model_data.append(f"({self.firmware})")
|
model_data.append(f"({self.firmware})")
|
||||||
return " ".join(model_data)
|
return " ".join(model_data)
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ from pyasic.miners.backends.unknown import UnknownMiner
|
|||||||
from pyasic.miners.base import AnyMiner
|
from pyasic.miners.base import AnyMiner
|
||||||
from pyasic.miners.goldshell import *
|
from pyasic.miners.goldshell import *
|
||||||
from pyasic.miners.innosilicon import *
|
from pyasic.miners.innosilicon import *
|
||||||
|
from pyasic.miners.makes import *
|
||||||
from pyasic.miners.whatsminer import *
|
from pyasic.miners.whatsminer import *
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@ class MinerTypes(enum.Enum):
|
|||||||
|
|
||||||
MINER_CLASSES = {
|
MINER_CLASSES = {
|
||||||
MinerTypes.ANTMINER: {
|
MinerTypes.ANTMINER: {
|
||||||
None: BMMiner,
|
None: type("AntminerUnknown", (BMMiner, AntMinerMake), {}),
|
||||||
"ANTMINER D3": CGMinerD3,
|
"ANTMINER D3": CGMinerD3,
|
||||||
"ANTMINER HS3": BMMinerHS3,
|
"ANTMINER HS3": BMMinerHS3,
|
||||||
"ANTMINER L3+": BMMinerL3Plus,
|
"ANTMINER L3+": BMMinerL3Plus,
|
||||||
@@ -102,7 +103,7 @@ MINER_CLASSES = {
|
|||||||
"ANTMINER T19": BMMinerT19,
|
"ANTMINER T19": BMMinerT19,
|
||||||
},
|
},
|
||||||
MinerTypes.WHATSMINER: {
|
MinerTypes.WHATSMINER: {
|
||||||
None: BTMiner,
|
None: type("WhatsminerUnknown", (BTMiner, WhatsMinerMake), {}),
|
||||||
"M20V10": BTMinerM20V10,
|
"M20V10": BTMinerM20V10,
|
||||||
"M20SV10": BTMinerM20SV10,
|
"M20SV10": BTMinerM20SV10,
|
||||||
"M20SV20": BTMinerM20SV20,
|
"M20SV20": BTMinerM20SV20,
|
||||||
@@ -318,7 +319,7 @@ MINER_CLASSES = {
|
|||||||
"M66SVK40": BTMinerM66SVK40,
|
"M66SVK40": BTMinerM66SVK40,
|
||||||
},
|
},
|
||||||
MinerTypes.AVALONMINER: {
|
MinerTypes.AVALONMINER: {
|
||||||
None: AvalonMiner,
|
None: type("AvalonUnknown", (AvalonMiner, AvalonMinerMake), {}),
|
||||||
"AVALONMINER 721": CGMinerAvalon721,
|
"AVALONMINER 721": CGMinerAvalon721,
|
||||||
"AVALONMINER 741": CGMinerAvalon741,
|
"AVALONMINER 741": CGMinerAvalon741,
|
||||||
"AVALONMINER 761": CGMinerAvalon761,
|
"AVALONMINER 761": CGMinerAvalon761,
|
||||||
@@ -333,12 +334,12 @@ MINER_CLASSES = {
|
|||||||
"AVALONMINER 1246": CGMinerAvalon1246,
|
"AVALONMINER 1246": CGMinerAvalon1246,
|
||||||
},
|
},
|
||||||
MinerTypes.INNOSILICON: {
|
MinerTypes.INNOSILICON: {
|
||||||
None: Innosilicon,
|
None: type("InnosiliconUnknown", (Innosilicon, InnosiliconMake), {}),
|
||||||
"T3H+": InnosiliconT3HPlus,
|
"T3H+": InnosiliconT3HPlus,
|
||||||
"A10X": InnosiliconA10X,
|
"A10X": InnosiliconA10X,
|
||||||
},
|
},
|
||||||
MinerTypes.GOLDSHELL: {
|
MinerTypes.GOLDSHELL: {
|
||||||
None: GoldshellMiner,
|
None: type("GoldshellUnknown", (GoldshellMiner, GoldshellMake), {}),
|
||||||
"GOLDSHELL CK5": GoldshellCK5,
|
"GOLDSHELL CK5": GoldshellCK5,
|
||||||
"GOLDSHELL HS5": GoldshellHS5,
|
"GOLDSHELL HS5": GoldshellHS5,
|
||||||
"GOLDSHELL KD5": GoldshellKD5,
|
"GOLDSHELL KD5": GoldshellKD5,
|
||||||
@@ -405,7 +406,7 @@ MINER_CLASSES = {
|
|||||||
"ANTMINER S9": LUXMinerS9,
|
"ANTMINER S9": LUXMinerS9,
|
||||||
},
|
},
|
||||||
MinerTypes.AURADINE: {
|
MinerTypes.AURADINE: {
|
||||||
None: Auradine,
|
None: type("GoldshellUnknown", (Auradine, AuradineMake), {}),
|
||||||
"AT1500": AuradineFluxAT1500,
|
"AT1500": AuradineFluxAT1500,
|
||||||
"AT2860": AuradineFluxAT2860,
|
"AT2860": AuradineFluxAT2860,
|
||||||
"AT2880": AuradineFluxAT2880,
|
"AT2880": AuradineFluxAT2880,
|
||||||
@@ -501,7 +502,6 @@ class MinerFactory:
|
|||||||
)
|
)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
miner = self._select_miner_from_classes(
|
miner = self._select_miner_from_classes(
|
||||||
ip,
|
ip,
|
||||||
miner_type=miner_type,
|
miner_type=miner_type,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyasic"
|
name = "pyasic"
|
||||||
version = "0.53.0"
|
version = "0.53.1"
|
||||||
description = "A simplified and standardized interface for Bitcoin ASICs."
|
description = "A simplified and standardized interface for Bitcoin ASICs."
|
||||||
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
||||||
repository = "https://github.com/UpstreamData/pyasic"
|
repository = "https://github.com/UpstreamData/pyasic"
|
||||||
|
|||||||
Reference in New Issue
Block a user