SyncRainbowMinerClient¶
rainbowminer_api_client.sync_client.SyncRainbowMinerClient ¶
SyncRainbowMinerClient(
host: str = _DEFAULT_HOST,
port: int = _DEFAULT_PORT,
*,
username: str | None = None,
password: str | None = None,
timeout: float = _DEFAULT_TIMEOUT,
tls: bool = False,
)
Blocking client for a RainbowMiner API server.
Wraps :class:RainbowMinerClient with a private event loop so that
every method can be called synchronously. Use it as a context manager
for automatic cleanup, or call :meth:close manually.
Configure the sync client and its private event loop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
Hostname or IP address of the RainbowMiner server. |
_DEFAULT_HOST
|
port
|
int
|
TCP port the API server listens on (default |
_DEFAULT_PORT
|
username
|
str | None
|
Optional username for HTTP Basic auth. |
None
|
password
|
str | None
|
Optional password for HTTP Basic auth. |
None
|
timeout
|
float
|
Request timeout in seconds. |
_DEFAULT_TIMEOUT
|
tls
|
bool
|
If |
False
|
get_console ¶
Get the console output and running miner logs (/console).
get_active_miners ¶
Get currently active miners (/activeminers).
get_running_miners ¶
Get currently running miners (/runningminers).
get_failed_miners ¶
Get miners that failed to start (/failedminers).
get_remote_miners ¶
Get remote miners connected to a server (/remoteminers).
get_miners_needing_benchmark ¶
Get miners that need benchmarking (/minersneedingbenchmark).
get_fastest_miners ¶
Get the fastest miners per algorithm/device (/fastestminers).
get_avail_miners ¶
Get the list of available miner base names (/availminers).
get_avail_miner_stats ¶
Get available miners with stat counts (/availminerstats).
load_config_json ¶
Load a raw config file as JSON string (/loadconfigjson).
load_config ¶
Load a config section (/loadconfig).
get_download_list ¶
Get the download queue (/downloadlist).
get_device_combos ¶
Get device combinations (/devicecombos).
get_device_config ¶
Get device selection/exclusion state (/getdeviceconfig).
get_earnings ¶
get_earnings(
*,
filter: Mapping[str, Any] | None = None,
sort: str = "Date",
order: str | None = None,
limit: int | None = None,
offset: int | None = None,
) -> EarningsResult
Get earnings with optional filtering, sorting, and paging (/earnings).
get_earnings_csv ¶
Get earnings as CSV (/earnings?as_csv=true).
get_session_vars ¶
Get scalar session variables (/sessionvars).
get_balances ¶
get_balances(
*,
raw: bool = False,
add_total: bool = False,
add_wallets: bool = False,
add_btc: bool = False,
consolidate: bool = False,
as_csv: bool = False,
) -> list[Balance] | BinaryResponse
Get balance information (/balances).
get_rates ¶
Get currency exchange rates (/rates).
get_asyncloader_jobs ¶
Get async loader jobs (/asyncloaderjobs).
get_miner_log ¶
Get the contents of a specific miner log file (/getminerlog).
get_miner_stats ¶
Get benchmark stats for all miners (/minerstats).
get_activity ¶
Get mining activity history (/activity).
get_computer_stats ¶
Get computer statistics (/computerstats).
get_current_profit ¶
Get current profit, earnings, rates, power, and uptime (/currentprofit).
get_clients ¶
Get connected RainbowMiner clients (/clients).
get_mrr_control ¶
Get MiningRigRentals control settings (/mrrcontrol).
save_config_json ¶
Save a raw JSON config string (/saveconfigjson).
save_config ¶
Save config fields (/saveconfig).
toggle_miner ¶
Enable or disable a miner (/action/toggleminer).
toggle_pool ¶
toggle_pool(
*,
name: str,
algorithm: str | None = None,
coin_symbol: str | None = None,
) -> ToggleResult
Enable or disable a pool (/action/togglepool).
save_miner_stats ¶
Download miner stats as a ZIP archive (/saveminerstats).