Compare commits

...

12 Commits

Author SHA1 Message Date
UpstreamData
e4ec3b2b28 version: bump version number. 2023-06-01 09:45:26 -06:00
UpstreamData
08af02a394 bug: fix wrong constructor for S19Pro+. 2023-06-01 09:45:05 -06:00
UpstreamData
afca497d8a version: bump version number. 2023-06-01 09:03:31 -06:00
UpstreamData
d50896a896 bug: add support for S19ProPlus 2023-06-01 09:02:54 -06:00
UpstreamData
117737afb5 version: bump version number. 2023-05-29 11:40:56 -06:00
UpstreamData
eabae92da6 bug: fix some issues with S19j88NoPic on braiinsOS. 2023-05-29 11:40:08 -06:00
Upstream Data
f816551d7a version: bump version number. 2023-05-25 21:10:04 -06:00
Upstream Data
4e3ea4eabb feature: add support for M50S++ models. 2023-05-25 21:08:47 -06:00
UpstreamData
74c13806fb bug: fix incorrect variable name in avalonminers. 2023-05-23 15:07:33 -06:00
UpstreamData
934d469def version: bump version number. 2023-05-23 09:37:23 -06:00
UpstreamData
0c563ef538 bug: Fix bad type hinting on ABCMeta instead of type. 2023-05-23 09:36:50 -06:00
Upstream Data
ecc76d09af bug: add chip count for M32V10. 2023-05-21 19:38:37 -06:00
25 changed files with 199 additions and 31 deletions

View File

@@ -40,7 +40,7 @@ class BaseMiner(ABC):
self.model = None
# physical attributes
self.ideal_hashboards = 3
self.nominal_chips = 1
self.nominal_chips = 0
self.fan_count = 2
# data gathering locations
self.data_locations = None

View File

@@ -0,0 +1,26 @@
# ------------------------------------------------------------------------------
# Copyright 2022 Upstream Data Inc -
# -
# Licensed under the Apache License, Version 2.0 (the "License"); -
# you may not use this file except in compliance with the License. -
# You may obtain a copy of the License at -
# -
# http://www.apache.org/licenses/LICENSE-2.0 -
# -
# Unless required by applicable law or agreed to in writing, software -
# distributed under the License is distributed on an "AS IS" BASIS, -
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
from pyasic.miners.makes import AntMiner
class S19ProPlus(AntMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "S19 Pro+"
self.nominal_chips = 120
self.fan_count = 4

View File

@@ -24,3 +24,12 @@ class S19j(AntMiner): # noqa - ignore ABC method implementation
self.model = "S19j"
self.nominal_chips = 114
self.fan_count = 4
class S19jNoPIC(AntMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "S19j No PIC"
self.nominal_chips = 88
self.fan_count = 4

View File

@@ -16,10 +16,11 @@
from .S19 import S19
from .S19_Pro import S19Pro
from .S19_Pro_Plus import S19ProPlus
from .S19_XP import S19XP
from .S19a import S19a
from .S19a_Pro import S19aPro
from .S19j import S19j
from .S19j import S19j, S19jNoPIC
from .S19j_Pro import S19jPro
from .S19L import S19L
from .T19 import T19

View File

@@ -23,5 +23,5 @@ class Avalon721(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 721"
self.ideal_hashboards = 4
self.chip_count = 18
self.nominal_chips = 18
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon741(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 741"
self.ideal_hashboards = 4
self.chip_count = 22
self.nominal_chips = 22
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon761(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 761"
self.ideal_hashboards = 4
self.chip_count = 18
self.nominal_chips = 18
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon821(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 821"
self.ideal_hashboards = 4
self.chip_count = 26
self.nominal_chips = 26
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon841(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 841"
self.ideal_hashboards = 4
self.chip_count = 26
self.nominal_chips = 26
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon851(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 851"
self.ideal_hashboards = 4
self.chip_count = 26
self.nominal_chips = 26
self.fan_count = 1

View File

@@ -23,5 +23,5 @@ class Avalon921(AvalonMiner): # noqa - ignore ABC method implementation
self.ip = ip
self.model = "Avalon 921"
self.ideal_hashboards = 4
self.chip_count = 26
self.nominal_chips = 26
self.fan_count = 1

View File

@@ -24,10 +24,7 @@ class M32V10(WhatsMiner): # noqa - ignore ABC method implementation
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M32 V10"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M32V10, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.nominal_chips = 74
self.fan_count = 2

View File

@@ -0,0 +1,52 @@
# ------------------------------------------------------------------------------
# Copyright 2022 Upstream Data Inc -
# -
# Licensed under the Apache License, Version 2.0 (the "License"); -
# you may not use this file except in compliance with the License. -
# You may obtain a copy of the License at -
# -
# http://www.apache.org/licenses/LICENSE-2.0 -
# -
# Unless required by applicable law or agreed to in writing, software -
# distributed under the License is distributed on an "AS IS" BASIS, -
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner
class M50SPlusPlusVK10(WhatsMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M50S++ VK10"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M50S+ VK10, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.fan_count = 2
class M50SPlusPlusVK20(WhatsMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M50S++ VK20"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M50S+ VK20, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.fan_count = 2
class M50SPlusPlusVK30(WhatsMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M50S++ VK30"
self.nominal_chips = 76
self.fan_count = 2

View File

@@ -39,6 +39,7 @@ from .M50S import (
M50SVJ30,
)
from .M50S_Plus import M50SPlusVH30, M50SPlusVH40, M50SPlusVJ30
from .M50S_Plus_Plus import M50SPlusPlusVK30, M50SPlusPlusVK20, M50SPlusPlusVK10
from .M53 import M53VH30
from .M53S import M53SVH30
from .M53S_Plus import M53SPlusVJ30

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------------------
# Copyright 2022 Upstream Data Inc -
# -
# Licensed under the Apache License, Version 2.0 (the "License"); -
# you may not use this file except in compliance with the License. -
# You may obtain a copy of the License at -
# -
# http://www.apache.org/licenses/LICENSE-2.0 -
# -
# Unless required by applicable law or agreed to in writing, software -
# distributed under the License is distributed on an "AS IS" BASIS, -
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
from pyasic.miners.backends import AntminerModern
from pyasic.miners.btc._types import S19ProPlus # noqa - Ignore access to _module
class BMMinerS19ProPlus(AntminerModern, S19ProPlus):
pass

View File

@@ -15,10 +15,14 @@
# ------------------------------------------------------------------------------
from pyasic.miners.backends import AntminerModern
from pyasic.miners.btc._types import S19j # noqa - Ignore access to _module
from pyasic.miners.btc._types import S19j, S19jNoPIC # noqa - Ignore access to _module
# noqa - Ignore access to _module
class BMMinerS19j(AntminerModern, S19j):
pass
class BMMinerS19jNoPIC(AntminerModern, S19jNoPIC):
pass

View File

@@ -16,10 +16,11 @@
from .S19 import BMMinerS19
from .S19_Pro import BMMinerS19Pro
from .S19_Pro_Plus import BMMinerS19ProPlus
from .S19_XP import BMMinerS19XP
from .S19a import BMMinerS19a
from .S19a_Pro import BMMinerS19aPro
from .S19j import BMMinerS19j
from .S19j import BMMinerS19j, BMMinerS19jNoPIC
from .S19j_Pro import BMMinerS19jPro
from .S19L import BMMinerS19L
from .T19 import BMMinerT19

View File

@@ -15,8 +15,12 @@
# ------------------------------------------------------------------------------
from pyasic.miners.backends import BOSMiner
from pyasic.miners.btc._types import S19j # noqa - Ignore access to _module
from pyasic.miners.btc._types import S19j, S19jNoPIC # noqa - Ignore access to _module
class BOSMinerS19j(BOSMiner, S19j):
pass
class BOSMinerS19jNoPIC(BOSMiner, S19jNoPIC):
pass

View File

@@ -16,6 +16,6 @@
from .S19 import BOSMinerS19
from .S19_Pro import BOSMinerS19Pro
from .S19j import BOSMinerS19j
from .S19j import BOSMinerS19j, BOSMinerS19jNoPIC
from .S19j_Pro import BOSMinerS19jPro
from .T19 import BOSMinerT19

View File

@@ -0,0 +1,39 @@
# ------------------------------------------------------------------------------
# Copyright 2022 Upstream Data Inc -
# -
# Licensed under the Apache License, Version 2.0 (the "License"); -
# you may not use this file except in compliance with the License. -
# You may obtain a copy of the License at -
# -
# http://www.apache.org/licenses/LICENSE-2.0 -
# -
# Unless required by applicable law or agreed to in writing, software -
# distributed under the License is distributed on an "AS IS" BASIS, -
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
from pyasic.miners.backends import M5X
from pyasic.miners.btc._types.whatsminer.M5X.M50S_Plus_Plus import ( # noqa - ignore _module import
M50SPlusPlusVK10,
M50SPlusPlusVK20,
M50SPlusPlusVK30,
)
class BTMinerM50SPlusPlusVK10( # noqa - ignore ABC method implementation
M50SPlusPlusVK10, M5X
):
pass
class BTMinerM50SPlusPlusVK20( # noqa - ignore ABC method implementation
M50SPlusPlusVK20, M5X
):
pass
class BTMinerM50SPlusPlusVK30( # noqa - ignore ABC method implementation
M50SPlusPlusVK30, M5X
):
pass

View File

@@ -39,6 +39,7 @@ from .M50S import (
BTMinerM50SVJ30,
)
from .M50S_Plus import BTMinerM50SPlusVH30, BTMinerM50SPlusVH40, BTMinerM50SPlusVJ30
from .M50S_Plus_Plus import BTMinerM50SPlusPlusVK20, BTMinerM50SPlusPlusVK30, BTMinerM50SPlusPlusVK10
from .M53 import BTMinerM53VH30
from .M53S import BTMinerM53SVH30
from .M53S_Plus import BTMinerM53SPlusVJ30

View File

@@ -44,4 +44,4 @@ class InnosiliconMiner(BaseMiner): # noqa - ignore ABC method implementation
class GoldshellMiner(BaseMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.make = "BFGMinerGoldshell"
self.make = "Goldshell"

View File

@@ -18,8 +18,7 @@ import asyncio
import ipaddress
import json
import logging
from collections.abc import AsyncIterable
from typing import List, Tuple, Union
from typing import AsyncIterable, List, Tuple, Union
import asyncssh
import httpx
@@ -164,6 +163,15 @@ MINER_CLASSES = {
"CGMiner": CGMinerS19j,
"VNish": VNishS19j,
},
"ANTMINER S19J NOPIC": {
"Default": BMMinerS19jNoPIC,
"BOSMiner+": BOSMinerS19jNoPIC,
"BMMiner": BMMinerS19jNoPIC,
},
"AANTMINER S19PRO+": {
"Default": BMMinerS19ProPlus,
"BMMiner": BMMinerS19ProPlus,
},
"ANTMINER S19J PRO": {
"Default": BMMinerS19jPro,
"BOSMiner+": BOSMinerS19jPro,
@@ -486,6 +494,13 @@ MINER_CLASSES = {
"H40": BTMinerM50SPlusVH40,
"J30": BTMinerM50SPlusVJ30,
},
"M50S++": {
"Default": BTMinerM50SPlusPlusVK10,
"BTMiner": BTMinerM50SPlusPlusVK10,
"K10": BTMinerM50SPlusPlusVK10,
"K20": BTMinerM50SPlusPlusVK20,
"K30": BTMinerM50SPlusPlusVK30,
},
"M53": {
"Default": BTMinerM53VH30,
"BTMiner": BTMinerM53VH30,
@@ -746,9 +761,12 @@ class MinerFactory(metaclass=Singleton):
try:
if devdetails.get("DEVDETAILS"):
model = devdetails["DEVDETAILS"][0][_devdetails_key].upper()
if " NOPIC" in model:
# Braiins OS identifies some X19 differently
model = model.replace(" NOPIC", "")
if "NOPIC" in model:
# bos, weird model
if model == "ANTMINER S19J88NOPIC":
model = "ANTMINER S19J NOPIC"
else:
print(model)
if not model == "BITMICRO":
break
elif devdetails.get("DEVS"):

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
version = "0.33.14"
version = "0.33.19"
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
authors = ["UpstreamData <brett@upstreamdata.ca>"]
repository = "https://github.com/UpstreamData/pyasic"

View File

@@ -69,13 +69,6 @@ class NetworkTest(unittest.TestCase):
self.assertTrue(net_1 == correct_net)
self.assertTrue(net_2 == correct_net)
def test_net_len(self):
net = MinerNetwork("192.168.1.0", mask=32)
self.assertEqual(len(net), 1)
net2 = MinerNetwork("192.168.1.0", mask=31)
self.assertEqual(len(net2), 2)
def test_net_defaults(self):
net = MinerNetwork()
net_obj = net.get_network()