Skip to main content

A python package for easy in line interfacing with XMRig Miner HTTP API

Project description

xmrig-python

PyPi Python PyPI - Downloads License

A wrapper for the XMRig HTTP API and client manager

Installing xmrig-python

From Source

git clone https://github.com/CoulterStutz/python-xmrig.git && cd python-xmrig
poetry install # or use `pip install .`, dont forget the period to set the source location to the current directory.

Using PyPi

poetry install xmrig # or use `pip install xmrig`.

After that the package will be available to use!

Example Usage

Here is a basic implementation of the API Wrapper now dubbed XMRigAPI.

import xmrig, logging
x = xmrig.XMRigAPI(ip="127.0.0.1", port="5555", access_token="example")
logging.basicConfig()
logging.getLogger("XMRigAPI").setLevel(logging.INFO)            # Change to DEBUG to print out all responses when their methods are called
log = logging.getLogger("MyLOG")

# Control the miner using JSON RPC.
x.pause_miner()
x.resume_miner()
x.stop_miner()
x.start_miner()

# Update cached data from endpoints individually or all at once
x.update_summary()
x.update_all_responses()

# Edit and update the miners `config.json` via the HTTP API.
x.update_config()                                               # This updates the cached data
config = x.config()                                             # Use the `config` property to access the data
config["pools"]["USER"] = "NEW_WALLET_ADDRESS"
x.post_config(config)

# Summary and Backends API data is available as properties in either full or individual format.
log.info(x.summary)                                             # Prints the entire `summary` endpoint response
log.info(x.sum_hashrates)                                       # Prints out the current hashrates
log.info(x.sum_pool_accepted_jobs)                              # Prints out the accepted_jobs counter
log.info(x.sum_pool_rejected_jobs)                              # Prints out the rejected_jobs counter
log.info(x.sum_current_difficulty)                              # Prints out the current difficulty

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmrig-1.1.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmrig-1.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file xmrig-1.1.2.tar.gz.

File metadata

  • Download URL: xmrig-1.1.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for xmrig-1.1.2.tar.gz
Algorithm Hash digest
SHA256 a627168867411f6bcd68b61d0480c67f8febf7a933654e163ea4ff102782a1c1
MD5 45823c9985e9f3026a6d7628231c88ba
BLAKE2b-256 cb8fe24e475f122ad4c35fb299c9a05710def7bcddbab944c63a6c17bf6df3b2

See more details on using hashes here.

File details

Details for the file xmrig-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: xmrig-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for xmrig-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 593d67d3a45d908d7e3b69ec2d836e1b7560fe73d632423dea1b31bdb5bc816f
MD5 e529667936d398f787a0d2ff10a92457
BLAKE2b-256 b9116740a241c4e4cf942bb1918921b2f5ef17f72f9f348d61e456613603c21f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page