A RESTful API wrapper for pyasic that provides easy access to ASIC miner information and management capabilities.
- Scan network subnets for ASIC miners
- Retrieve detailed miner information
- Get miner configurations
- Check miner error states
- Async implementation for efficient performance
- Add support for the control endpoints
- Add support for the settings as ENV
- Add a list of networks to scan as ENV var
Scans a subnet for miners and returns data for all discovered devices.
- Query parameter:
subnet
(default: "10.66.10.0/24") - Returns: Array of miner data objects
Retrieves detailed information for a specific miner.
- Path parameter:
ip
(miner's IP address) - Returns: Miner data object
Fetches configuration details for a specific miner.
- Path parameter:
ip
(miner's IP address) - Returns: Miner configuration object
Gets error information from a specific miner.
- Path parameter:
ip
(miner's IP address) - Returns: Object containing miner errors
curl -X POST http://localhost:9000/miner/192.168.1.100/fault-light/on
curl -X POST http://localhost:9000/miner/192.168.1.100/reboot
curl -X POST -H "Content-Type: application/json" -d '{"limit": 1400}' http://localhost:9000/miner/192.168.1.100/power-limit
-
Clone the repository:
git clone https://github.com/yourusername/pyasic-api.git
-
Install dependencies:
pip install fastapi uvicorn pyasic
Start the API server:
python app.py
The API will be available at http://localhost:9000
Get all miners in a subnet:
curl http://localhost:9000/miners?subnet=192.168.1.0/24
Get specific miner data:
curl http://localhost:9000/miner/192.168.1.100
- Build and start the container:
docker-compose up -d
- Build the Docker image:
docker build -t pyasic-api .
- Run the Docker container:
docker run -d -p 9000:9000 pyasic-api
You can directly use the pre-built Docker image available on Docker Hub: signalorange/pyasic-api
.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.