diff --git a/pyasic/miners/dsh/__init__.py b/pyasic/miners/dsh/__init__.py new file mode 100644 index 00000000..a2151b40 --- /dev/null +++ b/pyasic/miners/dsh/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .antminer import * diff --git a/pyasic/miners/dsh/_types/__init__.py b/pyasic/miners/dsh/_types/__init__.py new file mode 100644 index 00000000..a2151b40 --- /dev/null +++ b/pyasic/miners/dsh/_types/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .antminer import * diff --git a/pyasic/miners/dsh/_types/antminer/X3/D3.py b/pyasic/miners/dsh/_types/antminer/X3/D3.py new file mode 100644 index 00000000..15c46f7e --- /dev/null +++ b/pyasic/miners/dsh/_types/antminer/X3/D3.py @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------------------ +# 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 D3(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 = "D3" + self.nominal_chips = 60 + self.ideal_hashboards = 3 + self.fan_count = 2 diff --git a/pyasic/miners/dsh/_types/antminer/X3/__init__.py b/pyasic/miners/dsh/_types/antminer/X3/__init__.py new file mode 100644 index 00000000..59d80a1f --- /dev/null +++ b/pyasic/miners/dsh/_types/antminer/X3/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .D3 import D3 diff --git a/pyasic/miners/dsh/_types/antminer/__init__.py b/pyasic/miners/dsh/_types/antminer/__init__.py new file mode 100644 index 00000000..647fb882 --- /dev/null +++ b/pyasic/miners/dsh/_types/antminer/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .X3 import * diff --git a/pyasic/miners/dsh/antminer/__init__.py b/pyasic/miners/dsh/antminer/__init__.py new file mode 100644 index 00000000..10eb58cb --- /dev/null +++ b/pyasic/miners/dsh/antminer/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .cgminer import * diff --git a/pyasic/miners/dsh/antminer/cgminer/X3/D3.py b/pyasic/miners/dsh/antminer/cgminer/X3/D3.py new file mode 100644 index 00000000..27e47415 --- /dev/null +++ b/pyasic/miners/dsh/antminer/cgminer/X3/D3.py @@ -0,0 +1,24 @@ +# ------------------------------------------------------------------------------ +# 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 AntminerOld +from pyasic.miners.dsh._types import D3 # noqa - Ignore access to _module + + +class CGMinerD3(AntminerOld, D3): + def __init__(self, ip: str, api_ver: str = "0.0.0"): + super().__init__(ip, api_ver) + self.supports_shutdown = False diff --git a/pyasic/miners/dsh/antminer/cgminer/X3/__init__.py b/pyasic/miners/dsh/antminer/cgminer/X3/__init__.py new file mode 100644 index 00000000..19bfb0a8 --- /dev/null +++ b/pyasic/miners/dsh/antminer/cgminer/X3/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .D3 import CGMinerD3 diff --git a/pyasic/miners/dsh/antminer/cgminer/__init__.py b/pyasic/miners/dsh/antminer/cgminer/__init__.py new file mode 100644 index 00000000..647fb882 --- /dev/null +++ b/pyasic/miners/dsh/antminer/cgminer/__init__.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------ +# 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 .X3 import * diff --git a/pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py b/pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py index 0ef3f45f..3219fcb4 100644 --- a/pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py +++ b/pyasic/miners/ltc/_types/antminer/X3/L3_Plus.py @@ -21,5 +21,5 @@ class L3Plus(AntMiner): # noqa - ignore ABC method implementation super().__init__(ip, api_ver) self.ip = ip self.model = "L3+" - self.nominal_chips = 0 + self.nominal_chips = 72 self.fan_count = 2 diff --git a/pyasic/miners/miner_factory.py b/pyasic/miners/miner_factory.py index 38040dd3..04ba1d67 100644 --- a/pyasic/miners/miner_factory.py +++ b/pyasic/miners/miner_factory.py @@ -36,6 +36,7 @@ from pyasic.miners.base import AnyMiner from pyasic.miners.btc import * from pyasic.miners.ckb import * from pyasic.miners.dcr import * +from pyasic.miners.dsh import * from pyasic.miners.etc import * from pyasic.miners.hns import * from pyasic.miners.kda import * @@ -50,6 +51,10 @@ MINER_CLASSES = { "Default": CGMinerDR5, "CGMiner": CGMinerDR5, }, + "ANTMINER D3": { + "Default": CGMinerD3, + "CGMiner": CGMinerD3, + }, "ANTMINER HS3": { "Default": CGMinerHS3, "CGMiner": CGMinerHS3, @@ -702,7 +707,6 @@ class MinerFactory(metaclass=Singleton): try: devdetails, version = await self.__get_devdetails_and_version(ip) - print(devdetails, version) except APIError as e: # catch APIError and let the factory know we cant get data logging.warning(f"{ip}: API Command Error: {e}") @@ -845,7 +849,6 @@ class MinerFactory(metaclass=Singleton): if version and not model: try: model = version["VERSION"][0]["Type"].upper() - print(model) if "ANTMINER BHB" in model: # def antminer, get from web sysinfo = await self.__get_system_info_from_web(str(ip))