pyasic
BOSMinerRPCAPI
Bases: BaseMinerRPCAPI
An abstraction of the BOSMiner API.
Each method corresponds to an API command in BOSMiner.
This class abstracts use of the BOSMiner API, as well as the
methods for sending commands to it. The self.send_command()
function handles sending a command to the miner asynchronously, and
as such is the base for many of the functions in this class, which
rely on it to send the command for them.
Source code in pyasic/rpc/bosminer.py
class BOSMinerRPCAPI(BaseMinerRPCAPI):
"""An abstraction of the BOSMiner API.
Each method corresponds to an API command in BOSMiner.
[BOSMiner API documentation](https://docs.braiins.com/os/plus-en/Development/1_api.html)
This class abstracts use of the BOSMiner API, as well as the
methods for sending commands to it. The `self.send_command()`
function handles sending a command to the miner asynchronously, and
as such is the base for many of the functions in this class, which
rely on it to send the command for them.
"""
async def asccount(self) -> dict:
"""Get data on the number of ASC devices and their info.
<details>
<summary>Expand</summary>
Returns:
Data on all ASC devices.
</details>
"""
return await self.send_command("asccount")
async def asc(self, n: int) -> dict:
"""Get data for ASC device n.
<details>
<summary>Expand</summary>
Parameters:
n: The device to get data for.
Returns:
The data for ASC device n.
</details>
"""
return await self.send_command("asc", parameters=n)
async def devdetails(self) -> dict:
"""Get data on all devices with their static details.
<details>
<summary>Expand</summary>
Returns:
Data on all devices with their static details.
</details>
"""
return await self.send_command("devdetails")
async def devs(self) -> dict:
"""Get data on each PGA/ASC with their details.
<details>
<summary>Expand</summary>
Returns:
Data on each PGA/ASC with their details.
</details>
"""
return await self.send_command("devs")
async def edevs(self, old: bool = False) -> dict:
"""Get data on each PGA/ASC with their details, ignoring blacklisted and zombie devices.
<details>
<summary>Expand</summary>
Parameters:
old: Include zombie devices that became zombies less than 'old' seconds ago
Returns:
Data on each PGA/ASC with their details.
</details>
"""
if old:
return await self.send_command("edevs", parameters="old")
else:
return await self.send_command("edevs")
async def pools(self) -> dict:
"""Get pool information.
<details>
<summary>Expand</summary>
Returns:
Miner pool information.
</details>
"""
return await self.send_command("pools")
async def summary(self) -> dict:
"""Get the status summary of the miner.
<details>
<summary>Expand</summary>
Returns:
The status summary of the miner.
</details>
"""
return await self.send_command("summary")
async def stats(self) -> dict:
"""Get stats of each device/pool with more than 1 getwork.
<details>
<summary>Expand</summary>
Returns:
Stats of each device/pool with more than 1 getwork.
</details>
"""
return await self.send_command("stats")
async def version(self) -> dict:
"""Get miner version info.
<details>
<summary>Expand</summary>
Returns:
Miner version information.
</details>
"""
return await self.send_command("version")
async def estats(self, old: bool = False) -> dict:
"""Get stats of each device/pool with more than 1 getwork, ignoring zombie devices.
<details>
<summary>Expand</summary>
Parameters:
old: Include zombie devices that became zombies less than 'old' seconds ago.
Returns:
Stats of each device/pool with more than 1 getwork, ignoring zombie devices.
</details>
"""
if old:
return await self.send_command("estats", parameters=old)
else:
return await self.send_command("estats")
async def check(self, command: str) -> dict:
"""Check if the command `command` exists in BOSMiner.
<details>
<summary>Expand</summary>
Parameters:
command: The command to check.
Returns:
## Information about a command:
* Exists (Y/N) <- the command exists in this version
* Access (Y/N) <- you have access to use the command
</details>
"""
return await self.send_command("check", parameters=command)
async def coin(self) -> dict:
"""Get information on the current coin.
<details>
<summary>Expand</summary>
Returns:
## Information about the current coin being mined:
* Hash Method <- the hashing algorithm
* Current Block Time <- blocktime as a float, 0 means none
* Current Block Hash <- the hash of the current block, blank means none
* LP <- whether LP is in use on at least 1 pool
* Network Difficulty: the current network difficulty
</details>
"""
return await self.send_command("coin")
async def lcd(self) -> dict:
"""Get a general all-in-one status summary of the miner.
<details>
<summary>Expand</summary>
Returns:
An all-in-one status summary of the miner.
</details>
"""
return await self.send_command("lcd")
async def fans(self) -> dict:
"""Get fan data.
<details>
<summary>Expand</summary>
Returns:
Data on the fans of the miner.
</details>
"""
return await self.send_command("fans")
async def tempctrl(self) -> dict:
"""Get temperature control data.
<details>
<summary>Expand</summary>
Returns:
Data about the temp control settings of the miner.
</details>
"""
return await self.send_command("tempctrl")
async def temps(self) -> dict:
"""Get temperature data.
<details>
<summary>Expand</summary>
Returns:
Data on the temps of the miner.
</details>
"""
return await self.send_command("temps")
async def tunerstatus(self) -> dict:
"""Get tuner status data
<details>
<summary>Expand</summary>
Returns:
Data on the status of autotuning.
</details>
"""
return await self.send_command("tunerstatus")
async def pause(self) -> dict:
"""Pause mining.
<details>
<summary>Expand</summary>
Returns:
Confirmation of pausing mining.
</details>
"""
return await self.send_command("pause")
async def resume(self) -> dict:
"""Resume mining.
<details>
<summary>Expand</summary>
Returns:
Confirmation of resuming mining.
</details>
"""
return await self.send_command("resume")
asc(n)
async
Get data for ASC device n.
Expand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n |
int
|
The device to get data for. |
required |
Returns:
Type | Description |
---|---|
dict
|
The data for ASC device n. |
Source code in pyasic/rpc/bosminer.py
async def asc(self, n: int) -> dict:
"""Get data for ASC device n.
<details>
<summary>Expand</summary>
Parameters:
n: The device to get data for.
Returns:
The data for ASC device n.
</details>
"""
return await self.send_command("asc", parameters=n)
asccount()
async
Get data on the number of ASC devices and their info.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on all ASC devices. |
Source code in pyasic/rpc/bosminer.py
async def asccount(self) -> dict:
"""Get data on the number of ASC devices and their info.
<details>
<summary>Expand</summary>
Returns:
Data on all ASC devices.
</details>
"""
return await self.send_command("asccount")
check(command)
async
Check if the command command
exists in BOSMiner.
Expand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command |
str
|
The command to check. |
required |
Returns:
Type | Description |
---|---|
dict
|
Information about a command:
|
Source code in pyasic/rpc/bosminer.py
async def check(self, command: str) -> dict:
"""Check if the command `command` exists in BOSMiner.
<details>
<summary>Expand</summary>
Parameters:
command: The command to check.
Returns:
## Information about a command:
* Exists (Y/N) <- the command exists in this version
* Access (Y/N) <- you have access to use the command
</details>
"""
return await self.send_command("check", parameters=command)
coin()
async
Get information on the current coin.
Expand
Returns:
Type | Description |
---|---|
dict
|
Information about the current coin being mined:
|
Source code in pyasic/rpc/bosminer.py
async def coin(self) -> dict:
"""Get information on the current coin.
<details>
<summary>Expand</summary>
Returns:
## Information about the current coin being mined:
* Hash Method <- the hashing algorithm
* Current Block Time <- blocktime as a float, 0 means none
* Current Block Hash <- the hash of the current block, blank means none
* LP <- whether LP is in use on at least 1 pool
* Network Difficulty: the current network difficulty
</details>
"""
return await self.send_command("coin")
devdetails()
async
Get data on all devices with their static details.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on all devices with their static details. |
Source code in pyasic/rpc/bosminer.py
async def devdetails(self) -> dict:
"""Get data on all devices with their static details.
<details>
<summary>Expand</summary>
Returns:
Data on all devices with their static details.
</details>
"""
return await self.send_command("devdetails")
devs()
async
Get data on each PGA/ASC with their details.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on each PGA/ASC with their details. |
Source code in pyasic/rpc/bosminer.py
async def devs(self) -> dict:
"""Get data on each PGA/ASC with their details.
<details>
<summary>Expand</summary>
Returns:
Data on each PGA/ASC with their details.
</details>
"""
return await self.send_command("devs")
edevs(old=False)
async
Get data on each PGA/ASC with their details, ignoring blacklisted and zombie devices.
Expand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
old |
bool
|
Include zombie devices that became zombies less than 'old' seconds ago |
False
|
Returns:
Type | Description |
---|---|
dict
|
Data on each PGA/ASC with their details. |
Source code in pyasic/rpc/bosminer.py
async def edevs(self, old: bool = False) -> dict:
"""Get data on each PGA/ASC with their details, ignoring blacklisted and zombie devices.
<details>
<summary>Expand</summary>
Parameters:
old: Include zombie devices that became zombies less than 'old' seconds ago
Returns:
Data on each PGA/ASC with their details.
</details>
"""
if old:
return await self.send_command("edevs", parameters="old")
else:
return await self.send_command("edevs")
estats(old=False)
async
Get stats of each device/pool with more than 1 getwork, ignoring zombie devices.
Expand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
old |
bool
|
Include zombie devices that became zombies less than 'old' seconds ago. |
False
|
Returns:
Type | Description |
---|---|
dict
|
Stats of each device/pool with more than 1 getwork, ignoring zombie devices. |
Source code in pyasic/rpc/bosminer.py
async def estats(self, old: bool = False) -> dict:
"""Get stats of each device/pool with more than 1 getwork, ignoring zombie devices.
<details>
<summary>Expand</summary>
Parameters:
old: Include zombie devices that became zombies less than 'old' seconds ago.
Returns:
Stats of each device/pool with more than 1 getwork, ignoring zombie devices.
</details>
"""
if old:
return await self.send_command("estats", parameters=old)
else:
return await self.send_command("estats")
fans()
async
Get fan data.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on the fans of the miner. |
Source code in pyasic/rpc/bosminer.py
async def fans(self) -> dict:
"""Get fan data.
<details>
<summary>Expand</summary>
Returns:
Data on the fans of the miner.
</details>
"""
return await self.send_command("fans")
lcd()
async
Get a general all-in-one status summary of the miner.
Expand
Returns:
Type | Description |
---|---|
dict
|
An all-in-one status summary of the miner. |
Source code in pyasic/rpc/bosminer.py
async def lcd(self) -> dict:
"""Get a general all-in-one status summary of the miner.
<details>
<summary>Expand</summary>
Returns:
An all-in-one status summary of the miner.
</details>
"""
return await self.send_command("lcd")
pause()
async
Pause mining.
Expand
Returns:
Type | Description |
---|---|
dict
|
Confirmation of pausing mining. |
Source code in pyasic/rpc/bosminer.py
async def pause(self) -> dict:
"""Pause mining.
<details>
<summary>Expand</summary>
Returns:
Confirmation of pausing mining.
</details>
"""
return await self.send_command("pause")
pools()
async
Get pool information.
Expand
Returns:
Type | Description |
---|---|
dict
|
Miner pool information. |
Source code in pyasic/rpc/bosminer.py
async def pools(self) -> dict:
"""Get pool information.
<details>
<summary>Expand</summary>
Returns:
Miner pool information.
</details>
"""
return await self.send_command("pools")
resume()
async
Resume mining.
Expand
Returns:
Type | Description |
---|---|
dict
|
Confirmation of resuming mining. |
Source code in pyasic/rpc/bosminer.py
async def resume(self) -> dict:
"""Resume mining.
<details>
<summary>Expand</summary>
Returns:
Confirmation of resuming mining.
</details>
"""
return await self.send_command("resume")
stats()
async
Get stats of each device/pool with more than 1 getwork.
Expand
Returns:
Type | Description |
---|---|
dict
|
Stats of each device/pool with more than 1 getwork. |
Source code in pyasic/rpc/bosminer.py
async def stats(self) -> dict:
"""Get stats of each device/pool with more than 1 getwork.
<details>
<summary>Expand</summary>
Returns:
Stats of each device/pool with more than 1 getwork.
</details>
"""
return await self.send_command("stats")
summary()
async
Get the status summary of the miner.
Expand
Returns:
Type | Description |
---|---|
dict
|
The status summary of the miner. |
Source code in pyasic/rpc/bosminer.py
async def summary(self) -> dict:
"""Get the status summary of the miner.
<details>
<summary>Expand</summary>
Returns:
The status summary of the miner.
</details>
"""
return await self.send_command("summary")
tempctrl()
async
Get temperature control data.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data about the temp control settings of the miner. |
Source code in pyasic/rpc/bosminer.py
async def tempctrl(self) -> dict:
"""Get temperature control data.
<details>
<summary>Expand</summary>
Returns:
Data about the temp control settings of the miner.
</details>
"""
return await self.send_command("tempctrl")
temps()
async
Get temperature data.
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on the temps of the miner. |
Source code in pyasic/rpc/bosminer.py
async def temps(self) -> dict:
"""Get temperature data.
<details>
<summary>Expand</summary>
Returns:
Data on the temps of the miner.
</details>
"""
return await self.send_command("temps")
tunerstatus()
async
Get tuner status data
Expand
Returns:
Type | Description |
---|---|
dict
|
Data on the status of autotuning. |
Source code in pyasic/rpc/bosminer.py
async def tunerstatus(self) -> dict:
"""Get tuner status data
<details>
<summary>Expand</summary>
Returns:
Data on the status of autotuning.
</details>
"""
return await self.send_command("tunerstatus")
version()
async
Get miner version info.
Expand
Returns:
Type | Description |
---|---|
dict
|
Miner version information. |
Source code in pyasic/rpc/bosminer.py
async def version(self) -> dict:
"""Get miner version info.
<details>
<summary>Expand</summary>
Returns:
Miner version information.
</details>
"""
return await self.send_command("version")