apiminer package¶
- Release
0.1.1
Submodules¶
apiminer.ClaymoreRPC module¶
Implementation of ClaymoreRPC get_minerstats1 protocol
This is compatable with both Claymore and Ethminer
-
class
apiminer.ClaymoreRPC.
ClaymoreRPC
(ip, port)[source]¶ Bases:
object
Class that interacts with a ClaymoreRPC protocol listener
- Parameters
-
response
¶ Private storage of formatted response. set by
ClaymoreRPC.update()
- Type
Authenticate connection. Used for APIs that have –api-password set.
This will send the password in plaintext. Blame Ethminer
- Parameters
password (str) – The password. Again, cleartext.
-
format_getstat1
()[source]¶ Applies a nice formatting to getstat1
- Returns
Formatted API response. Check code for keys.
- Return type
-
reboot
()[source]¶ Runs a script named reboot.sh (Linux) or reboot.bat (Windows)
This method will only work if the API is in write mode. There is no guarantee that script will succeed.
- Returns
Returns True if script was found and the miner tried to start it.
- Return type
-
property
response
Deprecated. Returns a dictionary of the response, in a nice format
-
restart
()[source]¶ Sends the miner (API Host) the restart command.
The miner API must be set in write mode. Also, note that if the miner is non-responsive, it is very unlikely that this command will be effective. If effective, this will cause the miner to stop mining, unload DAGs, reset GPUs, regenerate DAGs, and then start mining. The connection to the pool will be maintained.
- Returns
Restart succesful.
- Return type
-
socket
= None¶ socket.socket
Object. This communicates with the API Host
-
unified_data
(return_dual_mining=False)[source]¶ Returns a generic formatted response.
Uses get_stat1 under the hood
-
write
(method='miner_getstats1', password=None)[source]¶ Send message to the miner. Connects if not connected
- Parameters
method (str) – Query the API for the data indicated. See [Ethminer Docs](https://github.com/ethereum-mining/ethminer/blob/master/docs/API_DOCUMENTATION.md) for more information on the methods that can be used
password (str) – Password for APIs protected by –api-password. Note that this password is sent in cleartext. Blame ethminer.
-
class
apiminer.ClaymoreRPC.
EthminerRPC
(ip, port)[source]¶ Bases:
apiminer.ClaymoreRPC.ClaymoreRPC
Class that uses the Ethminer superset of ClaymoreRPC protocol listener to interact with an Ethminer client.
- Parameters
-
response
¶ Private storage of formatted response. set by
ClaymoreRPC.update()
- Type
apiminer.XMRStakAPI module¶
Reads data from the XMRStak JSON API
-
class
apiminer.XMRStakAPI.
XMRStakAPI
(ip, port)[source]¶ Bases:
object
Total Accepted Shares
- Type
a copy of
XMRStak.rejected_shares
- Type
-
percard_hashrate
= None¶ Current Hashrate per card. 10s rolling average.
- Type
list of float
-
unified_data
(return_dual_mining=None)[source]¶ Returns a generic formatted response.
Yes, XMRStak API does have a completely different implementation compared to Claymore RPC. Although, Claymore used to be closer to this before adding a the new ethminer methods. This will just use
XMRStakAPI.getdict()
under the hood- Returns
Unified API dictionary
- Return type
apiminer.SGMinerRPC module¶
-
apiminer.SGMinerRPC.
TeamRedMiner
¶ alias of
apiminer.SGMinerRPC._SGBase