Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4ec3b2b28 | ||
|
|
08af02a394 | ||
|
|
afca497d8a | ||
|
|
d50896a896 | ||
|
|
117737afb5 | ||
|
|
eabae92da6 | ||
|
|
f816551d7a | ||
|
|
4e3ea4eabb | ||
|
|
74c13806fb | ||
|
|
934d469def | ||
|
|
0c563ef538 | ||
|
|
ecc76d09af |
@@ -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
|
||||
|
||||
26
pyasic/miners/btc/_types/antminer/X19/S19_Pro_Plus.py
Normal file
26
pyasic/miners/btc/_types/antminer/X19/S19_Pro_Plus.py
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
52
pyasic/miners/btc/_types/whatsminer/M5X/M50S_Plus_Plus.py
Normal file
52
pyasic/miners/btc/_types/whatsminer/M5X/M50S_Plus_Plus.py
Normal 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
|
||||
@@ -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
|
||||
|
||||
22
pyasic/miners/btc/antminer/bmminer/X19/S19_Pro_Plus.py
Normal file
22
pyasic/miners/btc/antminer/bmminer/X19/S19_Pro_Plus.py
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
39
pyasic/miners/btc/whatsminer/btminer/M5X/M50S_Plus_Plus.py
Normal file
39
pyasic/miners/btc/whatsminer/btminer/M5X/M50S_Plus_Plus.py
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"):
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user