Firmware (LuxOS)
luxos (python)

Welcome to Luxos tooling


The luxos tooling project (opens in a new tab) (github (opens in a new tab)) provides:

  1. A consistent API to access miners through the the luxos python package (eg. import luxos)
  2. A bunch of utility cli scripts to help everyday maintenance (luxos and health-checker at the moment)


Detailed instruction on how to install it are provided 👉 here, to install the latest released code:

# to install it
$> pip install luxos

Quick start

Once installed the luxos (opens in a new tab) package, you can:

  • Leverage the luxos cli scripts
  • Use the python api

Usage (cli)

The luxos wheel package comes with a luxos comand line script:

This will reboot all miners in the miner.csv file list:

   $> luxos --ipfile miners.csv --cmd rebootdevice --timeout 2 --verbose

There's an async version that can work better on multiple miners, just use the --async flag:

   $> luxos --ipfile miners.csv --cmd version --timeout 2 --async --all
   | {
   |   "STATUS": [
   |     {
   |       "Code": 22,
   |       "Description": "LUXminer 2024.5.1.155432-f2badc0f",

Usage (utils api)

The luxos package comes with an luxos.utils module to expose a simplified version of the internal API, useful to quickly execute commands on miners.


This is way to get version data from a single miner using the API:

   >>> from luxos.utils import execute_command
   >>> execute_command("", 4028, 2, "version", "", False)
   {'STATUS': [{'Code': 22, 'Description': 'LUXminer ...

The async version:

   >>> import asyncio
   >>> from luxos import utils
   >>>"", 4028, "vesion"))
   {'STATUS': [{'Code': 22, 'Description': 'LUXminer ...

rexec takes care of formatting the parameters also, the full signature is:

rexec(host="", port=4028, 
    cmd="version", parameters="",
    timeout=2., retry=1, retry_delay=3.)

parameters can be a string, a list of any type (it will be converted into a str) or a dictionary (same conversion to string will apply). timeout is the timeout for a call, retry is the number of try before giving up, and retry_delay controls the delay between retry.


The luxos.utils.lauch allows to rexec commands to a list of miners stored in a file:

   >>> import asyncio
   >>> from luxos import utils
   # task is a callable with (host, port) signature
   >>> async def task(host: str, port: int):
   ...   return await utils.rexec(host, port, "version")
   # miners.csv contains a list of ip addresses, one per line
   >>> addresses = utils.load_ips_from_csv("miners.csv")
   # batched is a keyword argument to limit execution rate
   >>>, task, batch=None))
   [{'STATUS': [{'Code': 22, 'Description': 'LUXmin ....
   # the one-liner version
   >>>, utils.rexec, "version", batch=None))