From cc3d4fa80563ece949adcc0bbaeb66e9c661d7a3 Mon Sep 17 00:00:00 2001
From: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
Date: Sun, 3 Mar 2024 11:15:44 -0700
Subject: [PATCH 1/7] feature: add S19 Hydro and S19 Pro+ Hydro.
---
docs/miners/antminer/X19.md | 56 +++++++++++++++++++
docs/miners/antminer/X21.md | 7 +++
docs/miners/supported_types.md | 14 +++++
pyasic/miners/antminer/bmminer/X19/S19.py | 10 ++++
.../miners/antminer/bmminer/X19/__init__.py | 2 +
pyasic/miners/factory.py | 2 +
pyasic/miners/models/antminer/X19/S19.py | 14 +++++
pyasic/miners/models/antminer/X19/__init__.py | 2 +
8 files changed, 107 insertions(+)
diff --git a/docs/miners/antminer/X19.md b/docs/miners/antminer/X19.md
index 242b8329..bfa8d47f 100644
--- a/docs/miners/antminer/X19.md
+++ b/docs/miners/antminer/X19.md
@@ -85,6 +85,13 @@
show_root_heading: false
heading_level: 4
+## S19 Hydro
+::: pyasic.miners.antminer.bmminer.X19.S19.BMMinerS19Hydro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
## S19 Pro Hydro
::: pyasic.miners.antminer.bmminer.X19.S19.BMMinerS19ProHydro
handler: python
@@ -92,6 +99,13 @@
show_root_heading: false
heading_level: 4
+## S19 Pro+ Hydro
+::: pyasic.miners.antminer.bmminer.X19.S19.BMMinerS19ProPlusHydro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
## T19
::: pyasic.miners.antminer.bmminer.X19.T19.BMMinerT19
handler: python
@@ -302,3 +316,45 @@
show_root_heading: false
heading_level: 4
+## S19 Pro (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.S19.LUXMinerS19Pro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
+## S19j Pro (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.S19.LUXMinerS19jPro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
+## S19j Pro+ (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.S19.LUXMinerS19jProPlus
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
+## S19k Pro (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.S19.LUXMinerS19kPro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
+## S19 XP (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.S19.LUXMinerS19XP
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
+## T19 (LuxOS)
+::: pyasic.miners.antminer.luxos.X19.T19.LUXMinerT19
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
diff --git a/docs/miners/antminer/X21.md b/docs/miners/antminer/X21.md
index ce068330..fc950331 100644
--- a/docs/miners/antminer/X21.md
+++ b/docs/miners/antminer/X21.md
@@ -8,3 +8,10 @@
show_root_heading: false
heading_level: 4
+## S21 (LuxOS)
+::: pyasic.miners.antminer.luxos.X21.S21.LUXMinerS21
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 4
+
diff --git a/docs/miners/supported_types.md b/docs/miners/supported_types.md
index d7d28486..4505d52c 100644
--- a/docs/miners/supported_types.md
+++ b/docs/miners/supported_types.md
@@ -78,7 +78,9 @@ details {
S19 XP
S19a
S19a Pro
+ S19 Hydro
S19 Pro Hydro
+ S19 Pro+ Hydro
T19
@@ -544,6 +546,18 @@ details {
X19 Series:
+
+
+ X21 Series:
+
diff --git a/pyasic/miners/antminer/bmminer/X19/S19.py b/pyasic/miners/antminer/bmminer/X19/S19.py
index ee982340..7c18bdc4 100644
--- a/pyasic/miners/antminer/bmminer/X19/S19.py
+++ b/pyasic/miners/antminer/bmminer/X19/S19.py
@@ -21,6 +21,7 @@ from pyasic.miners.models import (
S19XP,
S19a,
S19aPro,
+ S19Hydro,
S19i,
S19j,
S19jNoPIC,
@@ -29,6 +30,7 @@ from pyasic.miners.models import (
S19Pro,
S19ProHydro,
S19ProPlus,
+ S19ProPlusHydro,
)
@@ -82,3 +84,11 @@ class BMMinerS19L(AntminerModern, S19L):
class BMMinerS19ProHydro(AntminerModern, S19ProHydro):
pass
+
+
+class BMMinerS19Hydro(AntminerModern, S19Hydro):
+ pass
+
+
+class BMMinerS19ProPlusHydro(AntminerModern, S19ProPlusHydro):
+ pass
diff --git a/pyasic/miners/antminer/bmminer/X19/__init__.py b/pyasic/miners/antminer/bmminer/X19/__init__.py
index ce773e25..f4d56abc 100644
--- a/pyasic/miners/antminer/bmminer/X19/__init__.py
+++ b/pyasic/miners/antminer/bmminer/X19/__init__.py
@@ -18,6 +18,7 @@ from .S19 import (
BMMinerS19,
BMMinerS19a,
BMMinerS19aPro,
+ BMMinerS19Hydro,
BMMinerS19i,
BMMinerS19j,
BMMinerS19jNoPIC,
@@ -27,6 +28,7 @@ from .S19 import (
BMMinerS19Pro,
BMMinerS19ProHydro,
BMMinerS19ProPlus,
+ BMMinerS19ProPlusHydro,
BMMinerS19XP,
)
from .T19 import BMMinerT19
diff --git a/pyasic/miners/factory.py b/pyasic/miners/factory.py
index f74fe224..6df264bf 100644
--- a/pyasic/miners/factory.py
+++ b/pyasic/miners/factory.py
@@ -99,7 +99,9 @@ MINER_CLASSES = {
"ANTMINER S19 XP": BMMinerS19XP,
"ANTMINER S19A": BMMinerS19a,
"ANTMINER S19A PRO": BMMinerS19aPro,
+ "ANTMINER S19 HYDRO": BMMinerS19Hydro,
"ANTMINER S19 PRO HYD.": BMMinerS19ProHydro,
+ "ANTMINER S19 PRO+ HYD.": BMMinerS19ProPlusHydro,
"ANTMINER T19": BMMinerT19,
},
MinerTypes.WHATSMINER: {
diff --git a/pyasic/miners/models/antminer/X19/S19.py b/pyasic/miners/models/antminer/X19/S19.py
index 80d25a7b..8c563bc6 100644
--- a/pyasic/miners/models/antminer/X19/S19.py
+++ b/pyasic/miners/models/antminer/X19/S19.py
@@ -113,8 +113,22 @@ class S19kProNoPIC(AntMinerMake):
expected_fans = 4
+class S19Hydro(AntMinerMake):
+ raw_model = "S19 Hydro"
+ expected_chips = 104
+ expected_hashboards = 4
+ expected_fans = 0
+
+
class S19ProHydro(AntMinerMake):
raw_model = "S19 Pro Hydro"
expected_chips = 180
expected_hashboards = 4
expected_fans = 0
+
+
+class S19ProPlusHydro(AntMinerMake):
+ raw_model = "S19 Pro+ Hydro"
+ expected_chips = 180
+ expected_hashboards = 4
+ expected_fans = 0
diff --git a/pyasic/miners/models/antminer/X19/__init__.py b/pyasic/miners/models/antminer/X19/__init__.py
index a1c262c6..8788c388 100644
--- a/pyasic/miners/models/antminer/X19/__init__.py
+++ b/pyasic/miners/models/antminer/X19/__init__.py
@@ -20,6 +20,7 @@ from .S19 import (
S19XP,
S19a,
S19aPro,
+ S19Hydro,
S19i,
S19j,
S19jNoPIC,
@@ -32,5 +33,6 @@ from .S19 import (
S19Pro,
S19ProHydro,
S19ProPlus,
+ S19ProPlusHydro,
)
from .T19 import T19
From e889780bad5b74b49e2f19cd9094be79b565f8b8 Mon Sep 17 00:00:00 2001
From: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
Date: Sun, 3 Mar 2024 11:16:16 -0700
Subject: [PATCH 2/7] version: bump version number.
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 2b49b062..055d787e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
-version = "0.54.1"
+version = "0.54.2"
description = "A simplified and standardized interface for Bitcoin ASICs."
authors = ["UpstreamData "]
repository = "https://github.com/UpstreamData/pyasic"
From 3c227be170084826fc5727c02b3621baf34a4870 Mon Sep 17 00:00:00 2001
From: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
Date: Wed, 6 Mar 2024 21:53:14 -0700
Subject: [PATCH 3/7] bug: update httpx to use compatible versioning.
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 055d787e..e4725e40 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,7 +9,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.8"
-httpx = "^0.26.0"
+httpx = ">=0.26.0"
asyncssh = "^2.14.2"
passlib = "^1.7.4"
pyaml = "^23.12.0"
From 2af0003843e1cb87c0e5d0fcf965276cd4ef462d Mon Sep 17 00:00:00 2001
From: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
Date: Wed, 6 Mar 2024 21:56:10 -0700
Subject: [PATCH 4/7] version: bump version number.
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index e4725e40..84cfadc8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
-version = "0.54.2"
+version = "0.54.3"
description = "A simplified and standardized interface for Bitcoin ASICs."
authors = ["UpstreamData "]
repository = "https://github.com/UpstreamData/pyasic"
From 15d1dc5bb633b4ed757f5015edecf3489ac2a37e Mon Sep 17 00:00:00 2001
From: wilfredallyn <71931752+wilfredallyn@users.noreply.github.com>
Date: Sun, 10 Mar 2024 11:09:06 -0400
Subject: [PATCH 5/7] feature: add install docs (#117)
---
README.md | 17 +++++++++++++++++
docs/index.md | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/README.md b/README.md
index 448bf3b1..252b3731 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,23 @@ Welcome to `pyasic`! `pyasic` uses an asynchronous method of communicating with
[Click here to view supported miner types](https://docs.pyasic.org/en/latest/miners/supported_types/)
+---
+## Installation
+
+It is recommended to install `pyasic` in a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/#what-other-popular-options-exist-aside-from-venv) to isolate it from the rest of your system. Options include:
+ - [venv](https://docs.python.org/3/library/venv.html): included in Python standard library but has fewer features than other options
+ - [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv): [pyenv](https://github.com/pyenv/pyenv) plugin for managing virtualenvs
+ ```
+ pyenv install
+ pyenv virtualenv
+ pyenv activate
+ ```
+ - [conda](https://docs.conda.io/en/latest/)
+
+##### Installing `pyasic`
+
+`python -m pip install .` or `poetry install`
+
---
## Getting started
diff --git a/docs/index.md b/docs/index.md
index b630f8c2..fdf6cd1a 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -18,6 +18,23 @@ Welcome to `pyasic`! `pyasic` uses an asynchronous method of communicating with
[Click here to view supported miner types](miners/supported_types.md)
+---
+## Installation
+
+It is recommended to install `pyasic` in a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/#what-other-popular-options-exist-aside-from-venv) to isolate it from the rest of your system. Options include:
+ - [venv](https://docs.python.org/3/library/venv.html): included in Python standard library but has fewer features than other options
+ - [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv): [pyenv](https://github.com/pyenv/pyenv) plugin for managing virtualenvs
+ ```
+ pyenv install
+ pyenv virtualenv
+ pyenv activate
+ ```
+ - [conda](https://docs.conda.io/en/latest/)
+
+##### Installing `pyasic`
+
+`python -m pip install .` or `poetry install`
+
---
## Getting started
---
From 0e00fe3114dbd97c5c43d877a31d7d9a3c1d8146 Mon Sep 17 00:00:00 2001
From: Upstream Data
Date: Tue, 12 Mar 2024 16:16:15 -0600
Subject: [PATCH 6/7] feature: add antminer mode as str setting.
---
docs/index.md | 1 +
docs/settings/settings.md | 1 +
pyasic/config/mining.py | 33 +++++++++++++++++++++++++--------
pyasic/settings/__init__.py | 1 +
4 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/docs/index.md b/docs/index.md
index fdf6cd1a..996242a2 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -253,6 +253,7 @@ settings.update("default_antminer_password", "my_pwd")
"factory_get_timeout": 3,
"get_data_retries": 1,
"api_function_timeout": 5,
+"antminer_mining_mode_as_str": False,
"default_whatsminer_password": "admin",
"default_innosilicon_password": "admin",
"default_antminer_password": "root",
diff --git a/docs/settings/settings.md b/docs/settings/settings.md
index 51aa3e03..bf58552c 100644
--- a/docs/settings/settings.md
+++ b/docs/settings/settings.md
@@ -12,6 +12,7 @@ Settings options:
- `factory_get_timeout`
- `get_data_retries`
- `api_function_timeout`
+- `antminer_mining_mode_as_str`
- `default_whatsminer_password`
- `default_innosilicon_password`
- `default_antminer_password`
diff --git a/pyasic/config/mining.py b/pyasic/config/mining.py
index 5bfe212f..d8a77c17 100644
--- a/pyasic/config/mining.py
+++ b/pyasic/config/mining.py
@@ -17,6 +17,7 @@ from __future__ import annotations
from dataclasses import dataclass, field
+from pyasic import settings
from pyasic.config.base import MinerConfigOption, MinerConfigValue
from pyasic.web.braiins_os.proto.braiins.bos.v1 import (
HashrateTargetMode,
@@ -39,7 +40,9 @@ class MiningModeNormal(MinerConfigValue):
return cls()
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
def as_wm(self) -> dict:
return {"mode": self.mode}
@@ -63,7 +66,9 @@ class MiningModeSleep(MinerConfigValue):
return cls()
def as_am_modern(self) -> dict:
- return {"miner-mode": "1"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "1"}
+ return {"miner-mode": 1}
def as_wm(self) -> dict:
return {"mode": self.mode}
@@ -87,7 +92,9 @@ class MiningModeLPM(MinerConfigValue):
return cls()
def as_am_modern(self) -> dict:
- return {"miner-mode": "3"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "3"}
+ return {"miner-mode": 3}
def as_wm(self) -> dict:
return {"mode": self.mode}
@@ -108,7 +115,9 @@ class MiningModeHPM(MinerConfigValue):
return cls()
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
def as_wm(self) -> dict:
return {"mode": self.mode}
@@ -165,7 +174,9 @@ class MiningModePowerTune(MinerConfigValue):
return cls(**cls_conf)
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
def as_wm(self) -> dict:
if self.power is not None:
@@ -204,7 +215,9 @@ class MiningModeHashrateTune(MinerConfigValue):
return cls(dict_conf.get("hashrate"))
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
def as_boser(self) -> dict:
return {
@@ -239,7 +252,9 @@ class ManualBoardSettings(MinerConfigValue):
return cls(freq=dict_conf["freq"], volt=dict_conf["volt"])
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
@dataclass
@@ -259,7 +274,9 @@ class MiningModeManual(MinerConfigValue):
)
def as_am_modern(self) -> dict:
- return {"miner-mode": "0"}
+ if settings.get("antminer_mining_mode_as_str", False):
+ return {"miner-mode": "0"}
+ return {"miner-mode": 0}
@classmethod
def from_vnish(cls, web_overclock_settings: dict) -> "MiningModeManual":
diff --git a/pyasic/settings/__init__.py b/pyasic/settings/__init__.py
index 5b1a4280..381a1bef 100644
--- a/pyasic/settings/__init__.py
+++ b/pyasic/settings/__init__.py
@@ -28,6 +28,7 @@ _settings = { # defaults
"factory_get_timeout": 3,
"get_data_retries": 1,
"api_function_timeout": 5,
+ "antminer_mining_mode_as_str": False,
"default_whatsminer_rpc_password": "admin",
"default_innosilicon_web_password": "admin",
"default_antminer_web_password": "root",
From 4b54cf67ba25f0f32a055be92a2be80dd66e4136 Mon Sep 17 00:00:00 2001
From: Upstream Data
Date: Tue, 12 Mar 2024 16:16:40 -0600
Subject: [PATCH 7/7] version: bump version number.
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 84cfadc8..a6ee7c8b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
-version = "0.54.3"
+version = "0.54.4"
description = "A simplified and standardized interface for Bitcoin ASICs."
authors = ["UpstreamData "]
repository = "https://github.com/UpstreamData/pyasic"