pyasic

repository·master·Indexed 41 days ago

https://github.com/upstreamdata/pyasic

A simplified and standardized asynchronous interface for communicating with and controlling Bitcoin ASIC miners on a network. Version 0.79.0 provides tools to scan subnets for miners, retrieve metrics via MinerData, manage configurations with MinerConfig, and execute control functions such as reboot, set_power_limit, and stop_mining across various hardware brands.

Tokens
18.8K
Snippets
64
Records
134
Agent score
99%

What's inside pyasic

  1. Supported Auradine AI Models

    master

    The pyasic library provides support for Auradine AI models via the auradine.flux.AI module. Currently, the following stock models are supported with functionality for Shutdowns, Power Modes, and Setpoints:

    • AI2500 (Stock)
    • AI3680 (Stock)

    Note: Presets support may be pending for these models.

  2. Supported Auradine (AD) Miner Models

    master

    The pyasic library supports several Auradine (AD) miner models via the pyasic.miners.auradine.flux.AD module. The following models are currently supported with functionality for Shutdowns, Power Modes, and Setpoints:

    • AT1500
    • AT2860
    • AT2880

    Note: Support for 'Presets' may be pending for these models.

  3. Supported X7 Miner Models in pyasic

    master

    The pyasic library provides specific miner implementations for various X7 models. Depending on the hardware variant (Stock vs. VNish), different features like Shutdowns, Power Modes, Setpoints, and Presets are supported.

    Stock Models

    • D7 (Stock): Supports Shutdowns and Power Modes.
    • K7 (Stock): Supports Shutdowns and Power Modes.
    • L7 (Stock): Supports Power Modes.

    VNish Models

    • L7 (VNish): Supports Shutdowns, Setpoints, and Presets.
  4. Supported X9 Antminer Models and Capabilities

    master

    The pyasic library supports various X9 series Antminer models, including stock firmware and third-party firmwares (BOS+, VNish, Hiveon, LuxOS). Capabilities such as Shutdowns, Power Modes, Setpoints, and Presets vary by model and firmware version.

    Stock Models

    • D9: Supports Shutdowns and Power Modes.
    • E9Pro: Supports Power Modes.
    • L9: Supports Shutdowns and Power Modes.
    • S9 / S9i / S9j / T9: Currently no specific features listed as supported in this documentation segment.

    Third-Party Firmware Models

    • S9 (BOS+): Supports Shutdowns and Setpoints.
    • L9 (VNish): Supports Shutdowns, Setpoints, and Presets.
    • T9 (Hiveon): No specific features listed.
    • S9 (LuxOS): Supports Shutdowns, Setpoints, and Presets.
  5. Supported X15 Miner Models

    master

    The pyasic library provides support for X15 series miners through specific driver implementations. Currently, the following models are supported:

    Z15 (Stock)

    Implemented via the cgminer driver. Supported features include:

    • Shutdowns
    • Power Modes
    • Setpoints
    • Presets

    Z15 Pro (Stock)

    Implemented via the bmminer driver. Supported features include:

    • Shutdowns
    • Power Modes

    Note: Feature support (Setpoints and Presets) varies depending on whether you are using the CGMiner or BMMiner implementation.

  6. Supported A10X Avalon Miner Models

    master

    The pyasic library provides support for several Avalon A10X stock models via the cgminer implementation. The currently documented models include:

    • Avalon 1026 (Stock): Accessible via pyasic.miners.avalonminer.cgminer.A10X.A1026.CGMinerAvalon1026
    • Avalon 1047 (Stock): Accessible via pyasic.miners.avalonminer.cgminer.A10X.A1047.CGMinerAvalon1047
    • Avalon 1066 (Stock): Accessible via pyasic.miners.avalonminer.cgminer.A10X.A1066.CGMinerAvalon1066

    For these models, pyasic supports managing:

    • Shutdowns
    • Power Modes
    • Setpoints
    • Presets
  7. Supported Avalon A7X Models in pyasic

    master

    The pyasic library provides support for several Avalon A7X stock models via the avalonminer.cgminer.A7X module. The following models are supported:

    • Avalon 721 (Stock): Managed via pyasic.miners.avalonminer.cgminer.A7X.A721.CGMinerAvalon721
    • Avalon 741 (Stock): Managed via pyasic.miners.avalonminer.cgminer.A7X.A741.CGMinerAvalon741
    • Avalon 761 (Stock): Managed via pyasic.miners.avalonminer.cgminer.A7X.A761.CGMinerAvalon761

    For each of these models, pyasic supports managing:

    • Shutdowns
    • Power Modes
    • Setpoints
    • Presets
  8. Supported A8X Avalon Miner Models

    master

    The pyasic library supports several Avalon A8X stock models via the cgminer implementation. These models include support for managing Shutdowns, Power Modes, Setpoints, and Presets.

    Supported models:

    • Avalon 821 (Stock): pyasic.miners.avalonminer.cgminer.A8X.A821.CGMinerAvalon821
    • Avalon 841 (Stock): pyasic.miners.avalonminer.cgminer.A8X.A841.CGMinerAvalon841
    • Avalon 851 (Stock): pyasic.miners.avalonminer.cgminer.A8X.A851.CGMinerAvalon851
  9. Supported Goldshell X5 Models

    master

    The pyasic library provides support for several Goldshell X5 series models. Currently, the following stock models have support for Shutdowns and Power Modes:

    • CK5 (via pyasic.miners.goldshell.bfgminer.X5.CK5.GoldshellCK5)
    • HS5 (via pyasic.miners.goldshell.bfgminer.X5.HS5.GoldshellHS5)
    • KD5 (via pyasic.miners.goldshell.bfgminer.X5.KD5.GoldshellKD5)

    Note: Support for Setpoints and Presets is currently listed as pending/not implemented for these models.

  10. Work with MinerConfig for configuration management

    master

    MinerConfig is a dataclass representing a miner's configuration. It is designed to be a union of all supported miner configuration types.

    Usage Pattern:

    1. Retrieve the current configuration using await miner.get_config().
    2. Modify the configuration object.
    3. Apply the changes using await miner.send_config(config_object).

    Note: While MinerConfig has helper functions to convert to specific miner types, it is recommended to let send_config() handle the conversion automatically.

    import asyncio
    from pyasic import get_miner
    
    async def update_miner_config():
        miner = await get_miner("192.168.1.20")
    
        # get config
        cfg = await miner.get_config()
    
        # send config (send_config handles the conversion to the correct type)
        await miner.send_config(cfg)
    
    if __name__ == "__main__":
        asyncio.run(update_miner_config())
  11. How MinerConfig works

    master

    The MinerConfig dataclass represents a miner's configuration file. It is designed to unionize the configuration of all supported miner types and is returned by get_config().

    To update a miner's configuration, retrieve the MinerConfig object and pass it back to send_config(). The send_config() method handles the conversion to the specific format required by the miner type automatically.

    import asyncio
    from pyasic import get_miner
    
    async def update_config():
        miner = await get_miner("192.168.1.20")
        cfg = await miner.get_config()
        # Modify cfg here if needed
        await miner.send_config(cfg)
    
    if __name__ == "__main__":
        asyncio.run(update_config())