基于python的龙薄荷和innosilicon矿工管理工具
mother-of-dragons的Python项目详细描述
龙母
聪明点。做妈妈。做龙之母。
DragonMint/InnoSilicon T1/T2/B29/B52/A9管理工具基于 dragon-rest
功能
龙之母可以:
- 自动检测本地网络上的新龙并对其进行配置: 只要接通你的矿工,他们就可以出发了!
- 使用gevent轻松扩展到1000名矿工 库
- 从Dragons收集指标并将其转发给StatSD
- 当新矿工 添加
- 让你的龙在生病时重新启动,让它们保持快乐和健康
- 根据不同的龙应用不同的池配置 MAC地址
- 应与大多数龙薄荷或Innosilicon品牌的矿业公司合作
- 让你不用手动管理你的龙,这样你就可以走了 像电影明星一样度假
工作原理
当您运行“龙之母”时,它将启动3个独立的闭合循环:
扫描循环:以指定的间隔扫描本地网络 (
main.scan_interval
)寻找龙。它通过 发出http请求并检查结果。只有当 您的本地网络允许端口80上的流量传输到所有指定的IP, 用main.local_network.network
参数定义。当发现一条新的龙时,该龙将配置 所需的池和自动调谐。如果使用mac指定池配置 地址,母亲将为池配置分配匹配的地址。
如果设置了
auto_upgrade
,龙将更新为最新的 添加时的固件版本。
metrics循环:根据
main.statsd.interval
并将这些指标转发给statsd 已配置main.statsd.host
。health循环:根据指定的间隔检查每个龙
health_check_interval
如果出现以下情况,则可以(可选)重新启动龙:龙有一个或多个标记为“死亡”的设备(ASIC板)。
龙有一个或多个装置在下面
health_hashrate_minimum
至少health_hashrate_duration
。
该工具本身可以运行在低成本的服务器上,如覆盆子pi或 英特尔NUC。如果您打算为 度量标准,可能值得使用更强大的机器,如 具有足够存储空间的Intel NUC。
建议您使用主线Linux发行版,如Debian、Ubuntu或 半人马。
超级快速启动
$ pip install mother-of-dragons $ mother-of-dragons --print-config-toml > config.toml ### Edit config.toml to your liking ### $ mother-of-dragons --config=config.toml
或者,使用docker:
$ docker run -it mother-of-dragons --print-config-toml ...
配置
有关详细信息,请参见default config.toml 配置。
用法
usage: mother-of-dragons [-h] [-c CONFIG] [--print-config-toml]
[--print-config-json]
Management tool for DragonMint/Innosilicon miners.
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Path to config file in either TOML or JSON format.
(default: config.toml)
--print-config-toml Print default config in TOML and exit (default: False)
--print-config-json Print default config in JSON and exit (default: False)
脚本应该在与
你的龙。通过运行
pip install mother-of-dragons
。
一个示例systemd单元可能如下所示(假设用户 {{CD10>}):
[Unit]
Description=mother-of-dragons
After=network.target
[Service]
ExecStart=/usr/local/bin/mother-of-dragons \
--config=config.toml
Restart=always
User=mother-of-dragons
Group=users
[Install]
WantedBy=multi-user.target
仪表板示例
这个工具的一个重要附加值是statsd集成。它 允许您将度量值转发给prometheus/grafana、datadog或其他 时间序列度量和仪表板工具。
尖罐
- 3TeAE1OKEM5HQUXBBV99MbQYNES8J8N