WhatsMiner API: частые вопросы о командах, пакетном управлении и диагностике
Чем API WhatsMiner отличается от WhatsMinerTool, как управлять мощностью и несколькими майнерами, как узнать, что майнер остановился, работает ли с ним Pyasic.
I Сравнение API и WhatsMinerTool
I Comparison Between API and WhatsMinerTool
1. Если выполнять одно и то же через WhatsMinerTool и через API, есть ли разница в эффективности и производительности?
1. When implementing identical functions, do WhatsMinerTool and the API differ in execution efficiency and operational performance?
Разницы нет: изменение предела мощности, например, работает одинаково в обоих.
There is no difference, for example, the function of adjusting the power limit achieves the same effect and efficiency.
2. Есть ли в API функции, которых нет в WhatsMinerTool?
2. Does the API provide exclusive functions that WhatsMinerTool does not support?
Через API у майнеров с воздушным охлаждением можно выставить в 0 некоторые настройки вентилятора — в WhatsMinerTool так сделать нельзя.
API can set up some settings for the fan of the air cooling miner to 0, which cannot be achieved in WhatsMinerTool.
3. На каком языке написан API? Есть ли рекомендации, на каком языке писать свою интеграцию?
3. What programming language is the API built with? Are there any recommended languages for secondary integration?
Запросы (Request) и ответы (Response) — в стандартном формате JSON, то есть API построен в стиле RESTful. JSON — универсальный формат данных, не привязанный к языку: его поддерживают все основные языки программирования (Python, Java, JavaScript, Go и другие). Сейчас есть демо-пример на Python. Писать можно на любом удобном языке, рекомендаций по языку пока нет.
Request and Response are both in standard JSON structure, indicating that this is an API design based on RESTful style. JSON is a language independent universal data format that supports all mainstream programming languages (such as Python, Java, JavaScript, Go, etc.). We currently provide a demo of Python. Users can choose their preferred language to write in, but there are currently no recommendations.
II Пакетное управление, хеш-платы и настройка мощности через API
II Batch Control, Hash Board & Power Tuning via API
1. Как через API получать данные с нескольких майнеров или настраивать их?
1. How can I obtain data or configure multiple miners through API?
Сначала просканируйте все майнеры в WhatsMinerTool, затем включите API — после этого доступны дальнейшие операции.
You need to scan all miners through WhatsMinerTool first, then enable the API function to proceed with the subsequent operations.
2. Можно ли отключить питание только одной хеш-платы WhatsMiner? Есть ли такая команда в API?
2. Can a single hashboard be powered off independently on WhatsMiner? Is this operation available via API commands?
Не поддерживается: управлять питанием каждой хеш-платы по отдельности нельзя.
For powering off one individual hashboard, it is not supported as we cannot control the power of one individual hashboard separately.
3. Если задать новый процент мощности, майнер выходит на нужную мощность примерно за 5 минут. Можно ли сократить это время?
3. If we set a new power percentage, the miner needs approximate 5 minutes to reach the desired power. Can this time be shortened?
Поддерживается быстрый старт за 10 секунд, после чего мощность выходит на заданное значение. См. раздел 3.14 Enable Btminer Fast BootPDF, англ. в руководстве по API (в API 3.0: set.miner.fastboot).
We support to fast boot in 10 seconds, the power will reach to the value you set. Refer to 3.14 Enable Btminer Fast Boot in API document.
4. Если сменить режим мощности, майнер перезапускается и выходит на стабильную работу примерно через 30 минут. Можно ли сократить это время?
4. If we set a different power mode, the miner restarts and needs approximate 30 minutes to achieve stable operation again. Can this time be shortened?
Время выхода на максимальный хешрейт можно сократить, настроив скорость тюна (upfreq). См. раздел 3.25 Adjust Upfreq SpeedPDF, англ. в руководстве по API (в API 3.0: set.miner.upfreq_speed).
We support to adjust upfreq speed to shorten the time to reach the highest hashrate. Refer to 3.25 Adjust Upfreq Speed in API document.
5. Можно ли через API отключить хеш-платы майнера?
5. For the miner, can a hashboard be switched off via the API?
Отключение хеш-плат поддерживается. См. раздел 3.3 Power Off HashboardPDF, англ. в руководстве по API.
We support to turn off hash board. Refer to 3.3 Power Off Hashboard in API document.
III Проверка состояния через API, совместимость, доработки и устранение неисправностей
III API Status Query, Compatibility, Customization & Troubleshooting
1. Какой командой API проверить, не перестал ли майнер майнить?
1. What command in API can I use to know if the miner has stopped mining?
Это покажут следующие команды.
{"cmd":"get.device.info"}
{"cmd":"get.device.info","param":"miner"}
Значение «false» у «working» означает, что майнер прекратил майнинг. Пример — на рисунке ниже.
You could get relevant information using the following commands.
{“cmd”:“get.device.info”}
{“cmd”:“get.device.info”,“param”:“miner”}
If "working" indicates "false", then it means the miner has stopped mining. The following figure can be used as a reference.
2. Совместим ли WhatsMiner с Pyasic?
2. Is Whats Miner compatible with Pyasic?
Да, Pyasic уже поддерживает WhatsMiner, но для работы ему нужен доступ к API. Документацию по работе с API можно скачать на официальном сайте WhatsMiner.
Pyasic already supports WhatsMiner, but requires API access. The documentation on how to use the API can be downloaded from our official website.
3. Можно ли доработать API, если мне нужны функции, которых в нём нет?
3. Does it support customization when I want to achieve functions through the API that the existing API cannot achieve?
Возможна ли доработка, решает команда разработки (R&D) после оценки: что именно вам нужно и насколько сложно это реализовать.
It is necessary for the R&D team to evaluate and determine whether customization is possible based on the specific content and implementation difficulty that you want to achieve.
4. Прошивка не обновилась или веб-интерфейс майнера не открывается в браузере по IP-адресу — в чём может быть причина и что делать?
4. If the firmware upgrade fails or the miner IP cannot be accessed in the backend on the browser after entering it, what could be the reason and how should I proceed?
Возможно, плату управления придётся прошить с карты памяти (card flashing). Подходящая для вашего майнера система прошивки платы управления — на официальном сайте WhatsMiner.
It may be necessary to perform card flashing on the control board. You can find the appropriate control board flashing system for your miner on the official website for operation.