文档 · fearminer 1.15.2
开始使用 FearMiner 挖矿
先设置第一台矿机,需要更多控制时再查阅参考资料。
本页内容 设置第一台矿机
选择与调整挖矿
理解与排查问题
完整参考
展开参考资料以使用浏览器搜索或打印。
从这里开始
设置第一台矿机 #
按以下步骤连接电脑并从驾驶舱开始挖矿。
矿机就是用于挖矿的电脑。挖矿配置单保存币种、钱包地址和矿池设置。
检查电脑并准备资料
检查操作系统和所选算法是否受支持。准备好钱包的公开收款地址和矿池连接信息。切勿输入钱包助记词。
预期结果: 你已备齐受支持的硬件、公开地址以及矿池主机名和端口。
我们构建什么,以及它需要什么创建驾驶舱
打开网页应用并保存其 12 个恢复词。这些词用于恢复驾驶舱,与你的加密货币钱包无关。
预期结果: 驾驶舱已打开,恢复词已保存。
从驾驶舱开始安装并连接矿机
选择添加矿机,选择矿机的操作系统,然后在矿机上运行提供的命令。
在添加矿机中选择矿机的系统:Linux、Windows 或 Apple silicon 上的 macOS。HiveOS 和 mmpOS 请使用专门的设置指南。
预期结果: FearMiner 已安装并加入你的驾驶舱。
HiveOS 与 mmpOS 设置确认矿机已出现
在驾驶舱中找到矿机。已连接的矿机可能正在等待挖矿设置。
预期结果: 矿机已连接,即使尚未开始挖矿。
添加矿机应用挖矿配置单
选择币种,添加钱包地址和矿池,然后将配置单应用到矿机。
预期结果: 矿机收到并检查你的挖矿设置。
挖矿方案确认挖矿已开始
查看挖矿活动和已接受的份额。接受份额并不等于付款,支付时间由矿池决定。
预期结果: 已显示算力,矿池已接受你的工作。
钱去哪里了解如何暂停与返回
在驾驶舱中暂停或恢复。妥善保存恢复词,以便在另一台设备上打开驾驶舱。
预期结果: 你可以暂停挖矿活动并返回同一矿机群。
加入与远程通道
从命令行开始 #
先要有的东西:一个钱包地址 #
YOUR_WALLET 是钱包应用或交易所账户里的公开收款地址。绝不是私钥、助记词或密码。
链由地址推断,所以钱包决定算法;矿池由你选择(连接矿池)。各地址的写法见算法、费用与要求,校验规则见隐私、下载与本地文件。
下载并验证适合矿机系统的压缩包,解压后在该文件夹打开终端。下方的手动下载说明涵盖三个平台。 想自己下载?
示例:Quantus。将 POOL:PORT 和 YOUR_WALLET 替换为矿池连接信息和公开收款地址。rig1 是工作机名称。Windows 使用 .\fearminer.exe,Linux 和 macOS 使用 ./fearminer。
./fearminer -a quantus -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1
first share accepted after 12.3 s hashrate 588.5 MH/s
示例输出。算力和已接受的份额表示挖矿已开始,矿池已接受你的工作。
Ctrl+C 会正常停止前台运行。已安装的服务请使用 fearminer service stop,关闭终端不会停止服务。
fearminer service stop
安装与手动下载 #
详细说明与行为
一行命令安装 FearMiner,用发布密钥校验它,并作为服务保持运行。它挖驾驶舱给它的方案,或者在你选的矿池上挖到你的钱包。手动方式(下载、校验、运行)就在下面。
这些通用命令用于安装 FearMiner。要连接驾驶舱,请使用添加矿机提供的命令。没有钱包或挖矿配置单时,矿工会等待设置。
一行命令
一行命令 #
$ curl -fsSL https://get.fearminer.com | sh| 带上驾驶舱的代码 | curl -fsSL https://get.fearminer.com | sh -s -- fm1_... |
|---|---|
| 不用驾驶舱:你的钱包,你的矿池 | curl -fsSL https://get.fearminer.com | sh -s -- --wallet YOUR_WALLET --pool stratum+ssl://POOL:PORT --worker rig1 |
| 整台机器的服务(sudo) | curl -fsSL https://get.fearminer.com | sh -s -- --system |
| 只装二进制文件,不装服务 | curl -fsSL https://get.fearminer.com | sh -s -- --no-service |
PS> irm https://get.fearminer.com/win | iex| 带上驾驶舱的代码 | $env:FEARMINER_ENROLL='fm1_...'; irm https://get.fearminer.com/win | iex |
|---|---|
| 不用驾驶舱:你的钱包,你的矿池 | $env:FEARMINER_WALLET='YOUR_WALLET'; $env:FEARMINER_POOL='stratum+ssl://POOL:PORT'; $env:FEARMINER_WORKER='rig1'; irm https://get.fearminer.com/win | iex |
$ curl -fsSL https://get.fearminer.com | sh| 带上驾驶舱的代码 | curl -fsSL https://get.fearminer.com | sh -s -- fm1_... |
|---|---|
| 不用驾驶舱:你的钱包,你的矿池 | curl -fsSL https://get.fearminer.com | sh -s -- --wallet YOUR_WALLET --pool stratum+ssl://POOL:PORT --worker rig1 |
| 整台机器的服务(sudo) | curl -fsSL https://get.fearminer.com | sh -s -- --system |
| 只装二进制文件,不装服务 | curl -fsSL https://get.fearminer.com | sh -s -- --no-service |
Extra config arguments: --enroll fm1_...flight sheet 的其余部分见在 HiveOS 上设置 FearMiner。之后驾驶舱监看矿机,并可暂停、恢复或重启它;挖什么仍由 flight sheet 决定。
| 校验 | 用发布密钥校验 SHA256SUMS(minisign 或 OpenSSL 3),再按 SHA256SUMS 校验压缩包;两个工具都没有时,download.fearminer.com 与 GitHub 必须一致。Windows 上两个主机必须一致,之后由 fearminer verify 校验签名。在此之前什么都不运行 |
|---|---|
| 安装 | 你账户的服务,无需密码:随机器启动(Windows 上在你登录时),崩溃后重启;--system 通过 sudo 安装整台机器的服务 |
| 挖什么 | 驾驶舱给它的挖矿方案,或 --wallet 加 --pool;两者都没有时,它监看显卡并等待 |
| 之后 | fearminer service status、fearminer service logs(服务) |
想自己下载?
想自己下载? #
两个主机上的文件完全相同:
| download.fearminer.com | fearminer-linux-x86_64.tar.gz, fearminer-windows-x86_64.zip, fearminer-macos-arm64.tar.gz, SHA256SUMS, SHA256SUMS.minisig |
|---|---|
| GitHub ↗ | 同样的文件,以及所有旧版本 |
然后手动校验、解包、运行:
首次运行时的警告
用不是我们的工具校验下载:上面那条命令把归档和 SHA256SUMS 对比。minisign -Vm SHA256SUMS -P <发布密钥> 以同样的方式校验签名。等到可以信任这个二进制文件之后,fearminer verify SHA256SUMS 离线一次做完两件事(隐私、下载与本地文件)。
$ curl -LO https://github.com/fearminer/fearminer/releases/latest/download/fearminer-linux-x86_64.tar.gz $ curl -LO https://github.com/fearminer/fearminer/releases/latest/download/SHA256SUMS $ grep ' fearminer-linux-x86_64.tar.gz$' SHA256SUMS | sha256sum -c - $ tar xzf fearminer-linux-x86_64.tar.gz && cd fearminer-*-linux-x86_64 $ ./fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1
Linux
请先验证下载文件,再按相应平台的首次运行说明操作。 验证下载
Linux 和 HiveOS 上不会发生这类事:没有 SmartScreen,没有 Gatekeeper,也没有要清除的隔离标记。解压,运行 fearminer verify,开挖。
PS> Invoke-WebRequest https://github.com/fearminer/fearminer/releases/latest/download/fearminer-windows-x86_64.zip -OutFile fearminer-windows-x86_64.zip PS> Invoke-WebRequest https://github.com/fearminer/fearminer/releases/latest/download/SHA256SUMS -OutFile SHA256SUMS PS> (Get-FileHash .\fearminer-windows-x86_64.zip -Algorithm SHA256).Hash.ToLower() PS> Select-String windows-x86_64 SHA256SUMS PS> Expand-Archive fearminer-windows-x86_64.zip -DestinationPath . ; cd fearminer-*-windows-x86_64 PS> .\fearminer.exe -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1
Windows
请先验证下载文件,再按相应平台的首次运行说明操作。 验证下载
Microsoft Defender SmartScreen 的 Windows 已保护你的电脑,下面写着未知发布者。运行按钮藏在那行小链接后面:先点更多信息,再点仍要运行。SmartScreen 对每个文件只问一次,所以新版本会再问一次。
Microsoft Defender 还可能把矿工程序当作潜在有害应用隔离,名字通常是 HackTool 或 CoinMiner:在扫描器眼里,任何矿工程序都是这个样子,无论谁写的。要保留它:Windows 安全中心,病毒和威胁防护,管理设置,排除项,添加或删除排除项,添加排除项,文件夹,选中压缩包解压出来的那个文件夹。在管理员权限的 PowerShell 里同样一句:Add-MpPreference -ExclusionPath C:\Users\you\fearminer-windows-x86_64。只排除这一个文件夹,不要排除整个磁盘,而且要在上面的检查通过之后再做。
$ curl -LO https://github.com/fearminer/fearminer/releases/latest/download/fearminer-macos-arm64.tar.gz $ curl -LO https://github.com/fearminer/fearminer/releases/latest/download/SHA256SUMS $ grep ' fearminer-macos-arm64.tar.gz$' SHA256SUMS | shasum -a 256 -c - $ tar xzf fearminer-macos-arm64.tar.gz && cd fearminer-*-macos-arm64 $ xattr -dr com.apple.quarantine . $ ./fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1
macOS
请先验证下载文件,再按相应平台的首次运行说明操作。 验证下载
Gatekeeper 的 fearminer cannot be opened because the developer cannot be verified。凡是经浏览器下载的文件都会带上 com.apple.quarantine 标记,而既没有签名也没有公证的二进制文件在首次运行时不是被问一句,而是直接被拒绝。
两条出路,每个版本各做一次。系统设置,隐私与安全性,向下滚到安全性,那里会点名被拦下的二进制文件,点仍要打开,再在随后的对话框里点打开。或者在终端里、在解压出来的文件夹内清除该标记,这也正是 start_<algo>.sh 启动脚本替你做的事:xattr -dr com.apple.quarantine .
Flight sheet:矿工 custom 安装 URL:最新版本中的 fearminer_custom-<version>.tar.gz 资产, https://github.com/fearminer/fearminer/releases/download/v1.15.2/fearminer_custom-1.15.2.tar.gz 哈希算法: qpow · 钱包模板: %WAL%.%WORKER_NAME% 矿池 URL: stratum+ssl://POOL:PORT · 密码: x Extra config arguments:任意选项,例如 -d 0,2 --tls-fingerprint SHA256
矿池由你选择:主机和端口见矿池自己的页面。FearMiner 从不替你挑选矿池,没有矿池的钱包会被拒绝(E224)。
Flight sheet:custom miner。完整的配置表和每种算法的 HiveOS 名称见在 HiveOS 上设置 FearMiner。
Windows 和 macOS 在首次运行时会拦下未签名的二进制文件;杀毒软件可能把任何矿工归为 HackTool。它们会说什么、该点哪里,就在下面。隐私、下载与本地文件:如何确认下载的确实是我们的。
看到这些就是成功了
看到这些就是成功了 #
job 9dd830e6 diff 18.25G ✔ 1/1 · GPU0 · 18.25G · 24 ms hashrate 618.4 MH/s (10m 611.9, session 609.8, eff 598.2 / 97.8 %) job 4b1c77a2 diff 40.0K ✔ 1/1 · CPU · 40.0K · 31 ms hashrate 7.1 kH/s (10m -, session -, eff -)
一个任务、一个被接受的份额、一个算力:已经在挖了。第一段是 GPU 矿机,第二段是 CPU 矿机。
在窗口内接受满十个份额之前,eff 和各项平均值都显示 -。查看终端面板与日志逐行讲解整个启动块。
停止:终端面板里按 q,或 Ctrl+C。两者都会干净地停止,退出码 0。
管理矿机
详细说明与行为
app.fearminer.com 上的驾驶舱免费、无需账号、端到端加密:它与矿机之间的中继只转发它无法读取的密封消息。它显示矿场的算力和历史,设定每台矿机挖什么,并可暂停、恢复或重启矿机。
添加矿机
添加矿机 #
| 1 | 打开 app.fearminer.com,点「创建我的驾驶舱」,抄下 12 个单词。它们就是你的矿场:没有账号、没有密码,也是在另一台设备上找回的唯一方式。 |
|---|---|
| 2 | 「添加矿机」给出一行带有你代码的命令(fm1_...)。在矿机上运行它(设置第一台矿机)。 |
| 3 | 矿机几秒内出现。给它一个挖矿方案,它就开挖。 |
已经装了 FearMiner:在矿机上运行 fearminer enroll fm1_...,无需重启。它会打印矿机的名称(XXXX-XXXX-XXXX-XXXX)和矿场的名称;驾驶舱显示同样的名称:核对一下。
$ fearminer enroll fm1_... $ fearminer remote status
挖矿方案
挖矿方案 #
| 是什么 | 矿机挖什么:算法、钱包及其矿池(至少一个,由你选择);相当于驾驶舱的 flight sheet |
|---|---|
| 校验 | 由矿机按启动时的方式校验:钱包对应的链、矿池、选项。有问题的方案会被拒绝并说明原因;挖矿照旧继续 |
| 应用 | 同一算法无需停止即可重载;换算法,或矿机原本只在监看,则重启矿工,但绝不重启服务 |
| 保存 | 在重载和重启后保留,覆盖矿机自身的配置(状态目录中的 remote-sheet.json);上一个方案会保留,可一键回退 |
| TensorCash | 带 wss:// 矿池的方案需要矿机运行 FearMiner 1.7.1 或更新版本;较旧的矿机会被驾驶舱排除并说明原因。矿池令牌不在方案中:它留在矿机上,用 -p token-file=<路径> 启动 |
| 还没有方案 | 未带钱包安装的矿机监看显卡,等待方案 |
驾驶舱更新适用于符合条件的 Linux 服务。HiveOS 自行管理更新;mmpOS 需要新版本 URL。Windows 和 macOS 请重新运行安装程序。
更换钱包前的通知期 #
默认情况下,新钱包立即生效。在矿机上设置 --remote-wallet-delay 可让它等待;可在驾驶舱中取消待处理的更改,或在矿机上运行 fearminer remote cancel。
详细说明与行为
| 何时 | 方案中的钱包与当前挖矿的钱包不同 |
|---|---|
| 等待 | --remote-wallet-delay 分钟,默认 0(立即生效);设置通知期时,期间矿机继续挖到原钱包 |
| 通知 | 附两个地址,发给通知渠道(设置告警)并写入矿机日志 |
| 取消 | 在任意驾驶舱中,或在矿机上运行 fearminer remote cancel |
设置通知期后,即使有人进入了你的驾驶舱,也无法悄悄转走你的算力:你有这段时间发现并阻止它。
HiveOS · mmpOS #
HiveOS 的飞行表和 mmpOS 的配置档决定挖矿内容。驾驶舱可以监控、暂停、恢复和重启这些矿机。mmpOS 为测试版,尚未在真实矿机上测试。
集成细节与可选参数
| 加入 | 在 flight sheet 的 Extra config arguments 中加 --enroll fm1_...(在 HiveOS 上设置 FearMiner),或在 mmpOS 矿工配置的 Arguments 中加(在 mmpOS 上设置 FearMiner,测试版) |
|---|---|
| 驾驶舱 | 显示矿机,可暂停、恢复和重启它 |
| 挖什么 | 由 flight sheet 决定;矿机拒绝挖矿方案并说明原因。mmpOS 上也一样 |
| 服务 | 不需要,也会被拒绝(E802):由 HiveOS 或 mmpOS 运行矿工 |
加入与远程通道
加入与远程通道 #
| 命令 | 作用 |
|---|---|
fearminer enroll CODE | 加入代码对应的矿场。再次加入同一矿场不改变任何东西;另一个矿场会被拒绝,直到 --leave。 |
fearminer enroll --status | 矿机所属的矿场、它的名称、通道。 |
fearminer enroll --leave | 立即退出矿场:此后拒绝它的命令。挖矿继续。 |
fearminer remote status | 矿机、所属矿场、通道、连接、当前方案和待生效方案、最近十条命令。--json。 |
fearminer remote off · on | off 拒绝本机上的所有远程命令,无论谁签名,直到 on。挖矿继续。 |
fearminer remote cancel | 取消一个正在等待通知期的方案:钱包保持不变。 |
服务 #
让一次运行变成常驻:与运行相同的选项,写在 service install 之后。设置第一台矿机的那一行命令会替你完成。只有通过启动时的检查才会安装。
| Linux | 你账户的 systemd 单元,开机启动(开启 lingering) |
|---|---|
| macOS | 你账户的 LaunchAgent |
| Windows | 登录时运行的任务,矿工在自己的窗口中 |
| 容器 | 没有 systemd 的 Linux(Vast.ai、RunPod、Docker):你账户的后台进程,在那里以 root 身份配合 --allow-root 运行。把 ~/.local/bin/fearminer service start 放进机器的启动脚本(Vast.ai:模板的 On-start script),重启后即可再次启动 |
--system | 整台机器的服务,通过 sudo,适用于 Linux 和 macOS;Linux 上以专用的 fearminer 账户运行 |
| 重启 | 失败后重启;你要求的停止之后不重启,退出码 2、4 或 12 之后也不重启 |
| HiveOS、mmpOS | 拒绝,不写入任何东西(E802):由 flight sheet 运行矿工 |
$ fearminer service install -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1 $ fearminer service status $ fearminer service logs
| 命令 | 作用 |
|---|---|
fearminer service install [OPTIONS] | 按启动时的方式检查选项,把二进制复制到固定位置,写入设置,然后声明、启用并启动服务。再次运行:替换设置;不带选项:更新二进制。 |
fearminer service status | 是否已安装,mining、monitoring 或 stopped,自何时起,pid、账户、二进制、设置、日志位置、算力。--json。 |
fearminer service logs | 最后 50 行,然后持续跟随(Ctrl+C)。--no-follow 到此为止。 |
fearminer service stop · start · restart | 干净地停止,显卡恢复原状;随机器启动时会再次运行。start 和 restart 顾名思义。 |
fearminer service uninstall | 停止并移除服务、它放置的二进制和 service.json。设置、历史和密钥保留,并逐一列出。 |
| 二进制 | ~/.local/bin/fearminer · ~/Library/Application Support/fearminer/bin/ · %LOCALAPPDATA%\Programs\FearMiner\;使用 --system 时为 /usr/local/bin/fearminer |
|---|---|
| 设置 | 配置目录中的 service.toml,仅你的账户可读;保存的修改在一秒内生效 |
| 日志 | Linux 上为 journal,macOS 和 Windows 上为矿工自己的轮转日志文件;fearminer service logs 在所有平台上都能显示 |
E801 至 E808 是服务的代码,E809 至 E812 是远程通道的代码,E813 至 E819 是更新的代码,E820 表示基准测试被拒绝(理解错误)。服务运行时手动启动的矿工会在锁处停止(E210)并点名该服务。
详细说明与行为
其余都有能用的默认值。
| 钱包 | -u WALLET.rig1 | 收款地址,可带 .worker。未给 -a 时由它决定链;它总要和矿池(-o)一起给出。 |
|---|---|---|
| 矿池 | -o stratum+ssl://host:port | stratum+ssl:// 是 TLS 端口,stratum+tcp:// 或裸 host:port 是明文端口。重复 -o 添加备用矿池,在第一个不可用时启用。TensorCash 使用 wss://host/v1/ws 矿池,会话由其引擎持有。 |
| 算法 | -a quantus | quantus(GPU 与 CPU)、randomx(CPU)、pearl(NVIDIA sm_86、sm_89、sm_120)、tensorcash(NVIDIA,需 11.1 GB 空闲显存)。不写时按钱包推断。 |
| 显卡 | -d 0,2 | 索引、PCI id 或 UUID,逗号分隔;!1 排除 1 号卡。--list-devices 会打印它们。默认是所有独立显卡;--igpu 才加上集成显卡。 |
| CPU 线程 | -t 8 | 数量、百分比(50%)或 +N。randomx 每个物理核一个;quantus 在有 GPU 的机器上默认关闭,直到用 -t。 |
$ ./fearminer -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 $ ./fearminer -o stratum+ssl://pool.example.com:3335 -o stratum+tcp://backup.example.com:3333 -u YOUR_WALLET.rig1 $ ./fearminer -a randomx -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 -t 50% $ ./fearminer -a pearl -o stratum+ssl://POOL:PORT -u YOUR_WALLET -w rig1 $ ./fearminer -a tensorcash -o wss://POOL/v1/ws -u YOUR_WALLET.rig1 -p token-file=TOKEN_FILE $ ./fearminer -o pool.example.com:3333 -u YOUR_WALLET -w rig1 -d 0,2
-u 是钱包,可带 .worker,-o 是矿池,-a 是算法,-d 是显卡,-t 是 CPU 线程。
fearminer -o stratum+ssl://POOL:PORT -u WALLET
不用命令行 #
用文本编辑器打开 start_quantus.sh(或 start_randomx、start_pearl;Windows 上是 .bat),把钱包填进 WALLET,矿池填进 POOL,名字填进 WORKER,然后运行。它拒绝占位值,并在可以重试的停止之后重启矿工(理解错误)。
详细说明与行为
发布版本的 fearminer_custom-<version>.tar.gz 资产是 HiveOS custom miner:二进制文件和四个 h-*.sh 脚本,放在 fearminer_custom 文件夹中。HiveOS 将它显示为 fearminer_custom。统计数据来自矿工自己的 /hive-stats,原样转发。
| Flight sheet | 取值 |
|---|---|
| Miner | custom |
| Installation URL | https://github.com/fearminer/fearminer/releases/download/v1.15.2/fearminer_custom-1.15.2.tar.gz |
| Hash algorithm | qpow (Quantus) · randomx (Monero, CPU) · pearlhash (Pearl, NVIDIA sm_86, sm_89, sm_120) · tensorcash (TensorCash, NVIDIA) |
| Wallet and worker template | %WAL%.%WORKER_NAME% |
| Pool URL | stratum+ssl://host:port · host:port |
| Pass | x |
| Extra config arguments | 可选参数任意选项:--enroll fm1_...(驾驶舱,从驾驶舱管理矿机)、--tls、-d 0,2、-t 0、--tls-fingerprint <sha256>、--no-supervisor、--notify-telegram ... |
包内脚本
安装包从这些字段组装命令行:
-a | 来自哈希算法(为空时 quantus) |
|---|---|
-o | 来自矿池 URL |
-u | 来自模板 |
-p | 来自密码(为空时 x) |
--api-bind 127.0.0.1:4300 | 以便 h-stats.sh 读取统计 |
| 额外参数 | 放在最后 |
FEARMINER_NO_TUI=1 | 因为没有终端 |
h-run.sh 传入 --allow-root,因为 HiveOS 以 root 运行每个矿工,而二进制文件否则会拒绝以 root 启动。
flight sheet 中无需添加任何内容。
集成细节与可选参数
崩溃或显卡挂起会在退避后重启挖矿进程。
/hive-stats 在同一端口上恢复,每卡崩溃数和重启数都在上面。
HiveOS 看门狗覆盖监督进程放弃的情况(退出码 12)。
额外参数中的 --no-supervisor 以单进程运行,把所有重启交给 HiveOS。
统计约定:
khs | 矿机总算力(kH/s),即对象自己的 total_khs |
|---|---|
hs | 每卡一项(kH/s),或 CPU 算法(randomx)上每 CPU 行一项,fan 和 bus 为零 |
bus_numbers | 把它们映射到显卡 |
ar | [accepted, rejected, invalid, "invalid per row"]:矿池的两个裁定,然后是 CPU 复核在提交前拒绝的 GPU 解,先是总和,再是 hs 每行一个数字,CPU 行为 0 |
超频留给 flight sheet:没有超频选项时,矿工不触碰任何频率、功耗上限或风扇寄存器。
额外参数中的 --no-oc 把这一点说明白。
HiveOS 以 root 运行矿工,所以超频选项在那里无需辅助程序即可工作。
详细说明与行为
测试版,自 1.5.3 起:按 mmpOS 公布的 custom miner 指南制作并据此核对,尚未在真实的 mmpOS 矿机上运行过。有什么不工作,请在 Telegram 频道或 issue 里告诉我们。版本中的 fearminer_mmpos-<version>.tar.gz 资产就是 mmpOS 的 custom miner;在 mmpOS 控制台里:
| mmpOS 控制台 | 取值 |
|---|---|
| Wallets | 你所挖币种的地址 |
| Pools | 该币种的矿池,SSL 端口勾选 SSL,用户名用 mmpOS 建议的(%wallet_address%.%rig_name%%miner_id%),密码 x |
| Miner profiles, Basics | 币种(Pearl 为 PRL,Quantus 为 QTC,Monero 为 XMR,TensorCash 为 TSC),平台 Linux / mmpOS,矿工 Custom miner,以及上一行的矿池 |
| Custom miner download url | https://github.com/fearminer/fearminer/releases/download/v1.15.2/fearminer_mmpos-1.15.2.tar.gz,或 https://download.fearminer.com/v<version>/ 下的同一文件 |
| Advanced: Api port | 4444,或任意空闲端口 |
| Advanced: Arguments | 使用下方的参数行。可选参数mmpOS 为 custom miner 填入的那一行(见下),然后是任意选项: --enroll fm1_... 加入驾驶舱(从驾驶舱管理矿机),-d 0,2 只用部分显卡,-t 0 在 Quantus 上不用 CPU 线程 |
./mmp-launch.sh --coin %coin% %pool_protocol% --pool %pool_server%:%pool_port% --user %user% --password %password% --api-port %api_port%
保存配置并在矿机上选中它。SSL 矿池请在该行保留 %pool_protocol%,或在其后加 --tls。
mmpOS 只下载一次 URL 并保留所得,所以新版本就是新的 URL:要更新,把新版本的 URL 填进配置。
矿工的日志写入 mmpOS 自己的日志,统计通过 /mmpos 送到 mmpOS,驾驶舱把该矿机显示为由 mmpOS 管理:挖什么由配置决定。
选择与调整挖矿
详细说明与行为
fearminer --list-algorithms 打印的就是同一份清单,每个算法一行并附一句说明;配合 --json,输出一个 {name, coin, class, fee_bps, aliases, unit, hive, requirements, refused} 数组。
这份清单就是签名的引擎索引:新算法在本页下次构建时成为新的一行,并且无需发布新版矿工就会作为新引擎到达矿机(见下文“引擎”)。
| 算法 | 币种 | 硬件 | 费用 | 别名 | HiveOS | 单位 |
|---|---|---|---|---|---|---|
commonfoundry | CMFD | NVIDIA CUDA;无 CPU 引擎;8192 MiB 内存;7200 MiB 空闲显存 | 3 % | cmfd, common-foundry, productionv4 | commonfoundry | FW/s |
pearl | PRL | NVIDIA CUDA,仅 sm_86、sm_89、sm_120;无 CPU 引擎;4514 MiB 空闲显存 | 2 % | pearlhash, prl | pearlhash | MAC/s |
quantus | QTC | NVIDIA CUDA、Vulkan(其他 GPU);CPU | 2 % | qpow, qtc, quan, qpow-poseidon2 | qpow | H/s |
randomx | XMR | 仅 CPU;2080 MiB 内存 | 0.85 % | rx, rx/0, monero, xmr | randomx | H/s |
tensorcash | TSC | NVIDIA CUDA;无 CPU 引擎;16384 MiB 内存;11319 MiB 空闲显存 | 2 % | tsc, poi, proof-of-inference | tensorcash | PoI/s |
费用为上限。签名条款指定费用端点前,Pearl 不收取费用。性能示例是指定硬件上的测量结果,不保证达到同样速度。
费用轮次与日志
表中的费率按算法计,以一分钟为一轮在单独的连接上挖取,从不占用你的会话,并显示在终端面板标题栏。
它是来自签名引擎索引的上限,永不超过 5 %:cfg.fearminer.com 的已签名条款只能调低,不能调高。条款中没有费用矿池的算法免费挖矿,启动时说明一次。
fee window 给出第一轮何时到来;每一轮记录 fee round started (1 min) 和带份额数的 fee round ended。
兼容的新算法和引擎更新可以自动下载并验证。
引擎下载、更新与回滚
引擎下载、更新与回滚 #
矿工本身不做任何哈希:每个算法都是独立的引擎 fearminer-engine-<algo>,一个由矿工下载、启动并保持最新的签名程序。矿池会话、费用、监督进程、传感器、API 和终端面板仍在矿工中。
| 来源 | download.fearminer.com/algos/,列在 index.json 中:每个算法的名称、币种、单位、费用上限、要求和版本,每个构建附 SHA-256 |
|---|---|
| 校验 | 每次启动前,用编译进矿工的算法密钥校验索引(签名不符为 E321),用索引中的 SHA-256 校验每个引擎(E323) |
| 构建 | Linux x86_64(CPU;CUDA 12.9 用于 575 及更新的驱动;CUDA 12.4 用于 HiveOS 0.6 的 550 驱动)、Windows x86_64(CPU、CUDA)、macOS arm64。优先使用与驱动系列匹配的 CUDA 构建,CPU 构建排最后 |
| 缓存 | <状态目录>/engines/:索引以及每个算法最近的两个版本 |
| 离线 | 无法获取索引(E322):使用缓存的索引,否则使用发布压缩包在二进制文件旁 engines/ 中附带的种子,因此首次启动(包括 HiveOS 的 USB 镜像)可以使用本地引擎;挖矿仍需要连接矿池 |
| 更新 | 每小时一次:较新的引擎被下载、校验,在运行中的引擎旁启动,自检并接手当前任务;旧引擎在两个任务之间停止(E326) |
| 回退 | 新引擎自检失败,或十分钟内算力低 5 %,就会回退,并在下一版索引之前不再尝试(E327) |
| 固定版本 | --engine quantus=<VERSION>,可重复,或 FEARMINER_ENGINE,或配置文件的 engine 键:运行该版本,任何更新都不会改变它 |
| 没有引擎 | 任何地方都没有索引,或没有适合本机的构建(E324),或算法属于本矿工不支持的登录协议族(E325):矿工不挖矿,只监看显卡 |
| 要求 | 机器低于算法要求时会得到提示(E329) |
| 崩溃 | 崩溃的引擎在退避后重启,当前任务重新交给它(E320) |
| 费用 | 费用上限来自索引,永不超过 5 %;用另一算法挖取的费用会让该引擎常驻并暂停,内存不足时则每轮启动一次(E328) |
| API | /api/v1/summary 的 engines[]:每个运行中的引擎,其算法、角色、版本、构建和来源 |
矿工已支持的登录协议族中的新算法,无需发布新版矿工即可挖矿。
各条链的钱包
各条链的钱包 #
链由钱包推断,所以只给地址就能选定算法。启动时会验证每个地址的校验和;--ignore-wallet-check 原样发送你输入的内容。
| QTC | Quantus 网络的 SS58 地址,前缀 189。+diff 后缀或 solo: 前缀原样发给矿池 |
|---|---|
| XMR | 95 个字符,以 4(标准)或 8(子地址)开头;106 个字符以 4 开头(集成地址)。testnet 或 stagenet 地址会被点名拒绝 |
| PRL | prl1...,bech32m,校验和已验证。测试网络的 tprl1... 和 rprl1... 会被拒绝 |
| TSC | tc1q...,segwit(bech32)地址,或该链的 base58check 地址,校验和已验证 |
我们构建什么,以及它需要什么 #
只发布三种构建,没有别的。
| Linux | x86_64,针对 glibc 2.35(Ubuntu 22.04)构建,因此需要 glibc 2.35 或更新。没有 ARM 构建 |
|---|---|
| Windows | x86_64,用 mingw-w64 交叉构建。没有 32 位构建 |
| macOS | 仅 Apple silicon,用 macOS 15.5 SDK 构建。没有 Intel 构建 |
GPU,用于 Quantus:compute capability 7.0 或更新、且有 256 MB 空闲显存的 NVIDIA 显卡,驱动为 550 系列或更新(RTX 50 需 570)。低于任一门槛的显卡会被排除在本次运行之外,并给出各自的代码(显存是 E310,驱动是 E308)。
其他 GPU 在 Vulkan 上运行,速度只有一小部分。RandomX 完全不需要 GPU。Pearl 仅在 NVIDIA sm_86、sm_89 和 sm_120 显卡(RTX 30、40 和 50 系列)上运行,需 4.7 GB 空闲显存。TensorCash 仅在 NVIDIA 显卡上运行,需 11.1 GB 空闲显存,没有 CPU 引擎。
Vulkan 和 Metal 不提供任何传感器:它们没有温度、风扇或功耗读数,温度保护也无法生效。温度保护通过 NVML 覆盖 NVIDIA 显卡,仅此而已(选择与管理设备)。
CPU 性能调整
CPU 引擎:线程与绑定 #
每种算法下的规则相同。
| 默认 | 每个物理核心一个线程,每核心绑定一个,分布到各 NUMA 节点 |
|---|---|
-t | 数字 8、该自动值的百分比 50%、增减量 -2 或 +2,或每算法一个值 randomx:16 |
--cpu-affinity | 改为把工作线程绑定到掩码或 CPU 列表 |
--cpu-priority 0..5 | 按 XMRig 的刻度设置优先级 |
| 上限 | -t 超过机器能腾出的数量(除两个之外的所有线程,每张卡再减一个)会被压到该上限,并打印一行说明 |
| Intel 混合架构 | 能效核心也计入,每个约为性能核心速率的一半 |
RandomX:大页 #
数据集、缓存和 scratchpad 放在 2 MiB 页中时,RandomX 快 20 到 30 %,某些机器上可达 50 %。
分配数据集之前,矿工计算需要多少:
| 数据集 | 2080 MiB |
|---|---|
| 缓存 | 256 MiB |
| 每线程 | 2 MiB |
即 16 线程需要 1184 页。
它读取内核的空闲池,不足时请求下面的辅助程序扩大它,多节点机器上按 NUMA 节点进行。
启动时:huge pages 100 % (1184/1184 x 2 MiB),或 E609 并附需要预留的数量和命令。
没有辅助程序时,趁内存尚未碎片化,刚开机就手动预留,并让设置在重启后保留。
transparent_hugepage 设为 always 时会补上未放进去的部分。
$ sudo sysctl -w vm.nr_hugepages=1184 $ echo 'vm.nr_hugepages = 1184' | sudo tee /etc/sysctl.d/90-fearminer.conf
1 GiB 页:--1gb-pages(文件中为 huge_pages_1g,默认关闭,与 XMRig 相同)。
在 CPU 支持时(pdpe1gb)为数据集按每个 NUMA 节点预留三个 1 GiB 页,比 2 MiB 页快 1 到 3 %。
仅在内核默认大页尺寸为 1 GiB 时使用:内核命令行上的 default_hugepagesz=1G hugepagesz=1G hugepages=3,这也会在内存碎片化之前预留它们。
否则 E610 会说明,并使用 2 MiB 页。
| Windows,大页 | 给你的账户 Lock pages in memory 权限(secpol.msc,Local Policies,User Rights Assignment),注销再登录,重启最可靠。权限缺失时启动打印 E612 |
|---|---|
| Windows,MSR | 没有 MSR 调优(E611,只说一次):它需要内核驱动,而本矿工不安装任何驱动 |
| macOS | 没有应用程序可以申请的大页,也没有 MSR;回退模式是唯一模式 |
RandomX:MSR 调优 #
XMRig 在 Ryzen 和 Intel 上的预取器设置在 Intel 上最多值 30 %,在 Zen 上最多 6 %。其公开值:
- Zen 1 和 Zen 2
- Zen 3
- Zen 4 和 Zen 5
- Intel Core
它们需要 root:矿工在首次网络连接之前请求辅助程序,自己从不以 root 运行。
--msr auto 是默认值,按 CPU 的家族和型号选择预设。
有辅助程序时即应用。否则矿工指出损失并照常启动:
E601 | 辅助程序缺失或 sudo 拒绝 |
|---|---|
E603 | 虚拟机 |
E604 | kernel lockdown(Secure Boot) |
E605 | 没有 msr 模块(modprobe msr) |
E606 | 模块拒绝写入 |
E607 | CPU 没有公开预设 |
每行都附估计损失和一行修复方法。
--msr off | 什么都不写 |
|---|---|
--msr zen3 | 强制一个预设;也可用 zen1、zen2、zen4、zen5、intel |
--msr addr:value:mask,... | 在预设所调的寄存器上应用自定义列表:0x1a4、0xc0011020 到 0xc0011022、0xc001102b。其他地址一律拒绝 |
原始值先被读取,保存在 root 拥有的文件中。
它们在挖矿进程每次结束时写回,无论正常停止还是崩溃(E614,写不回时 E608)。
启动时一个块给出引擎的配置:
- JIT 或解释器
- 硬件或软件 AES
- MSR 行
- 大页行
- 线程及其放置
最后是达到理想配置的比例(两者都缺失时为 performance: about 52 % of the ideal configuration)。
--list-devices --json -a randomx 在 cpu.performance 下给出同样内容,不应用任何东西(其他算法下为 null)。
$ fearminer -a randomx -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 -t 50% --cpu-affinity 0-7 --msr zen4 randomx MSR zen4 preset applied on 16 CPU(s) via /usr/local/bin/fearminer-helper (sudo) randomx huge pages 100 % (1184/1184 x 2 MiB) randomx 8 thread(s) on CPU 0-7 (--cpu-affinity) randomx performance: the ideal configuration (JIT, hardware AES, huge pages, MSR)
辅助程序:fearminer-helper #
fearminer-helper 随 Linux 压缩包与 fearminer 一起发布,是唯一的特权组件。
- 独立的二进制文件:无网络、无配置文件、不依赖矿工。
- 它按请求写入 MSR 寄存器并扩大大页池。
- 它把每一步记录到 stderr,并以一行 JSON 应答。
- 矿工在首次网络连接之前以
sudo -n fearminer-helper ...运行它(从不经过 shell),之后不持有任何特权。 - 矿工本身从不以 root 运行。
- 本身以 root 运行的矿工(
--allow-root,HiveOS)在进程内做同样的事,从不调用它。
安装:
- 把它复制到
/usr/local/bin。 - 随后
fearminer-helper install打印针对你的用户和这个路径的 sudoers 行,以及把它接入fearminer.service的 systemd drop-in;它自己不写任何东西。 - 把这行放进
/etc/sudoers.d,并加载msr模块。
用 status 检查:一行 JSON,不需要特权,给出这台机器允许什么。
msr模块及其allow_writes- kernel lockdown、Secure Boot、虚拟机管理程序
- 按尺寸和节点的空闲及总大页数
auto会选择的预设
查找顺序:
/usr/local/bin/fearminer-helper- sudoers 行所指的路径
- 压缩包留在二进制文件旁边、没有任何 sudoers 规则覆盖的副本
其中一个被 sudo 拒绝时接着试下一个。
--helper PATH 取代两者,成为唯一尝试的路径。
当 sudo 拒绝它、或那里没有程序时,E601 会说明并同时给出两个路径。
$ sudo install -m 0755 fearminer-helper /usr/local/bin/fearminer-helper $ fearminer-helper install $ echo 'USER ALL=(root) NOPASSWD: /usr/local/bin/fearminer-helper' | sudo tee /etc/sudoers.d/fearminer-helper $ sudo chmod 0440 /etc/sudoers.d/fearminer-helper $ sudo modprobe msr && echo msr | sudo tee /etc/modules-load.d/msr.conf $ sudo -n /usr/local/bin/fearminer-helper status
原始 MSR 值:/run/fearminer-helper/msr.json,由 root 拥有,直到 msr restore 或下次开机。
一次运行预留的页在它停止时归还,绝不低于别的进程正在使用的数量(归还不成为 E615)。
监督进程在挖矿进程每次结束后恢复,无论正常停止还是崩溃。
在 systemd 下,drop-in 添加 ExecStopPost=fearminer-helper msr restore 和 ExecStopPost=fearminer-helper hugepages release,作为监督进程死亡时的兜底。
矿工调用的命令:
msr apply --preset auto|zen1|...|intel|LIST | --dry-run 打印将要写入的内容 |
|---|---|
msr restore | 把保存的值写回。没有已保存值时什么都不做,任何人运行都退出 0 |
hugepages reserve --bytes N [--1g] | 扩大页池 |
hugepages release | 每个矿工各报自己的名字,因此一次 release 只释放本次运行的页 |
退出:
0 | 完成 |
|---|---|
1 | 其 JSON 行指明的失败 |
2 | 被拒绝的参数(不存在的预设、超出机器内存的预留),在检查权限之前判定 |
3 | 需要 root 而自己不是 root |
尚未完成:RandomX v2(rx/2,Monero 的下一次分叉),以及每个 NUMA 节点一份数据集副本(目前所有节点共用一份;启动行会说明线程分布在多少个节点上)。
Pearl
Pearl #
- 加噪的 int8 矩阵乘法,其 8 x 8 分块逐一哈希并与份额目标比较;获胜分块的 Merkle 证明就是份额。
- 支持 sm_86、sm_89 和 sm_120(RTX 30、40 和 50 系列),需 4.7 GB 空闲显存;其他显卡会被排除并说明原因(显存为
E310)。只需要 NVIDIA 驱动。不支持 macOS。 - 没有 CPU 引擎:
-t会被拒绝(E202)。 - 算力单位为 T(每秒 10^12 次乘加),即矿池记账的单位;API 给出 MAC/s,HiveOS 为 TH/s,能效为 GMAC/W。
- 每个证明先由引擎内的链验证器验证,发送前再由矿工验证一次(第 10 节)。
- 矿池必须支持 Pearl 的
"type": "v2"stratum,由你选择:fearminer -o stratum+ssl://POOL:PORT -u prl1... -w rig1。 - 费率 1 %,为上限:在已签名条款指定 Pearl 端点之前不收取任何费用,启动时会说明。
Quantus
Quantus #
- NVIDIA 需要 550 系列或更新的驱动,RTX 50 需要 570;预检给出已安装的版本。
- 没有原生引擎的显卡在 Vulkan 上运行,算力约为三分之一。
- 有 GPU 的矿机上 CPU 引擎关闭,
-t N开启;没有 GPU 的矿机上它开启,占用除两个以外的所有线程。 - 首次启动会在你的显卡上调优内核并缓存结果;
--retune重新测量。
RandomX
RandomX #
- tevador 的 RandomX 库 v1.2.3,编译进它的引擎。
- 一次性分配:数据集 2080 MiB,缓存 256 MiB,scratchpad 每线程 2 MiB。放不下数据集的机器只用缓存挖矿,慢许多倍,启动时会说明。
- 数据集在每次新的 seed hash 时重建,每 2048 个区块,约三天一次:所有核心同时工作几秒钟。
- 线程受 L3 缓存限制为每线程 2 MiB,同核心的超线程不增加任何东西。
- 大页值 20 到 30 %,某些机器上可达 50 %;MSR 调整在 Intel 上可达 30 %,在 Zen 上 6 %。两者见下文。
- 矿池使用 CryptoNote stratum:任何 XMRig 能连接的矿池。
TensorCash
TensorCash #
- 推理证明:已注册模型 Qwen3-8B 的推理窗口在显卡上运行,一个份额就是一份 166 到 200 KB 的证明。速率单位是 PoI/s(每秒推理证明数),不能与算力比较。
- 仅 NVIDIA,需 11.1 GB 空闲显存;不够的显卡(例如已加载了别的模型)会以
E310被排除。没有 CPU 引擎。 - 矿池是 WebSocket 代理:
-o wss://host/v1/ws -u tc1q....rig1 -p token-file=<路径>。矿池会话由引擎持有,引擎从该文件(权限 600)读取矿池令牌;矿工从不读取也从不显示它。目前只使用第一个矿池。 - 从驾驶舱下发的 TensorCash 方案需要矿机运行 FearMiner 1.7.1 或更新版本;令牌仍留在矿机上,如上所述。
- 引擎自己的设置(后端、以 SHA-256 固定的模型权重、令牌发往的主机)放在
TSC_POOL_CONFIG指定的文件里。 - 没有离线基准测试:
--benchmark会说明并以代码 3 结束,-a all会跳过它并说明原因。它的速率在矿池上测量。 - 份额被拒绝,或矿池拒绝登录,会结束会话(
E114):矿工保持运行但不挖矿,直到你重启它。 - 费用:2 %,由引擎自己在同一个矿池上挖到 FearMiner 自己的
tc1q...账户,不按一分钟一轮。
详细说明与行为
-o可以重复,或给出一次并用逗号分隔 URL;FEARMINER_URL=A,B效果相同。- 顺序即优先级:第一个矿池为主,其余为备用。
- 钱包、密码和 TLS 固定值(
--tls-fingerprint、--tls-spki)要么所有矿池共用一个,要么按同样顺序每矿池一个。 - 其他数量都是
E203。 - 每个连接,包括探测和费用轮次,都经过同一个拨号器:下面的代理、解析器和地址族策略。
$ fearminer -o stratum+ssl://pool.example.com:3335 -o stratum+tcp://backup.example.com:3333 -u YOUR_WALLET.rig1 $ FEARMINER_URL=stratum+ssl://pool.example.com:3335,stratum+tcp://backup.example.com:3333 fearminer -u YOUR_WALLET.rig1 $ fearminer -o A -o B -u WALLET_A -u WALLET_B --tls-fingerprint SHA256,-
故障切换 #
- 网络错误按退避重试同一矿池,最多 --pool-retries 次(3),然后移到下一个矿池。网络错误指:连接、TLS、读、写、超时,或连接在其他方面正常但 --job-timeout 秒内没有新任务。退避带抖动:基数每失败一次从 1 秒翻倍到 60 秒,等待在基数以内随机抽取。只记录一次,附原因和下次尝试的时刻。挖了一分钟的会话重新开始计数。
- 以下情况矿池立即让位给下一个:登录被拒(E104);回复的不是登录应答;证书不是固定的或记住的那张(E103、E118)。
- 所有矿池都不可用时(E106),矿工轮流重试它们,每轮之间暂停最多 60 秒,每轮一行日志;它永不退出。
- 在备用矿池上挖矿时,主矿池每五分钟通过第二个连接探测一次(登录,然后关闭套接字)。一旦它应答(设置了 --max-latency 时须在限制以内),矿工在备用矿池的下一次任务切换时回到它,并记录 pool: back on primary。
- 费用矿池不在列表中:它在自己的一分钟轮次期间使用自己的连接。
- 应答但很慢的矿池也可以离开。设置 --max-latency 后,当提交到回复的中位时间(最近二十次)持续两分钟超过限制时,其他矿池在各自连接上被测量。应答快于当前中位数的最快者接管会话,数字写在那一行(E129)。没有更快的矿池时什么都不变。默认关闭。
- 每个矿池在 /api/v1/pools 上保有自己的记录:接受、拒绝、过期和未应答的份额、按类别的拒绝、最佳份额、在线时间、重连次数、平均回复时间和当前回复中位数,从进程启动起跨重连累计。
会话在哪个矿池上:
| 终端面板 | 标题栏 |
|---|---|
| 纯文本日志 | connected to <URL> (<addr>, backup 2/3) |
/api/v1/summary | pool |
/api/v1/pools | 完整列表,带排名和当前活动项 |
/stats | pool、pool_index、pool_is_primary、pool_switches |
警报 pool_disconnected、pool_failover 和 pool_recovered 跟随同样的切换。
--job-timeout
--job-timeout #
--job-timeout 秒没有新任务后,工作线程停止。矿工按连接丢失的同样规则重连(E105)。
不设置时取链自己的数值:
quantus | 120 秒 |
|---|---|
randomx | 300 秒(矿池最多每分钟发一个任务) |
pearl | 180 秒 |
日志行会说明用的是哪个;0 关闭这项保护。
TLS:公共根证书、固定值,或首次使用即信任
TLS:公共根证书、固定值,或首次使用即信任 #
stratum+ssl:// 即 TLS 1.2 或 1.3(优先 1.3),以主机名作为 SNI。--tls 给裸的 host:port 加上它。
协商出的协议和密码套件每次连接打印一次。
| 公共根证书 | 默认方式:证书按内置在二进制文件中的 Mozilla 根存储检查,因此不需要系统证书库 |
|---|---|
--tls-fingerprint | 固定 DER 的 SHA-256,即 openssl x509 -fingerprint -sha256 打印的形式。续期会使其失效 |
--tls-spki sha256/BASE64 | 以 HPKP 的记法固定公钥。保留密钥的续期不受影响,并在同一矿池上优先于 --tls-fingerprint |
根证书未签名的证书(节点、P2Pool、私有矿池)必须固定。
握手失败永远不会回退到明文 TCP。
两种固定值:所有矿池一个值,或按矿池顺序每矿池一个,没有的用 -。
不匹配(E103)时以同样记法打印固定值和矿池出示的值。
$ fearminer -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 --tls-fingerprint 3a3524b6...c8307 $ openssl s_client -connect pool.example.com:3335 </dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout $ fearminer -o stratum+ssl://node.lan:3335 -u YOUR_WALLET.rig1 --tls-spki sha256/BASE64 $ openssl s_client -connect node.lan:3335 </dev/null 2>/dev/null | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64 $ fearminer -o stratum+ssl://node.lan:3335 -u YOUR_WALLET.rig1 --tls-tofu TLS: first contact with node.lan:3335: certificate 3a3524b6...c8307 remembered $ fearminer -o stratum+ssl://node.lan:3335 -u YOUR_WALLET.rig1 --tls-tofu --tls-tofu-reset node.lan:3335 $ fearminer -o stratum+ssl://10.0.0.2:3335 -u YOUR_WALLET.rig1 --tls-insecure TLS: 10.0.0.2:3335 TLS 1.3 TLS13_AES_256_GCM_SHA384, certificate not verified (--tls-insecure), SHA-256 3a3524b6...c8307
--tls-tofu 首次使用即信任证书。
- 第一次握手打印矿池证书的指纹,并保存到状态目录中的
tls-pins.json,以host:port为键。 - 之后用另一张证书握手会被拒绝并给出
E118,打印两个指纹,矿池让位给下一个。 - 要接受新证书:用
--tls-tofu-reset host:port启动一次(可重复),或从文件中删除该条目。 - 带有自己的
--tls-fingerprint或--tls-spki的矿池按其固定值检查,而不是按文件。 - 存在却无法读取的
tls-pins.json是E119:矿工不会启动。
--tls-insecure 不做任何检查:接受矿池出示的任何证书,不检查证书链、名称和有效期。
- 用于 TLS 端口转发或代理:此时所连接的名称不是矿池的名称,根证书会拒绝一条本可工作的路径。这种拒绝的
E102行会在固定值之外提到它。 - 会话仍然加密,但路径上的任何人都可以冒充矿池并拿走矿机的工作:每次启动都会说明(
E120),TLS 行会打印所出示证书的 SHA-256,可直接用于--tls-fingerprint。已知证书时,固定值更安全。 - 带自己固定值的矿池保留固定值。与
--tls-tofu同用时拒绝,没有剩下未固定的stratum+ssl://矿池时也拒绝。 - 费用轮次与矿池走同样的路。条款、引擎、遥测和驾驶舱中继始终按公共根证书检查。
- 需要重启。驾驶舱的挖矿方案可以为其矿池设置它,改变它的方案会重启矿工。
连接的 TLS 行给出依据。
pin verified | 固定值 |
|---|---|
certificate as remembered | 首次使用即信任 |
certificate not verified | 不检查,--tls-insecure |
代理与 DNS
代理与 DNS #
--proxy socks5://[user:pass@]host:port 把每个矿池连接经 SOCKS5 代理转发:
- 挖矿会话
- 对主矿池的探测
- 费用轮次
| 主机名 | 作为名称交给代理(socks5h 语义;socks5h:// 含义相同),因此没有任何关于矿池的 DNS 查询离开本机 |
|---|---|
| Tor | 经 Tor(socks5://127.0.0.1:9050)的 .onion 矿池和其他矿池一样可用 |
| 凭据 | 代理要求时发送用户名和密码;其中的 @ 和 : 需百分号编码 |
| 超时 | 经代理的连接获得两倍的连接超时,每段各一次 |
E115 | 代理不可用、拒绝凭据或无法到达矿池,附代理自己的文字回复 |
只要设了代理就永远不会直接尝试矿池。
URL 中的密码在日志和 --dry-run 中被掩盖,但会出现在进程列表里:请把它设在配置文件或环境变量中。
经过代理的有:矿池连接、引擎下载、驾驶舱中继连接和遥测。以下都通过 HTTPS 直接到达各自的主机,并向这些端点显示矿机自己的地址:
- 签名费用条款的获取(
cfg.fearminer.com) - 通知
--heartbeat-url的心跳
必须只经代理出网的矿机,把代理留给矿池即可:条款获取则无害地失败(E111:矿工用最近验证过的条款或内置条款挖矿)。
$ fearminer -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 --proxy socks5://127.0.0.1:9050 network proxy socks5://127.0.0.1:9050 (the proxy resolves) · ip any dns pool.example.com: resolved by the proxy socks5://127.0.0.1:9050, no local lookup $ fearminer -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 --dns doh --doh-url https://1.1.1.1/dns-query network dns doh (https://1.1.1.1/dns-query) · ip any dns pool.example.com → 203.0.113.10 (doh https://1.1.1.1/dns-query) $ fearminer -o stratum+ssl://pool.example.com:3335 -u YOUR_WALLET.rig1 --ipv4-only
--dns doh | 通过 DNS over HTTPS(RFC 8484,A 和 AAAA,应答按解析器的 TTL 缓存)解析矿池名称。端点不应答时回退到系统解析器(E116,每次故障一次);端点说名称不存在时不回退(E117) |
|---|---|
--dns doh-strict | 从不回退:没有应答即 E116,矿池像任何不可达矿池一样重试 |
--doh-url | 端点,默认 https://cloudflare-dns.com/dns-query。本地 DNS 出问题时,用 IP 指定解析器(https://1.1.1.1/dns-query、https://9.9.9.9/dns-query) |
DoH 对本地解析器隐藏名称,但不对网络隐藏矿池。
TLS SNI 和矿池地址在线路上仍然可见;隐藏这些的是代理。
用 --proxy 时由代理解析。
--ip 4|6|any 选择地址族。
--ip 4 | 仅 IPv4;--ipv4-only 与之等同 |
|---|---|
--ip 6 | 仅 IPv6;--ipv6-only 与之等同 |
--ip any | 默认值:同时解析到两种地址的矿池按 Happy Eyeballs 方式连接(RFC 8305),IPv6 优先,250 毫秒后或 IPv6 一失败就开始 IPv4。先连上的胜出,另一个被丢弃 |
URL 接受带方括号的 IPv6 字面量(stratum+tcp://[2001:db8::1]:3333)。
首次连接前,预检的 network 和 dns 行给出矿池将如何到达、每个名称解析到什么。
它们还给出由谁应答:系统解析器、DoH 解析器,或不做本地查询的代理。
每个矿池套接字都带 TCP keepalive(空闲 60 秒,每 10 秒探测一次,共三次),没有发 FIN 就消失的对端约一分钟内会被发现。
矿池行为异常时
矿池行为异常时 #
矿池还可能停滞、卡顿或撒谎;每种情况都有一条规则、一行带代码的日志,以及矿池记录(/api/v1/pools)上的一个计数器。
- 无回复的份额:一次提交等待判定 --submit-timeout 秒(10);超过后算作未应答,不计入,只说一次(E125),计入 shares.unanswered。对份额的任何回复,无论准时还是迟到,都重新开始计数(对 keepalive 的回复不算)。连续 --max-no-submit-responses 次(10)结束会话(E113):立即重连,下一个会话同样如此时让位给下一个矿池。
- 拒绝:每个被拒绝的份额是一行,带矿池的原话及其类别。类别:low difficulty、stale、duplicate、unknown job、unauthorized、other,矿池发送 Stratum v1 代码时按代码,否则按措辞。它们是矿池记录的 rejected_by_reason 计数器;最后一次拒绝的类别随 shares_rejected_high 和 gpu_unstable 事件一起给出。
- 没有任务:套接字正常但 --job-timeout 秒内没有新任务则结束会话(E105),先停止工作线程;不设置时取链自己的数值,启动时的 pool 行给出生效的是哪个。
- 同一任务再来一次:id 和工作在本连接上都已见过的任务被忽略,只记一行 debug(jobs_duplicate)。以任何 id 携带旧任务工作的任务是重放:忽略,每会话说一次(E128),计数(jobs_replayed);工作线程留在当前任务上。按内容判断,从不只看 id。
- 任务搜尽:矿机在一个任务上做的哈希数已达到该任务的 nonce 数。RandomX 上为 2^32,其 nonce 为四字节;Quantus 任务提供的比任何矿机能搜索的都多。搜索停止(E127,每任务一次,nonce_space_exhausted),工作线程等待下一个任务,而不是再次哈希同样的 nonce。
- 消息:client.show_message 以文本形式显示一次,标注矿池;转义序列和控制字符被去掉,文本截断在 200 字符,其中的内容永不被解释。相同的文本不再显示。
- 重定向:client.reconnect(host、port、wait)只在主机在矿池列表中时才跟随,端口不限,等待它要求的时间,最多 60 秒。重定向到别处会以一行 E126 点名主机并拒绝;会话在原处继续。重定向到列表中另一个矿池则是转到那个矿池:会话用那个矿池的钱包、密码和固定值登录,并计为一次矿池切换。
- 回复慢:--max-latency,见上文(E129)。
$ fearminer -o A -o B -u YOUR_WALLET.rig1 --submit-timeout 15 --max-latency 300 E125 share unanswered: share 42 on job j7 from GPU0 not answered within 15 s (3 unanswered in a row) E129 pool latency over the limit: pool: moving to stratum+ssl://B (backup 2/2): answers in 48 ms, stratum+ssl://A in 310 ms [ REJECTED ] 3/10 · GPU0 · 4.00M · stale · "Stale share" · 40 ms
钱包与它的矿池
钱包与它的矿池 #
钱包总要和它的矿池一起给出:-o(或 FEARMINER_URL,或文件中的 url、[[pools]])与 -u、WALLET、FEARMINER_USER 或 user 并列。矿池由你选择;矿工从不替你挑。
E224 | 没有矿池的钱包:在触动任何东西之前就被拒绝,启动时如此,--check-config 和 --dry-run 下也一样,退出码 2 |
|---|
未给 -a 时,链来自地址:询问此版本的每个算法该地址是否能按其链解码,不做任何猜测。
E215 | 两条链都接受同一地址,两条都点名,由 -a 决定 |
|---|---|
E214 | 此矿工无法运行的链 |
E401 | 没有任何链接受 |
每种情况都在任何连接之前被拒绝,以 2 退出,启动时与 --check-config 下相同。
没有钱包也没有矿池时,矿工不为任何人挖矿。
预检运行,终端面板显示显卡及其遥测,/stats 报告 mode monitoring,直到 Ctrl+C。
详细说明与行为
-d 选择 GPU:
- 按
--list-devices打印的索引(PCI 顺序,同nvidia-smi) - 按 PCI id
- 按 UUID
- 按厂商
- 按排除
各项作为集合合并。
NVIDIA 上精确选中这些显卡;Vulkan 和 Metal 取前 N 张,只接受 -d 0..N-1。
纯 CPU 算法(RandomX)拒绝 -d。
cpu 不是显卡,CPU 线程由 -t 指定。
--list-devices 只打印列表,别的什么都不打印。
$ fearminer --list-devices
2 GPU(s), engine cuda
#0 NVIDIA GeForce RTX 4070 Ti [pci:0000:01:00.0] GPU-3f2a1b4c-5d6e-7f80-9a1b-2c3d4e5f6a7b
#1 NVIDIA GeForce RTX 3090 [pci:0000:41:00.0] GPU-11111111-2222-3333-4444-555555555555
pick with -d by index (-d 0,2), by PCI id (-d pci:0000:41:00.0, -d pci:41), by UUID (-d GPU-...) or by vendor (-d nvidia); leave one out with -d '!1'| -d | 选择 |
|---|---|
-d 0,2 | 只用 GPU 0 和 2,按索引。 |
-d pci:0000:41:00.0 | 同一张显卡,按 --list-devices 打印的 PCI id;驱动重排后依然稳定。 |
-d 41:00.0 · -d pci:41 · -d bus:65 | PCI id 的简写:不带域、只写十六进制总线号,或十进制总线号。 |
-d GPU-3f2a1b4c-5d6e-7f80-9a1b-2c3d4e5f6a7b | 按 UUID,由显卡本身导出:它跟随显卡进入另一个插槽或另一台矿机。完整照打印的写(uuid: 可选,不分大小写);前缀不是显卡,不做猜测。 |
-d nvidia · -d 3,nvidia | 按厂商:所有 NVIDIA 显卡,或显卡 3 然后其余。此构建只列出 NVIDIA;amd 和 intel 什么也选不到并会说明。 |
-d '!1' · -d '!pci:41:00.0' · -d '!GPU-3f2a...' | 除这张之外的所有显卡,可用上面任何形式。使用列表和排除列表不能混用(E206)。在 shell 里给 ! 加引号。 |
-d '!0' -t 2 | 排除所有显卡,两个 CPU 线程:不算错误。显卡显示为 Excluded,CPU 线程挖矿。改用 -t 0 则是 E301,以 3 退出;监控模式下是一条警告,no GPU telemetry。 |
-d 5 | 超出驱动所列显卡的索引(这里是单卡矿机),或另一台矿机上显卡的 UUID:E206,退出码 2,在任何引擎启动之前,消息附带列表。--check-config 和 --dry-run 报告相同;--device-missing first 保留启动。 |
-d 0,1,2 --temp-limit 85,80,_ | 按 -d 顺序每卡一个值:显卡 0 为 85,显卡 1 为 80,显卡 2 为默认。每个逐卡选项都用这个语法。 |
-d 0,1,2 --device-missing first | 同一条命令行用在显卡更少的矿机上:-d 中不存在的项记入日志而不被拒绝,逐卡列表从第一个位置起落在找到的显卡上(last:从最后一个倒着)。 |
--igpu | 也包括集成 GPU,即使旁边有独立显卡;默认排除。 |
-t 4 | GPU 之外再加四个 CPU 线程;有 GPU 的矿机上默认为 0。RandomX 上默认每个物理核心一个线程;-t N 覆盖。 |
--list-devices --json | 机器可读的列表,一个 JSON 文档:显卡及其显存、compute capability、驱动、厂商和引擎,以及 CPU 和 RAM。 |
没有超频选项(见下)时,矿工不向显卡的频率、功耗上限或风扇曲线写入任何东西;它只读取驱动。
--no-oc 会在日志中说明。
下面的崩溃计数会告诉你超频什么时候过头了。
每卡一个值
每卡一个值 #
每个逐卡选项(--temp-limit、--temp-resume)共用一套语法。
- 单个值覆盖所有显卡。
- 逗号分隔的值每卡一个,按挖矿显卡的顺序:有使用列表时为
-d顺序,否则为列表顺序;被排除的显卡保留其位置。 _保留该显卡的默认值。- 比显卡数短的列表让其余保持默认。
- 更长的是
E206并附数量。
--dry-run 打印列表如何落位(gpu: --temp-limit #0 85, #2 80)。
--temp-limit 的第一个位置是共用的核心限值。
不同的位置属于那张显卡,并以与共用一对相同的间距恢复:--temp-limit 90,80 --temp-resume 75 让显卡 1 在 80 暂停、65 恢复。
--device-missing
--device-missing #
-d 中指向本机没有的显卡的项(单卡矿机上的 -d 5、另一台矿机上显卡的 UUID):E206,退出码 2,在任何引擎启动之前;--check-config 说同样的话。
--device-missing first 或 last(FEARMINER_DEVICE_MISSING)保留配置,只挖所选中存在的显卡;日志说明期望哪些而未找到。
逐卡列表从第一个位置起(first)或从最后一个倒着(last)铺在找到的显卡上。
所选显卡一张都不存在时什么也选不到:日志说 no card of the selection is present,CPU 线程挖矿。
-t 0 时启动是 E301(退出码 3),--check-config 和 --dry-run 以同一行和同一码预告。
排除一张不存在的显卡在两种策略下都不排除任何东西。
--list-devices --json
--list-devices --json #
--list-devices --json 打印一个 JSON 文档:
- 按驱动顺序的显卡(
-d接受的索引),每张带其引擎(被排除的显卡或没有 GPU 引擎的算法上为null) - CPU
- RAM
事实来自 nvidia-smi、驱动文件和 sysfs,即连接前检查的读取源。
无从获得的事实为 null,绝不猜测。
{"gpus": [{"index": 0, "name": "NVIDIA GeForce RTX 4070 Ti", "pci_bus_id": "0000:01:00.0",
"uuid": "GPU-3f2a1b4c-5d6e-7f80-9a1b-2c3d4e5f6a7b", "vram_mb": {"total": 12282, "free": 11870},
"compute_capability": "8.9", "driver": "570.86", "vendor": "nvidia", "engine": "cuda"}],
"cpu": {"model": "AMD Ryzen 9 7950X 16-Core Processor", "physical_cores": 16, "threads": 32, "l3_mib": 64, "aes": true, "numa_nodes": 1},
"ram_mb": 64036}了解设备状态
设备状态 #
Mining | 正在搜索。该行显示速率、温度、风扇、功耗、acc/rej 和距上次份额的时间。 |
Paused (temp 91 °C) · Paused (mem 106 °C) | 被温控暂停,附带暂停它的传感器及其读数;矿机算力为零时纯文本日志的每分钟一行重复这一点。显卡完成当前搜索后空闲,直到每个暂停过它的传感器都降到其恢复点以下。看门狗不判定它。 |
Degraded (E316 ...) | 被看门狗怀疑,仍在挖矿:算力低(E313)、连续拒绝(E316)、份额饥荒(E315),原因在该行。条件解除后回到 Mining(E317),或在宽限期后重启。 |
Quarantined (E318 ...) | 因在 --restart-window 内把矿工拖垮 --device-quarantine 次而被排除出本次运行(E318):其 worker 空闲,其算力退出总计,其他显卡继续。矿工重启即结束;--reset-crashes 清除计数。绝不会是最后一个能挖矿的设备。 |
Lost | 驱动报告它已消失(E302)。显卡单独停止:其 worker 退出,其崩溃被计数,其他显卡继续;它随下次启动回来,而不是在进程内部。只有无物可挖时才以 10 退出。 |
Excluded · Excluded (E502) · Excluded (E506) | 被 -d ! 排除、被预检以其代码排除(E502 compute capability 低于 7.0,E310 空闲显存不足)或自检失败(E506)的显卡。其他显卡挖矿。 |
Monitoring | 没有钱包的运行:显卡被观测(遥测在该行和 /stats 上),不在其上启动 worker。 |
每次状态变动都带其代码记入日志,并在监督进程下追加到 watchdog.log。/stats 按卡携带 state,与 hs 对齐;/api/v1/devices 每个条目携带 state。
传感器 #
NVML 每秒读取 NVIDIA 显卡两次:
- 核心温度
- 风扇
- 板卡功率及其上限
- 频率
- 驱动的限频原因
以及显卡提供时的:
- 显存温度(大多数 3090 级别及以上的显卡;笔记本或小显卡什么也不说)
- 能耗计数器
- 易失的 ECC 计数器(ECC 开启时)
- PCIe 重放计数器
- 当前及最大 PCIe 链路(负载下 gen 1 x1:坏的转接板)
终端面板行显示显卡具有的温度(64°C · mem 78 · hot 81)。
/api/v1/devices 和 /stats 携带每个读数(temp_mem_c、temp_hotspot_c、energy_mj、throttle_reasons、ecc_corrected、ecc_uncorrected、pcie_replays、pcie_gen、pcie_width、pcie_max_gen、pcie_max_width),没有的为 null。
限频原因是稳定的标签:idle、app_clocks、power_cap、hw_slowdown、sync_boost、sw_thermal、hw_thermal、hw_power_brake、display_clock;没有时为 []。
热点(junction)传感器不在 NVML 中,所以 NVIDIA 上它缺失。
最近的 XID 错误不报告:NVML 没有 API,内核日志需要 root。
--no-nvml 不打开 NVML,用于 NVML 行为异常的驱动:所有读数缺失(/api/v1/devices 和 /stats 上为 null)。
gpu 启动行随后显示 sensors off (--no-nvml): no thermal cut-off 而不是阈值,挖矿继续。
Vulkan 和 Metal 不报告传感器。
温控
温控 #
每个传感器有自己的限值:
| 核心 | --temp-limit(90) |
|---|---|
| 显存 | --temp-limit-mem(105) |
| 热点 | --temp-limit-hotspot(100) |
0 关闭该传感器的温控。
传感器必须在限值或以上持续 --temp-hold 秒(15)显卡才暂停;降到限值以下则重新计数。
显卡完成其搜索后空闲,传感器和读数在该行(Paused (mem 106 °C))。
当每个暂停过它的传感器都降到其恢复点以下时恢复:核心到 --temp-resume(75),显存和热点到限值减 --temp-hysteresis(10)。
在暂停显卡期间停止应答的传感器继续保持暂停。
暂停时记一次(E306:传感器、读数、限值、恢复点),恢复时记一次。
temp_high 在暂停十秒后触发,temp_critical 在十分钟后或超过限值 10 °C 时触发。
--temp-limit 和 --temp-resume 每卡取一个值。
--temp-shutdown 是最后手段,默认关闭。
暂停中的显卡,其核心从该次暂停起算在此值或以上持续 --temp-hold 秒,会停止矿工:退出码 11,日志记 E319,temp_critical 事件。
在监督进程下矿工在退避后重启,若显卡仍那么热则在 --max-restarts 后放弃;该显卡被计为拖垮矿工的那张。
该值必须高于 --temp-limit:温控先暂停,停机针对暂停中仍在升温的显卡(风扇坏了,被邻卡烤热的显卡)。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --temp-limit 85 --temp-limit-mem 100 --temp-hold 20 --temp-shutdown 95 $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET -d 0,1,2 --temp-limit 85,80,_ --temp-resume 70,65,_
连接之前
连接之前 #
在参数之后、费用条款、统计端口和矿池之前运行。每项一行。
driver | NVIDIA 驱动、版本、libcuda 和 NVML 是否存在。有显卡却缺驱动:E307。比内核要求更旧:E308 |
|---|---|
gpu #N | compute capability 对内核下限 7.0,空闲显存对算法需求 |
ram | 系统内存 |
host | 物理机或虚拟机、kernel lockdown、Secure Boot,各自对算法的影响 |
cpu | 线程在什么旁边运行:显卡、no GPU,或 GPU not used by this algorithm |
超出驱动所列显卡的 -d 索引:E206,退出码 2,早于任何引擎启动。
没有任何可挖设备:E301,退出码 3,早于任何连接。即所有显卡被 -d 或检查排除,或根本没有显卡,且没有 CPU 线程(单卡矿机上的 -d '!0' -t 0)。同样的列表加 -t 2 则在 CPU 上挖矿,显卡显示为 Excluded。
--check-config 也运行这些设备检查。--skip-preflight 打印同样的报告但不采取行动。
事实来自驱动文件和 nvidia-smi(600 毫秒),从不来自引擎。检查远不到一秒。
崩溃计数
崩溃计数 #
因某张显卡退出的挖矿进程(挂起、看门狗裁定、温控停机)会指明是哪张;监督进程把它并入状态目录的 crashes.json。
按卡为键:驱动给出 UUID 时用 UUID,否则用 PCI id,绝不用索引;显卡换到另一个插槽仍保留记录,同一插槽的新显卡从零开始。
每条记录:
- 计数
- 最近时间
- 最近原因
- 最近几次崩溃的时间
矿工继续运行时丢失的显卡由子进程计数。
有一次之后终端面板行显示 crashes N。
/api/v1/devices 按卡携带 crashes,/api/v1/summary 携带 restarts,即监督进程本次运行的计数。
在 --restart-window 内被归咎 --device-quarantine 次重启(3)的显卡在下次启动时为 Quarantined。
--reset-crashes 清除该文件。
长时间稳定运行后崩溃意味着超频过头;第一次搜索就崩溃指向驱动、转接板或插槽。
调优
调优 #
首次启动时矿工在你的显卡上测量几种启动几何,把最优的缓存到 tuning.json(Linux 和 Windows 在 ~/.config/fearminer,macOS 在 ~/Library/Caches/fearminer)。
--retune 重新测量,例如更换驱动之后。
--gpu-batch 是每次启动 nonce 数的下限,向上取整到显卡调优几何的整数遍,生效的批大小见 CUDA device 启动行。
--throttle 在批之间暂停,用于必须保持安静的显卡。
默认值就是测量值。
超频
超频 #
不要求就不动:没有超频选项时,矿工不触碰频率、功耗上限和风扇寄存器。
在外部设置的超频(HiveOS flight sheet、Afterburner、nvidia-smi)继续有效。
--no-oc 把这一点说明白:所有超频选项和任何 [oc] 段都被忽略,启动日志会说明。
给出选项后,显卡通过 NVML 设置(NVIDIA;不需要 X server,即 nvidia-smi -lgc、-lmc 和 -pl 的调用),并在每次设置后回读。
日志、fearminer oc show 和 /api/v1/oc 给出回读值,而不是请求的值。
设置频率、功耗上限或风扇在 Linux 上需要 root,Windows 上需要管理员;矿工以普通用户运行。
用 --allow-root 以 root 运行(HiveOS 就是这样),或把超频留在外部。
没有特权时每次设置都是 E703 并附处理方法,挖矿以显卡当前频率继续。
本版本不控制 AMD 和 Intel。
六个取值选项:--cclock、--lock-cclock、--mclock、--lock-mclock、--pl、--fan。
每个都接受所有卡一个值,或按 -d 顺序每卡一个,用 --temp-limit 的列表语法(_ 不动那张卡)。
设置按安全顺序到达显卡:
- 功耗上限和风扇
- 然后显存
- 然后核心,由
--oc-delay延后,针对偏移落在冷卡上就崩溃的矿机
每次设置一行;每次拒绝一行,附代码和显卡自己的界限或档位(E701 到 E705)。
被拒绝的设置不影响其他设置。
每次更改开启一个步骤;十分钟后的小结给出该窗口的平均算力和自更改以来接受、拒绝、无效的份额。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --lock-cclock 1500 --mclock 800 --pl 220 $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET -d 0,1,2 --cclock 100,_,-50 --pl 80% --fan 70% --oc-delay 20 oc GPU0: applied pl 176 W, mem +800; reads core 1900 MHz (+0), mem 10251 MHz (+800), pl 176 W, fan 40 % OC step: GPU0 core +100, mem +800, pl 220 W -> hashrate over the next 10 min and rejects/invalids $ fearminer oc show $ fearminer oc reset $ fearminer oc reset --defaults -d 0
第一次设置之前,每张卡的回读值(偏移、功耗上限、风扇模式和转速、频率)写入状态目录的 oc-restore.json,以 UUID 为键:启动时的值,而非出厂值。
写不了则 E706,且什么都不应用。
恢复的时机:
- 在正常停止时
- 在挖矿进程崩溃或被杀死后由监督进程恢复(在重启之前)
- 在未经清理就被杀死的运行之后由
fearminer oc reset恢复
每行恢复日志都带原因(E708)。
驱动无法回读锁定,所以矿工设置的锁定重置为驱动默认值,同时也解除启动前在外部设置的锁定。
偏移、功耗上限和风扇回到各自的回读值。
fearminer oc show | 按卡打印其回读值、它公布的档位和范围,以及某次运行留下待恢复的内容 |
|---|---|
fearminer oc reset --defaults | 改为把选中的卡重置为驱动默认值 |
两者都接受 -d。
在文件中,每个选项是 [oc] 的一个键和一个 FEARMINER_<OPTION> 变量。
按算法的组放在 [oc.quantus]、[oc.randomx]... 中,启动时按所挖算法应用,覆盖 [oc],低于环境变量和命令行。
--dry-run 以 oc: 打印各组和最终策略。
[oc] pl = "80%" oc_delay = 20 [oc.quantus] lock_cclock = 1500 mclock = 800
POST /api/v1/oc,API 唯一的写操作:一组值立即应用到一张卡(不含延迟),回读并像选项一样记录以供恢复。
它无论来自哪里都需要令牌,本机也不例外。
--oc-script PATH 在挖矿开始前为每张卡运行一次你的程序,环境中带有该卡。
fearminer --self-test fearminer --benchmark --duration 30
预期输出为各设备的结果和 self-test passed,或失败代码。基准测试报告这台机器的实测速度。
详细说明与行为
本次运行使用的每个引擎都在第一个份额之前回答其已知答案向量。
显卡交回的每个解都在提交前于 CPU 上重新计算。
算错的显卡在启动时就被发现,而不是在一天的被拒份额之后。
开始算错的显卡在其第一个错误解上就被发现,矿池永远看不到它。
启动时
CPU 引擎对照链的参考实现:
| Quantus | qpow-math,节点验证印章所用的算术 |
|---|---|
| RandomX | 库自带的向量 |
每张显卡:256 个 nonce 在 CPU 上重新哈希,然后在真实目标下八次搜索,每个解都由 CPU 确认。
桌面显卡上不到一秒。
挖矿期间
每个 GPU 解在发出前于 CPU 上重新计算(约 6 µs)。错误的解被丢弃:日志记 E507,显卡行计 invalid,绝不会成为矿池的拒绝。--verify-shares off 关闭它。
裁定
答案不一致:E506,该显卡被排除出本次运行(Excluded (E506),该行没有算力),作为 gpu_unstable 告知;其他显卡继续挖矿。
失败的 CPU 引擎以同样方式丢弃。
无物可挖则退出码 3。
裁定保存在 selftest.json;同一二进制文件、驱动和显卡上的启动跳过测试。
运行什么 #
| Quantus,CPU 引擎 | 链的三个固定 (header, nonce, hash) 参考向量通过参考实现,然后从固定 nonce 起在难度 4096 下用引擎的 SIMD 内核搜索,它必须找到参考实现指定的 nonce;几毫秒 |
|---|---|
| Quantus,GPU 引擎 | 所有显卡同时:在接受任何哈希的目标下 256 次搜索(--self-test-nonces),每个答案用参考实现在 CPU 上重新哈希,nonce 高半部分检查完好;然后在难度 2^18 下八次搜索,每个解都由 CPU 确认,全部在五秒内应答 |
| RandomX | 库自带的三个向量在轻量 VM 上、在本机使用的 JIT 和 AES 路径上;每个密钥约一秒 |
CUDA 和 Metal 在内核 crate 内部于 CPU 上复核候选。
被拒绝的候选绝不到达主机,单独计数,并在裁定行上警告(E508:份额是安全的,内核丢掉了它们);显卡继续挖矿。
设备失败于到达主机的错误答案:
- 重新哈希后哈希不同的 nonce
- CPU 拒绝的解
- 没有答案
$ fearminer --self-test FearMiner 1.15.2 self-test, 256 nonce(s) per card, binary 3fa9c1d2e07b6a54 quantus cuda: GPU0 NVIDIA GeForce RTX 4070 Ti [0000:01:00.0]: pass: 256 nonces re-hashed on the CPU and 8 solutions at difficulty 262144 verified (412 ms) quantus cpu: CPU: pass: 3 reference vectors and one search agree with the chain's arithmetic (6 ms) verdict recorded in /home/user/.cache/fearminer/selftest.json self-test passed $ fearminer --self-test=all $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --self-test --self-test-nonces 1024
记录,以及何时跳过测试
记录,以及何时跳过测试 #
状态目录中的 selftest.json 每个引擎一条记录:
| 裁定 | 通过或失败 |
|---|---|
| 日期 | 测试运行的时间 |
| nonce 数 | 测试用了多少 nonce |
| 二进制文件 | 它的 SHA-256 |
| 驱动 | NVIDIA 驱动版本 |
| 显卡 | 按名称和 PCI id |
| 引擎配置 | 它的 SHA-256:到达引擎的每个环境变量,加上 --gpu-batch、--cpu-batch、--throttle、--devices、-t、--igpu |
| 拒绝计数 | 上面被拒绝的候选 |
当记录显示在下列条件下通过时,启动跳过该引擎的测试并说明(selftest cuda: passed on <date> ...; skipped):
- 同一二进制文件和同一引擎版本
- 同一驱动
- 同样顺序的同样显卡
- 同一引擎配置
- nonce 数不少于此
新的二进制文件、驱动更新、显卡增减或移动、参数改动、要求更多 nonce,或记录中有失败,都会重新运行。
挖矿运行中的 --self-test 强制在启动时执行。
单独运行、没有矿池和钱包时,--self-test 为 -a 的算法离线运行(--self-test=randomx 指定另一算法,--self-test=all 运行此构建的所有算法)。
它每个设备每个引擎打印一行,记录裁定,并以 0 退出,有设备失败则 3。
已验证份额
已验证份额 #
GPU 解在提交前用算法的参考实现在 CPU 上重新计算:在检查还在预算之内时每个都算,超出预算后十个算一个(见下)。
Quantus 是区块头和 64 字节 nonce 的 Poseidon2 哈希对目标比较,桌面核心上约 6 µs。
被拒绝的解绝不发出:丢弃,并以 E507 连同显卡和超频提示记入日志(第一次搜索:矿工或驱动;长时间稳定运行后:多半是超频)。
在哪里体现:
| 终端面板的显卡行 | 计为 invalid |
|---|---|
/api/v1/devices | shares.invalid |
/stats | shares_invalid,以及 ar 的第三和第四个元素 |
| 通知端 | gpu_invalid_share 连同该显卡的计数 |
计数是矿工自己的,不是矿池的。
CUDA 和 Metal 已在内核 crate 内部复核候选。
Vulkan 交回其内核的哈希,主机的检查是它唯一的检查。
CPU 的解不复核:找到它们的引擎就是参考实现。
只要检查在当前这一秒的成本低于一个核心的 1 %,每个解都检查,超出后十个检查一个。
这个预算是 10 ms,按每个解 6 µs 即每秒 1 600 个解,而矿池给一台矿机最多几秒一个。
--verify-shares off(FEARMINER_VERIFY_SHARES=off)关闭它:错误的解随后被提交并被矿池计为拒绝。
基准测试 #
--benchmark 在每个 worker 一次不计时的预热搜索之后测量 --duration 秒:算力,以及同一时间窗口内的平均功耗。
- 一个算法(
-a randomx)、一个列表(-a quantus,randomx)或全部(-a all):多个算法依次运行,默认各 60 秒,最后给出包含算力、功耗、能效和相比上次变化的汇总。 - 本机无法运行的算法(没有其引擎可驱动的显卡、缺少 CPU 功能)会被跳过并说明原因。TensorCash 也会被跳过:它没有离线基准测试,其引擎需要矿池。
- 功耗:显卡通过 NVIDIA 驱动读取,CPU 在 Linux 能耗计数器可读时读取(通常仅限 root);否则显示
power not measured,绝不猜测。 - 不应用 FearMiner 的超频选项:显卡以当前的频率和功耗上限运行,因此功耗可能与使用 FearMiner 超频设置挖矿时不同。
每项结果保存在状态目录 bench-<algo>.json:算力、功耗、时间窗口、线程和显卡、引擎、驱动、二进制文件的 SHA-256、日期。下次运行会把上次的结果与新结果并列显示。
在驾驶舱中:矿机面板、所选矿机或分组中的 Benchmark 会在矿机上执行同样的测试,测试期间矿机停止挖矿,结束后恢复原来的状态(按方案挖矿或暂停)。结果显示在矿机面板中,Rewards 排名会用它们计算矿机未在挖的币种,从而按你自己的硬件对币种排名。HiveOS 或 mmpOS 矿机会拒绝:它们的看门狗会重启算力下降的矿机。
不需要矿池和钱包。
$ fearminer --benchmark --duration 30 $ fearminer -a randomx --benchmark --duration 30 $ fearminer -a all --benchmark $ fearminer -a quantus,randomx --benchmark --duration 30 $ fearminer --benchmark --bench-seed 1 $ fearminer --benchmark --bench-seed 1 --bench-solutions 8
--bench-seed N 是确定性基准测试。
- 工作和每个 worker 的 nonce 序列都由种子导出。
- 当每个 worker 找到
--bench-solutions个解(4)时运行结束。 - 难度按算法和设备类别固定:每一两秒一个解。
- 每个 worker 从其第一次搜索计时到最后一个解;算力是它们之和。
- 每个解都在 CPU 上复核,被拒绝的在报告中指明。
- 运行上限为
--duration的六倍;触及上限的报告会说明其校验和不可比较。
打印的校验和是对排序后各解字节的 SHA-256 的前十六个十六进制位。
同一硬件、同样的种子、解数、线程和显卡:同样的 nonce,同样的校验和。
下次运行比较并说 checksum matches the last run on this rig 或 CHECKSUM MISMATCH,即算错的显卡、另一个二进制文件或另一个驱动。
校验和是 FearMiner 自己的,与其他矿工不可比。
CPU 上精确。
显卡上,一次启动包含两个解时报告其线程先到达的那个,几百次启动大约一次。
健康显卡上的不匹配很少见,反复出现则不是。
崩溃后挖矿进程会在 1、2、4 秒后重试,最多等待 60 秒。默认 30 分钟内重启 5 次会触发 --on-failure 并以 12 退出。配置及前提条件错误适用下方的单独规则。
进程与恢复规则
为挖矿启动时,fearminer 是一个监督进程加上它用相同参数重新执行的挖矿子进程。
监督进程不持有 GPU 上下文,驱动对子进程做什么它都能挺过去。
终端面板和纯文本日志都来自子进程,原样不变。
监督进程只打印自己的事件,前缀为 supervisor:,并追加到 watchdog.log。
停止
SIGTERM、SIGINT和Ctrl+C到达监督进程。- 它把停止转给子进程,等待
--stop-timeout(8 秒),然后杀死它。 - 子进程取消搜索、以有限等待停止工作线程、打印
miner stopped并以 0 退出。 - 第二次
Ctrl+C立即结束子进程。
即使有显卡冻结,停止也在十秒内完成。
重启
崩溃(信号、非零退出码、看门狗裁定)使子进程在 1 秒后重启,然后 2 秒、4 秒 ... 上限 60 秒。
十分钟健康运行重置退避。
| 退出码 2 | 配置:不重启,监督进程以该码退出 |
|---|---|
| 退出码 3 | 前提条件:不重启,监督进程以该码退出 |
| 退出码 4 | 另一实例:不重启,监督进程以该码退出 |
每次重启都带时间戳和原因记入日志,作为警报 watchdog_restart 发出,并计到它归咎的显卡上(crashes.json)。
--restart-window 内达到 --device-quarantine 次,该显卡就跳过下一次运行。
放弃
在 --restart-window 内重启 --max-restarts 次后(30 分钟内 5 次),监督进程放弃。
- 执行
--on-failure - 发送
rig_down - 以 12 退出
启动脚本在 12 时停下;systemd 单元或 HiveOS 此时可以重启整个程序,这是它们的重启唯一起作用的情况。
看门狗
看门狗 #
| 判定 | 默认 | 何时 |
|---|---|---|
E303 挂起--hang-timeout | 60 s | 一次搜索 --hang-timeout 秒未轮询其取消信号。挂起的内核无法从进程内部中断:子进程把显卡标为 Lost 并以 10 退出,监督进程重启它。 |
E304 零算力--zero-hashrate-timeout | 300 s | 在其他显卡挖矿时 --zero-hashrate-timeout 秒不返回任何哈希的显卡;单独一张显卡按自身判定。启动时、温控恢复后和重连后有五分钟宽限。退出码 11,重启。 |
E305 幽灵算力 | 预期份额间隔的 10 倍,10 到 60 分钟 | 以正常算力哈希却没有被接受的份额、而矿池接受其他设备份额的显卡。退出码 11,重启。当没有任何设备得到份额时嫌疑在矿池:说一次(E110),然后由下面的无份额规则接管。 |
E313 算力低--hashrate-min · --hashrate-grace · --hashrate-reference | 50 % · 300 s | 显卡十分钟平均低于其参考值的某个比例:本次会话的最佳十分钟平均,或 --hashrate-reference。绝对算力(300M)改用矿机的总和平均,含 CPU 线程,纯 CPU 矿机上也会触发。显卡转为 Degraded(E313,警报 hashrate_low),矿机被报告为低。--hashrate-grace 后仍低于:退出码 11。回到其上:再次 Mining(E317)。 |
E314 算力可疑--hashrate-max | 关闭 | 十分钟平均超过上限,无论显卡还是矿机:数字有误,不是显卡。每小时说一次(E314,警报 hashrate_suspect),绝不重启。 |
E315 份额饥荒--share-famine | 5 × | 算力正常却 N 个预期间隔(难度除以其算力,不少于 10 分钟)找不到份额的显卡;不需要矿池裁定,这一点不同于幽灵规则。显卡转为 Degraded(E315)且其搜索被重启:worker 完成其搜索,稍作空闲,带着新种子回到最新任务。一个份额即结束。重启后再来一整轮饥荒:退出码 11。 |
E316 单卡的拒绝--max-rejects-device | 5 | 一张显卡的份额被连续拒绝,过期的不计:Degraded(E316,多半是超频),直到矿池接受它的一个份额。 |
E114 会话的拒绝--max-rejects | 15 | 会话上来自任何设备的份额被连续拒绝:会话重连(E114);再次同样被拒则切换到下一个矿池。 |
E113 份额无回应--max-no-submit-responses | 10 | 连续多少次提交在 --submit-timeout 内未被应答后会话重连;第二次同样的情况则移到下一个矿池。0 关闭。 |
E110 没有被接受的份额--no-share-timeout | 1800 s | 自会话连接以来任何设备都没有被接受的份额:列表中的下一个矿池(列表只有一个时还是它,E110);在那里再出现一次这样的时段,退出码 11。 |
E318 隔离--device-quarantine | 3 | 崩溃计数在 --restart-window 内把 N 次重启归咎于一张显卡:下次启动时它为 Quarantined(E318,警报 gpu_quarantined),其 worker 空闲,其算力退出总计,其他显卡继续。绝不会是最后一个能挖矿的设备。矿工重启即结束,--reset-crashes 清除计数。 |
E302 设备丢失 | 始终 | 驱动报告显卡已消失:它单独停止(E302),其 worker 退出,其崩溃被计数,其他显卡继续;它随下次启动回来,而不是在进程内部。只有无物可挖时(没有显卡,没有 CPU 线程)才以 10 退出。 |
- 每个 GPU worker 一条记录,每秒判定两次,加上会话自身的裁定。
- 每个裁定都带其代码和原因记入日志并追加到
watchdog.log。 - 每条规则在 0 时各自关闭。
- 暂停或隔离中的显卡不被判定。
- 显卡的时钟(宽限期、份额窗口、十分钟平均)在温控恢复时和会话重连时重新开始。
- 会话级规则(
--max-rejects、--max-no-submit-responses、--no-share-timeout)对纯 CPU 矿机同样适用。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --hashrate-min 60% --hashrate-grace 600 --share-famine 8 --max-rejects-device 3 $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --hashrate-reference 600M,350M --hashrate-max 1.2G --device-quarantine 2
--on-failure
--on-failure #
exit(默认)或 script:<path>:脚本先运行,环境中有退出码、原因和重启次数,然后监督进程以 12 退出。可在那里给转接线断电重启,或呼叫某人。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --max-restarts 5 --restart-window 30 --on-failure script:/opt/fearminer/on-failure.sh # on-failure.sh: FEARMINER_EXIT_CODE, FEARMINER_CAUSE, FEARMINER_RESTARTS 在其环境中
--no-supervisor · --no-watchdog
--no-supervisor · --no-watchdog #
--no-supervisor | 运行旧式的单进程:用于 systemd、HiveOS 或其他自行重启矿工的看门狗,以及调试 |
|---|---|
--no-watchdog | 关闭所有裁定:不检查挂起、算力、份额和拒绝,不隔离。挂起的显卡就一直挂着,丢失的显卡无论如何都让其他显卡继续挖矿 |
--allow-multiple | 跳过该锁 |
基准测试、--list-devices、--self-test 和其他一次性运行总是单进程。
监督进程(或单进程)在状态目录的 fearminer.lock 上取一个建议锁。第二个实例以 4 退出(E210)。
持有者一死操作系统就释放锁,过期的锁不会阻碍下次启动。
watchdog.log
watchdog.log #
监督进程自己的日志,在状态目录(~/.cache/fearminer)中,上限 256 KB:每次重启带时间戳和原因,每次放弃。子进程的日志输出到控制台,带 --log-file 时也写入你指定的文件。
自动化
详细说明与行为
TOML 文件,每个选项一个键:除命令行和环境变量之外设置矿工的第三种方式。
config example 打印一份完整的文件。
--dry-run 显示它的效果以及矿工能否启动;--check-config 只给出判定。
最小配置:替换钱包和矿池,保存为 fearminer.toml,然后在挖矿前检查。
[pool] url = ["stratum+ssl://POOL:PORT"] user = ["YOUR_WALLET"] worker = "rig1"
$ fearminer config example > fearminer.toml $ fearminer --config fearminer.toml --dry-run $ fearminer --config fearminer.toml --check-config && fearminer --config fearminer.toml
键
键 #
每个键是选项下划线形式的长名称,位于顶层或以其 --help 标题命名的段中:[pool]、[network]、[devices]、[cpu]、[output]、[benchmark]、[supervisor]、[watchdog]、[notifications]、[oc]。
| 开关 | 取 true 或 false |
|---|---|
| 列表选项 | url、user、pass、tls_fingerprint、tls_spki:一个字符串或字符串数组 |
[oc] | 可以按算法各放一个表,[oc.quantus]、[oc.randomx]...,只包含该算法的超频值 |
矿池列表也可以每矿池一个表,[[pools]] 带 url、user、pass、tls_fingerprint 和 tls_spki。
在 [pool] 下给出一次的钱包服务于所有矿池,写在某条目内的属于该矿池。
字符串中的 ${VAR} 会被该环境变量替换;未设置的变量是错误。
[pool] user = "qzjd5MS1GSCpXLYp8DjZASifnkgtUpx5WwhmEzW3ppHdDe3uq" worker = "${HOSTNAME}" # url = ["stratum+ssl://pool.example.com:3335", "stratum+tcp://backup.example.com:3333"] [devices] temp_limit = 85 threads = 4 [output] log_file = "fearminer.log" [network] proxy = "socks5://127.0.0.1:9050" [oc] pl = "80%" [[pools]] url = "stratum+ssl://pool.example.com:3335" tls_fingerprint = "SHA256"
查找位置
查找位置 #
读取第一个存在的;--config "" 不读取任何文件。矿工从不写入它,它也远离状态目录。
| 1 | --config PATH · FEARMINER_CONFIG |
|---|---|
| 2 | fearminer.toml 在二进制文件旁 |
| 3 | ~/.config/fearminer/fearminer.toml · %APPDATA%\fearminer\fearminer.toml · ~/Library/Application Support/fearminer/fearminer.toml |
E211 | --config 指定但不存在的文件,语法错误也是;以 2 退出 |
|---|---|
E212 | 未知的键,并提示最接近的已知键(temp-limit: did you mean temp_limit?) |
E213 | 类型错误的值或未设置的 ${VAR} |
任何错误都不会让选项悄悄停留在默认值。
优先级 #
默认值 < 文件 < FEARMINER_* < 命令行
从低到高。列表由设置它的来源整体替换,从不合并:文件里的矿池加上命令行的 -o,结果只有命令行的矿池。
--dry-run | 打印结果:每个键一行,带值和来源(default、file <path>、env FEARMINER_X、cli),密码显示为 ***,然后是模式、算法、矿池、被排除的显卡,再是 --check-config 的判定 |
|---|---|
--check-config | 运行启动时的检查(选项、-d 与驱动列出的显卡的对比、矿池列表规则、钱包与其链),不联系任何主机,只打印判定 |
矿工能启动则退出 0,否则退出 2 并给出带代码的原因。
选项拒绝的值(--pool-retries 0)在两者和启动时都是一行 E202。
监督进程和它的挖矿子进程读取同一个文件:--dry-run 显示的就是实际挖矿的配置。
完整文件,与 fearminer config example 打印的一致
# FearMiner configuration file (TOML), as `fearminer config example` prints it.
#
# Every option of `fearminer --help` has a key here: the option's long name
# with underscores (--temp-limit is temp_limit), at the top level or under the
# section named after its --help heading, as below. The pool list can also be
# written one table per pool:
#
# [[pools]]
# url = "stratum+ssl://host:port"
# user = "WALLET.rig1" # optional: one wallet under [pool] serves all
# pass = "x"
# tls_fingerprint = "SHA256" # or tls_spki = "sha256/BASE64"
#
# Precedence, lowest first: the defaults, this file, the FEARMINER_* environment
# variables, the command line. A list (the pools, the per-pool values) is
# replaced as a whole by the source that sets it, never merged. ${VAR} in a
# string is replaced by that environment variable; one that is not set is an
# error, and so is a key that is not an option. The file is read from --config
# (FEARMINER_CONFIG), else fearminer.toml beside the binary, else the one in
# the configuration directory (~/.config/fearminer, %APPDATA%\fearminer,
# ~/Library/Application Support/fearminer). The miner never writes it.
#
# As printed, this file changes nothing: without a wallet and a pool the miner
# starts in monitoring mode. To mine, set both user (the wallet) and url (the
# pool you chose, stratum+ssl://POOL:PORT): a wallet without a pool is refused
# (E224), the miner never picks a pool for you.
[pool]
# Pool URL: stratum+tcp://host:port, stratum+ssl://host:port, or host:port
# (plain TCP unless --tls). The host is resolved on every connection. Repeat
# it (or separate the URLs with commas) for backup pools: the first is the
# primary, the others are tried in order when it fails, and the miner returns
# to the primary when it answers again
# (--url, FEARMINER_URL)
# url = []
# Wallet address, with an optional worker name as WALLET.WORKER. One value is
# used on every pool; one per pool (repeated, or comma separated, in the order
# of the pools) when a backup needs another
# (--user, FEARMINER_USER)
# user = []
# Worker name, appended to --user as WALLET.WORKER when it has none
# (--worker, FEARMINER_WORKER)
# worker = <NAME>
# Pool password. Pools ignore it; x by convention. One value for every pool,
# or one per pool like --user. A real password here is visible in the process
# list: put it in a file and use --pass-file
# (--pass, FEARMINER_PASS)
# pass = []
# Read the pool password(s) from this file instead of -p: one line for every
# pool, or one line per pool in the order of the pools. Wins over -p and
# FEARMINER_PASS when both are given. On Unix the miner warns when other users
# can read the file
# (--pass-file, FEARMINER_PASS_FILE)
# pass_file = <PATH>
# Send the wallet to the pool without checking that it is an address of the
# algorithm's chain (the banner then says UNCHECKED)
# (--ignore-wallet-check, FEARMINER_IGNORE_WALLET_CHECK)
ignore_wallet_check = false
# Use TLS on a bare host:port (a stratum+ssl:// URL implies it)
# (--tls, FEARMINER_TLS)
tls = false
# Pin the pool's TLS certificate by its SHA-256 fingerprint (64 hex digits),
# for a pool with a self-signed certificate. Without it the certificate is
# checked against the public roots. One value for every pool, or one per pool
# like --user (a dash, -, for a pool without one)
# (--tls-fingerprint, FEARMINER_TLS_FINGERPRINT)
# tls_fingerprint = []
# Pin the pool's TLS certificate by the SHA-256 of its public key (SPKI), as
# sha256/BASE64 (the HPKP notation); a pin that survives a certificate renewal
# that keeps the key. One value for every pool, or one per pool like --user (a
# dash, -, for a pool without one). Wins over --tls-fingerprint for the same
# pool
# (--tls-spki, FEARMINER_TLS_SPKI)
# tls_spki = []
# Connection attempts on a pool, on a network error, before the next pool of
# the list is tried. A pool that refuses the login is left for the next one at
# once. With every pool down the miner keeps trying them in turn, with a pause
# of up to 60 s between rounds, for ever
# (--pool-retries, FEARMINER_POOL_RETRIES)
pool_retries = 3
# Seconds without a new job from the pool, on a connection that is otherwise
# alive, before the session is treated as dead: the workers stop and the miner
# reconnects under the same rules as a lost connection. Without it, the
# algorithm's own figure, which the start says. 0 turns the guard off
# (--job-timeout, FEARMINER_JOB_TIMEOUT)
# job_timeout = <SECS>
# Seconds a submitted share waits for the pool's reply before it is counted as
# unanswered (E125); --max-no-submit-responses unanswered submits in a row
# reconnect the session
# (--submit-timeout, FEARMINER_SUBMIT_TIMEOUT)
submit_timeout = 10
# The most a pool may take to answer a submit, in milliseconds, as the median
# of the last twenty replies: over it for two minutes, the session moves to a
# pool of the list that answers faster, when one does (E129). 0 turns it off
# (--max-latency, FEARMINER_MAX_LATENCY)
max_latency = 0
# Algorithm to mine, or the coin's name (--list-algorithms for the names and
# aliases). Without it, the chain is read off the wallet; the engine index's
# default algorithm when no wallet is given
# (--algo, FEARMINER_ALGO)
# algo = <ALGO>
# List the algorithms the engine index lists (the cached or the release's
# copy), with their fee ceiling, and exit; with --json, one array of {name,
# coin, class, fee_bps, aliases, unit, hive, hive_units, default,
# requirements, options, refused}
# (--list-algorithms)
list_algorithms = false
# Hold an algorithm's engine at a version of the signed index, ALGO=VERSION
# (repeatable, or comma-separated): that version runs, from the cache or
# downloaded, and the hourly update leaves the algorithm alone
# (--engine, FEARMINER_ENGINE)
# engine = []
# An option of the algorithm's engine, NAME=VALUE (repeatable, or
# comma-separated): --list-algorithms says which an algorithm has and the
# values each takes. One the algorithm does not have, or a value it does not
# take, is refused
# (--engine-opt, FEARMINER_ENGINE_OPT)
# engine_opt = []
# The option an earlier miner had for one engine's precision: now --engine-opt
# precision=VALUE, which this still sets for an algorithm whose engine has it.
# Ignored by the others
# (--tsc-precision, FEARMINER_TSC_PRECISION)
# tsc_precision = <VALUE>
[network]
# Reach every pool through this SOCKS5 proxy (Tor: socks5://127.0.0.1:9050),
# with a username and a password as socks5://user:pass@host:port. The pool
# names are sent to the proxy, which resolves them: no DNS query leaves the
# machine for them, and a .onion pool works. A proxy that fails is a
# connection that failed; the pool is never contacted directly. socks5h:// is
# accepted and means the same
# (--proxy, FEARMINER_PROXY)
# proxy = <URL>
# How the pool names are resolved: system (the operating system's resolver),
# doh (DNS over HTTPS at --doh-url, the system resolver when the endpoint does
# not answer, never for a name it says does not exist) or doh-strict (DNS over
# HTTPS and nothing else). DoH hides the names from the local resolver, not
# the pool from the network: the TLS SNI stays visible. Moot with --proxy
# (--dns, FEARMINER_DNS)
dns = "system"
# The DNS-over-HTTPS resolver (RFC 8484) for --dns doh and doh-strict. Name it
# by its IP (https://1.1.1.1/dns-query) when the resolver's own name is what
# the local DNS cannot resolve
# (--doh-url, FEARMINER_DOH_URL)
doh_url = "https://cloudflare-dns.com/dns-query"
# The address families a pool is reached on: any (IPv6 first, IPv4 250 ms
# later, the first to connect wins), 4 or 6
# (--ip, FEARMINER_IP)
ip = "any"
# IPv4 only: the same as --ip 4
# (--ipv4-only)
ipv4_only = false
# IPv6 only: the same as --ip 6
# (--ipv6-only)
ipv6_only = false
# Trust a pool's TLS certificate on first use: remember its fingerprint at the
# first handshake (tls-pins.json in the state directory) and refuse any other
# certificate from that pool afterwards. For a node or a P2Pool on a
# self-signed certificate; a pool with --tls-fingerprint or --tls-spki is
# checked against its pin instead
# (--tls-tofu, FEARMINER_TLS_TOFU)
tls_tofu = false
# Accept whatever TLS certificate a stratum+ssl:// pool presents: no chain,
# name or expiry check. For a TLS port forward or a proxy, where the name
# dialled is not the pool's and the public roots refuse a path that works (a
# network that blocks plaintext stratum, say). The session stays encrypted,
# but anyone on the path can impersonate the pool, which every start says
# (E120). A pool with --tls-fingerprint or --tls-spki is still checked against
# its pin, and the fee sessions go the way the pools go. Refused with
# --tls-tofu, and with no stratum+ssl:// pool without a pin to apply it to
# (--tls-insecure, FEARMINER_TLS_INSECURE)
tls_insecure = false
# Forget the certificate remembered for this pool (host:port, as the E118 line
# prints it) before connecting, so the one it presents now is trusted and
# remembered instead. Repeat it for several pools
# (--tls-tofu-reset)
# tls_tofu_reset = []
# A relay of your own for the remote control, tried before the built-in one
# (wss://relay.fearminer.com): wss://HOST[:PORT], or ws:// for one on this
# machine or this network. Repeat it for several. Nothing is contacted until
# the rig is enrolled (fearminer enroll)
# (--remote-relay, FEARMINER_REMOTE_RELAY)
# remote_relay = []
# Minutes a new wallet from a cockpit's mining sheet waits before it applies,
# announced with both addresses; any cockpit or `fearminer remote cancel`
# drops it meanwhile. 0 applies at once
# (--remote-wallet-delay, FEARMINER_REMOTE_WALLET_DELAY)
remote_wallet_delay = 0
# No automatic update. A service the cockpit can update (Linux, systemd, with
# its updater) installs a newer release by itself, within two hours of seeing
# it; with this, only the cockpit's Update button or fearminer service update
# does. The cockpit can turn it back on or off for the rig
# (--no-auto-update, FEARMINER_NO_AUTO_UPDATE)
no_auto_update = false
# Join the fleet of this code at start (fm1_..., from the cockpit's Add a
# rig): the same as `fearminer enroll CODE`, for a service, a HiveOS flight
# sheet, an mmpOS miner profile or a provisioning script. Nothing happens once
# the rig is in that fleet
# (--enroll, FEARMINER_ENROLL)
# enroll = <CODE>
[devices]
# GPUs to mine on, comma separated (default: all): an index as --list-devices
# prints it (0), a PCI id (pci:0000:41:00.0, 41:00.0, or the bus alone as
# pci:41 in hex or bus:65 in decimal), a UUID as --list-devices prints it
# (GPU-3f2a..., whole), a vendor (nvidia, amd, intel: every card of it), or
# cards to leave out with a leading ! (!1, !pci:41:00.0, !GPU-3f2a...,
# !nvidia), or none for no GPU at all (the CPU threads alone; the only way to
# leave out the GPU of an Apple silicon Mac). A list of cards to use and a
# list to leave out do not mix; the CPU is chosen with -t, not here. On NVIDIA
# the exact cards are picked; the Vulkan and Metal engines take the first N
# cards and accept only -d 0..N-1
# (--devices, FEARMINER_DEVICES)
# devices = <LIST>
# What to do when -d names a card this machine does not have: match refuses
# the start (E206); first and last keep the configuration and mine on the
# cards present, the per-card lists (--temp-limit 85,80) laid over them from
# the first position on, or from the last back
# (--device-missing, FEARMINER_DEVICE_MISSING)
device_missing = "match"
# Pause a GPU whose core stays at or over this temperature, in degrees
# Celsius, for --temp-hold seconds, until it has cooled to --temp-resume; 0
# turns the core cut-off off. One value for every card, or one per card in -d
# order (85,80,_,90: _ keeps the default, a shorter list leaves the rest at
# it)
# (--temp-limit, FEARMINER_TEMP_LIMIT)
temp_limit = 90
# Core temperature a GPU paused by --temp-limit resumes mining at, in degrees
# Celsius; must be under --temp-limit. One value for every card, or one per
# card in -d order, as --temp-limit
# (--temp-resume, FEARMINER_TEMP_RESUME)
temp_resume = 75
# Pause a GPU whose memory sensor stays at or over this temperature for
# --temp-hold seconds, until it has cooled by --temp-hysteresis; 0 turns the
# memory cut-off off. Cards without the sensor are not judged on it
# (--temp-limit-mem, FEARMINER_TEMP_LIMIT_MEM)
temp_limit_mem = 105
# Pause a GPU whose hotspot sensor stays at or over this temperature for
# --temp-hold seconds, until it has cooled by --temp-hysteresis; 0 turns the
# hotspot cut-off off. Cards without the sensor are not judged on it
# (--temp-limit-hotspot, FEARMINER_TEMP_LIMIT_HOTSPOT)
temp_limit_hotspot = 100
# How far under its limit the memory or hotspot sensor must cool before the
# GPU resumes, in degrees Celsius. The core keeps its own pair, --temp-limit
# and --temp-resume
# (--temp-hysteresis, FEARMINER_TEMP_HYSTERESIS)
temp_hysteresis = 10
# How long a sensor must stay at or over its limit before the GPU is paused,
# in seconds; a shorter spike changes nothing. 0 pauses at the first reading
# (--temp-hold, FEARMINER_TEMP_HOLD)
temp_hold = 15
# Stop the miner (exit code 11) when a paused GPU's core stays at or over this
# temperature for --temp-hold seconds, counted from the pause: the last resort
# against a card that keeps heating while paused. 0, the default, turns it
# off; must be over --temp-limit
# (--temp-shutdown, FEARMINER_TEMP_SHUTDOWN)
temp_shutdown = 0
# Do not open NVML: no GPU sensors (temperatures, fan, power, clock, throttle,
# energy), the thermal cut-off has nothing to read and mining goes on. For a
# driver whose NVML misbehaves
# (--no-nvml, FEARMINER_NO_NVML)
no_nvml = false
# CPU mining threads: a count (8), a percentage of the automatic choice (50%,
# a hint rounded to a thread), a delta of it (-2, +2), or one per algorithm
# (ALGO:16,OTHER:32, with a bare value for the others). The automatic choice
# is 0 on a rig with a GPU (the CPU earns about 0.5% of the rate there for 17%
# of the power) and every thread but two on a machine without one; for an
# algorithm whose engine says what a thread needs of the cache, one thread per
# physical core, capped by the L3 cache. More than the machine can spare
# (every thread but two, and one per card) is capped to that, and the cpu line
# of the log says so
# (--threads, FEARMINER_THREADS)
# threads = <N|N%|-N|ALGO:N,...>
# Mine on integrated GPUs too, even beside a discrete one
# (--igpu, FEARMINER_IGPU)
igpu = false
# Do not act on the checks run before the first connection (driver version,
# compute capability, free GPU memory): the report is still printed, but no
# card is left out and nothing stops the start
# (--skip-preflight, FEARMINER_SKIP_PREFLIGHT)
skip_preflight = false
# Measure the GPU launch geometry again, ignoring the cached result
# (--retune, FEARMINER_RETUNE)
retune = false
# Run the known-answer test of the engines: on a mining run, always at start
# (it is otherwise skipped when the same binary, engine, driver and cards
# passed it before); alone, without a pool or a wallet, run it offline for the
# algorithm of -a (or for ALGO as --self-test=ALGO, or for every one with
# --self-test=all), print the verdict per device and exit 0, or 3 on a failure
# (--self-test, FEARMINER_SELF_TEST)
# self_test = <ALGO>
# Nonces the self-test searches on each card, every one re-hashed on the CPU
# (--self-test-nonces, FEARMINER_SELF_TEST_NONCES)
self_test_nonces = 256
# Re-check every GPU solution on the CPU before it is submitted (`on`, the
# default) or not (`off`): a wrong one is dropped and counted as invalid on
# the card's row instead of rejected by the pool. CPU solutions are not
# re-checked either way
# (--verify-shares, FEARMINER_VERIFY_SHARES)
verify_shares = "on"
# GPU batch size, in nonces per launch: a floor, rounded up to whole passes of
# the card's tuned geometry (the start line says the batch in force)
# (--gpu-batch, FEARMINER_GPU_BATCH)
gpu_batch = 1000000
# CPU batch size, in hashes between cancellation checks
# (--cpu-batch, FEARMINER_CPU_BATCH)
cpu_batch = 1000
# Pause between GPU batches, in milliseconds (0 = none)
# (--throttle, FEARMINER_THROTTLE)
throttle = 0
# List the GPUs this machine can mine on (index, name, PCI id, UUID) and exit;
# with --json, the machine-readable listing (the cards with their memory,
# compute capability, driver, vendor and engine, the CPU, the RAM)
# (--list-devices)
list_devices = false
# With --list-devices or --list-algorithms: print the listing as JSON. With
# --benchmark: print the machine-readable report on stdout (one JSON document,
# docs/benchmark-report.md), the progress on stderr
# (--json)
json = false
[cpu]
# Pin the CPU workers to these logical CPUs, in worker order, instead of the
# automatic placement (one per physical core, spread over the NUMA nodes): a
# hex mask (0xff, bit i for CPU i) or a list (0-7,16-23)
# (--cpu-affinity, FEARMINER_CPU_AFFINITY)
# cpu_affinity = <MASK|LIST>
# The CPU workers' priority, 0 (idle) to 5 (highest), the scale XMRig uses:
# nice 19, 5, 0, -5, -10, -15 on Linux, the thread priority class on Windows.
# Above 2 needs a privilege on Linux. Default: the process's own
# (--cpu-priority, FEARMINER_CPU_PRIORITY)
# cpu_priority = <0-5>
# For an algorithm whose engine asks for them: the MSR tweaks (the CPU's
# prefetchers, XMRig's public values), applied through fearminer-helper before
# the first connection and restored at exit. auto picks the preset from the
# CPU (zen1, zen2, zen3, zen4, zen5, intel) and skips with a coded line, never
# a refusal to start, when the helper is missing or the machine cannot take
# them (a VM, kernel lockdown, no msr module); off writes nothing; a preset
# name or a custom list addr:value:mask,... forces the values, on the
# registers the presets tune only (0x1a4, 0xc0011020 to 0xc0011022,
# 0xc001102b)
# (--msr, FEARMINER_MSR)
msr = "auto"
# For an algorithm whose engine asks for huge pages: reserve 1 GiB pages for
# its dataset (three per NUMA node) when the CPU has them (pdpe1gb), 1 to 3 %
# over 2 MiB pages. Off by default, as in XMRig. Used only where the kernel's
# default huge page size is 1 GiB (default_hugepagesz=1G on the kernel command
# line)
# (--1gb-pages, FEARMINER_1GB_PAGES)
huge_pages_1g = false
# The privileged helper (fearminer-helper), run as sudo -n PATH for the MSR
# tweaks and the huge-page reservation. Default: the installed
# /usr/local/bin/fearminer-helper (the path the sudoers line names), else the
# copy beside the miner's own binary. PATH given is the only path tried: the
# installed helper is not tried behind it, and E601 says so when sudo refuses
# PATH or nothing is there. Nothing usable at PATH is no refusal to start: a
# run that needs it says E601 and mines without the tweaks. Not used when the
# miner is itself root (--allow-root): it then does the same in-process
# (--helper, FEARMINER_HELPER)
# helper = <PATH>
[output]
# Address the stats endpoint listens on
# (--api-bind, FEARMINER_API_BIND)
api_bind = "127.0.0.1:4300"
# Do not serve the stats endpoint
# (--no-api, FEARMINER_NO_API)
no_api = false
# Plain scrolling log instead of the full-screen panel (what a pipe and a dumb
# terminal get anyway)
# (--no-tui, FEARMINER_NO_TUI)
no_tui = false
# No colour in the log, and the panel in the terminal's own colours (NO_COLOR
# in the environment does the same)
# (--no-color, FEARMINER_NO_COLOR)
no_color = false
# Debug-level log
# (--verbose, FEARMINER_VERBOSE)
verbose = false
# Also write the log to this file: one line per record, UTC timestamp, no
# colour, the pool password masked. Appended to, never truncated; rotated by
# size (--log-max-size, --log-keep). Written in both the panel and the plain
# mode
# (--log-file, FEARMINER_LOG_FILE)
# log_file = <PATH>
# Level of the log file, apart from the console's: trace, debug, info, warn or
# error. Default: debug with -v, info otherwise
# (--log-level-file, FEARMINER_LOG_LEVEL_FILE)
# log_level_file = <LEVEL>
# Size, in MB, at which the log file is rotated to <PATH>.1, .2, ...
# (--log-max-size, FEARMINER_LOG_MAX_SIZE)
log_max_size = 10
# Rotated log files kept (<PATH>.1 to <PATH>.N); 0 starts the file over
# (--log-keep, FEARMINER_LOG_KEEP)
log_keep = 5
# Send no telemetry at all: no install id is drawn or kept, and nothing goes
# to telemetry.fearminer.com (see Telemetry below). The signed fee terms are
# still fetched from cfg.fearminer.com
# (--no-telemetry, FEARMINER_NO_TELEMETRY)
no_telemetry = false
# Minutes between two telemetry beats, 5 to 1440: under 5 is raised to 5 and
# over a day lowered to a day, and the log says so
# (--telemetry-interval, FEARMINER_TELEMETRY_INTERVAL)
telemetry_interval = 15
[history]
# Keep this rig's own history in <state dir>/history.bin (`on`, the default)
# or not (`off`): one sample every 10 s for the last 24 h, then one a minute
# for a week, one every five minutes for a month and one an hour beyond, read
# by GET /api/v1/history and by fearminer history. Off writes nothing and
# keeps nothing
# (--history, FEARMINER_HISTORY)
history = "on"
# Days of history kept. Beyond a week the samples are five minutes apart,
# beyond a month an hour apart, so ninety days weigh a few megabytes
# (--history-retention, FEARMINER_HISTORY_RETENTION)
history_retention = 90
# Hard bound on the history file, in MB: the file is laid out to fit it from
# the first byte and never grows past it. The bound wins over
# --history-retention, which is cut back to fit
# (--history-max-size, FEARMINER_HISTORY_MAX_SIZE)
history_max_size = 32
[benchmark]
# Measure the hashrate and the power of this machine and exit; with -a all, or
# a list (-a ALGO,OTHER), every algorithm in turn, then a summary
# (--benchmark)
benchmark = false
# Benchmark length per algorithm, in seconds: 10 by default for one algorithm,
# 60 for several
# (--duration)
# duration = <SECS>
# Deterministic benchmark: the work and every worker's nonce sequence derive
# from this seed, the run ends after --bench-solutions solutions per worker
# instead of --duration, every solution is re-checked on the CPU, and a
# checksum of them is printed; two runs on the same hardware print the same
# checksum, a hardware error does not
# (--bench-seed)
# bench_seed = <N>
# Solutions per worker a seeded benchmark runs to
# (--bench-solutions)
bench_solutions = 4
# Untimed hashing after the engine is ready (its setup, its autotune and its
# first search done), before the clock starts: a card reaches its working
# temperature and clocks first. 0 by default: the clock starts as soon as
# every device is ready
# (--warmup)
warmup = 0
# Write the benchmark's machine-readable report (docs/benchmark-report.md,
# schema fearminer.benchmark/1) to FILE, written aside then renamed, on
# success and on failure alike
# (--report)
# report = <FILE>
[supervisor]
# Run the miner as one process, without the supervisor that restarts it after
# a crash: for systemd, HiveOS or another watchdog that restarts it itself,
# and for debugging
# (--no-supervisor, FEARMINER_NO_SUPERVISOR)
no_supervisor = false
# Seconds the supervisor waits for the mining process to stop after SIGTERM or
# Ctrl+C before killing it
# (--stop-timeout, FEARMINER_STOP_TIMEOUT)
stop_timeout = 8
# Restarts the supervisor allows within --restart-window before it gives up
# (exit code 12) and runs --on-failure
# (--max-restarts, FEARMINER_MAX_RESTARTS)
max_restarts = 5
# The window of --max-restarts, in minutes
# (--restart-window, FEARMINER_RESTART_WINDOW)
restart_window = 30
# What the supervisor does when it gives up: exit, or script:<path> to run
# that script first (FEARMINER_EXIT_CODE, FEARMINER_CAUSE and
# FEARMINER_RESTARTS in its environment), then exit
# (--on-failure, FEARMINER_ON_FAILURE)
on_failure = "exit"
# Run even when another fearminer is already running on this account (the
# single-instance lock is skipped)
# (--allow-multiple, FEARMINER_ALLOW_MULTIPLE)
allow_multiple = false
# Mine as root. Without it a miner started as root exits with code 3: it needs
# no privileges, and a bug or a hijacked configuration would have them all.
# HiveOS runs every miner as root and passes it
# (--allow-root, FEARMINER_ALLOW_ROOT)
allow_root = false
# Clear the crash counters kept per GPU across restarts, then start as usual;
# alone, without a pool, just clear them and exit
# (--reset-crashes)
reset_crashes = false
[watchdog]
# Turn the watchdog off: no hang, hashrate, share or reject check, no
# quarantine; a lost card leaves the others mining either way
# (--no-watchdog, FEARMINER_NO_WATCHDOG)
no_watchdog = false
# Seconds a search may run without a sign of life from the GPU before the card
# is declared hung and the miner exits for a restart (code 10)
# (--hang-timeout, FEARMINER_HANG_TIMEOUT)
hang_timeout = 60
# Seconds a GPU may report no hashes while the other cards mine before the
# miner exits for a restart (code 11); after a 5 min grace at start and after
# a thermal resume
# (--zero-hashrate-timeout, FEARMINER_ZERO_HASHRATE_TIMEOUT)
zero_hashrate_timeout = 300
# Seconds without any accepted share, from any device, after the session
# connected, before the miner moves to the next pool; a second such period on
# the next pool exits for a restart (code 11). 0 turns it off. A single card
# that earns nothing while the others do is judged on its own (ten times its
# expected time between shares, 10 to 60 minutes)
# (--no-share-timeout, FEARMINER_NO_SHARE_TIMEOUT)
no_share_timeout = 1800
# The least a GPU's ten-minute average may be: a share of its reference
# (`50%`, the best ten-minute average seen this session, or
# --hashrate-reference) or an absolute rate (`300M`, `1.2G`). Under it the
# card is Degraded; still under after --hashrate-grace, the miner exits for a
# restart (code 11). The rig's summed average is held to the same bound. 0
# turns it off
# (--hashrate-min, FEARMINER_HASHRATE_MIN)
hashrate_min = "50%"
# The most a GPU's ten-minute average can honestly be, in the same forms; over
# it the figure is wrong and is reported, never restarted. 0 turns it off
# (--hashrate-max, FEARMINER_HASHRATE_MAX)
hashrate_max = 0
# Seconds a GPU may stay under --hashrate-min before the miner exits for a
# restart; 0 never restarts it (Degraded and the alert only)
# (--hashrate-grace, FEARMINER_HASHRATE_GRACE)
hashrate_grace = 300
# The reference the percentages of --hashrate-min and --hashrate-max refer to,
# in H/s (`600M`): one value for every card, or one per card in engine order,
# comma separated. Learnt when not given: the best ten-minute average seen
# this session
# (--hashrate-reference, FEARMINER_HASHRATE_REFERENCE)
# hashrate_reference = <RATE[,RATE...]>
# How many expected share intervals (the difficulty over the card's rate) a
# GPU may go without finding a share, never under 10 minutes, before it is
# Degraded and its search restarted; a second famine exits for a restart (code
# 11). 0 turns it off
# (--share-famine, FEARMINER_SHARE_FAMINE)
share_famine = 5
# Shares of one GPU the pool may refuse in a row (stale ones aside) before the
# card is Degraded until it has a share accepted; also the solutions the CPU
# re-check may refuse within ten minutes. 0 turns it off
# (--max-rejects-device, FEARMINER_MAX_REJECTS_DEVICE)
max_rejects_device = 5
# Shares the pool may refuse in a row, from any device, before the session is
# reconnected; a second such run moves to the next pool. 0 turns it off
# (--max-rejects, FEARMINER_MAX_REJECTS)
max_rejects = 15
# Submits left unanswered by the pool for --submit-timeout, in a row, before
# the session is reconnected; a second such run moves to the next pool. 0
# turns it off
# (--max-no-submit-responses, FEARMINER_MAX_NO_SUBMIT_RESPONSES)
max_no_submit_responses = 10
# Restarts blamed on one GPU within --restart-window before it is Quarantined
# at the next start: left out of mining while the others carry on, until the
# miner is restarted. Never the last device that could mine. 0 turns it off
# (--device-quarantine, FEARMINER_DEVICE_QUARANTINE)
device_quarantine = 3
[notifications]
# Send the alerts to this URL as JSON (POST, format version 1, see the
# README); repeat it, or separate the URLs with commas, for several. Retried
# on a 5xx or a network error, never on a 4xx
# (--notify-url, FEARMINER_NOTIFY_URL)
# notify_url = []
# Send the alerts to a Telegram chat through a bot: the bot's token and the
# chat id, as BOT_TOKEN:CHAT_ID
# (--notify-telegram, FEARMINER_NOTIFY_TELEGRAM)
# notify_telegram = <BOT_TOKEN:CHAT_ID>
# Send the alerts to a Discord channel through its webhook URL
# (--notify-discord, FEARMINER_NOTIFY_DISCORD)
# notify_discord = <WEBHOOK_URL>
# Sign each --notify-url body with HMAC-SHA256 under this secret
# (X-FearMiner-Signature: sha256=<hex>), so the receiver can check it came
# from this miner
# (--notify-secret, FEARMINER_NOTIFY_SECRET)
# notify_secret = <SECRET>
# The least severity that is sent: info, warning, error or critical
# (--notify-min-severity, FEARMINER_NOTIFY_MIN_SEVERITY)
notify_min_severity = "warning"
# Send one test message (a rig_up) to every notifier and the heartbeat's
# /start, print what happened, and exit: 0 when every delivery went through, 1
# otherwise
# (--notify-test)
notify_test = false
# Ping this URL every 60 s (GET; POST with --heartbeat-post), plus <URL>/start
# at startup and <URL>/fail on a critical event, the healthchecks.io
# convention; an Uptime Kuma push URL works as is
# (--heartbeat-url, FEARMINER_HEARTBEAT_URL)
# heartbeat_url = <URL>
# POST the heartbeat with a small JSON body (hashrate, effective hashrate,
# shares, uptime, restarts) instead of a GET
# (--heartbeat-post, FEARMINER_HEARTBEAT_POST)
heartbeat_post = false
[oc]
# Core clock offset in MHz, signed (+100, -50), applied through the driver
# (NVIDIA, driver 520 or later). One value for every card, or one per card in
# -d order (100,_,-50: _ leaves that card alone). Without any OC option the
# miner touches no clock, power limit or fan register. Read back after it is
# set; refused with its code when the driver says no (E703: run as root with
# --allow-root)
# (--cclock, FEARMINER_CCLOCK)
# cclock = <MHZ[,MHZ...]>
# Lock the core clock at this many MHz (what nvidia-smi -lgc does); 0 removes
# the lock. One value for every card, or one per card in -d order. The driver
# cannot read a lock back, so at exit the lock is reset to the driver's
# default
# (--lock-cclock, FEARMINER_LOCK_CCLOCK)
# lock_cclock = <MHZ[,MHZ...]>
# Memory clock offset in MHz, signed (+800, -500). One value for every card,
# or one per card in -d order
# (--mclock, FEARMINER_MCLOCK)
# mclock = <MHZ[,MHZ...]>
# Lock the memory clock at this many MHz (nvidia-smi -lmc), which must be one
# of the steps the card publishes (405, 810, 5001, 10251...; E701 lists them
# otherwise); 0 removes the lock. One value for every card, or one per card in
# -d order
# (--lock-mclock, FEARMINER_LOCK_MCLOCK)
# lock_mclock = <MHZ[,MHZ...]>
# Power limit, in watts (220) or as a percentage of the card's default limit
# (80%), inside the range the card publishes (E702 shows the minimum and the
# maximum otherwise). One value for every card, or one per card in -d order
# (--pl, FEARMINER_PL)
# pl = <W|N%[,...]>
# Fan speed in percent (70%), or auto to give the fan back to the driver's
# curve. One value for every card, or one per card in -d order. A card without
# fan control (a laptop) refuses it (E704)
# (--fan, FEARMINER_FAN)
# fan = <N%|auto[,...]>
# Seconds to wait, after a card has started mining (its first accepted share,
# or 30 s at most), before its core offset and lock are applied: for the rigs
# that crash when the offset lands on a cold card. 0 applies them at start
# with the rest
# (--oc-delay, FEARMINER_OC_DELAY)
oc_delay = 0
# Ignore every OC option and any [oc] section of the file: the miner touches
# no clock, power limit or fan register, and says so at start. For a rig whose
# OC is set outside (HiveOS, Afterburner, a script)
# (--no-oc, FEARMINER_NO_OC)
no_oc = false
# Put every selected card at the driver's defaults (locks removed, offsets at
# 0, the default power limit, the fan on its curve) before the OC options are
# applied
# (--oc-reset-on-start, FEARMINER_OC_RESET_ON_START)
oc_reset_on_start = false
# Run this program once per card before mining starts, directly, never through
# a shell, with FEARMINER_DEVICE, FEARMINER_PCI_BUS, FEARMINER_UUID and
# FEARMINER_ALGO in its environment; 30 s at most, the exit code logged (E707
# when not 0)
# (--oc-script, FEARMINER_OC_SCRIPT)
# oc_script = <PATH>
# A set per algorithm, applied at start for the algorithm mined, over the [oc]
# values above and under the environment and the command line: one table per
# algorithm of the engine index ([oc.quantus], [oc.randomx], [oc.pearl],
# [oc.tensorcash], [oc.commonfoundry]), with any of the six value options
# (cclock, lock_cclock, mclock, lock_mclock, pl, fan), one value for every
# card or one per card in -d order, as under [oc]. --dry-run prints the sets
# and the policy they make.
#
# [oc.quantus]
# cclock = 100
# lock_mclock = "5001,_"
# pl = "80%"
[commands]
# Which commands a running miner takes beyond the reversible ones: read (the
# default: pause, resume, toggle and retune only), operate (restart and stop
# too), sensitive (the wallet, the pools and the overclocking too). A command
# over the level is refused with E217, a valid token or not
# (--unrestricted-api, FEARMINER_UNRESTRICTED_API)
unrestricted_api = "read"
# Run this program when EVENT happens, directly, never through a shell, with
# FEARMINER_EVENT and the event's context in its environment; 30 s at most,
# the exit code logged (E139 when not 0). Repeat it, or separate the hooks
# with commas, for several. The events: start, exit, crash, pause, resume,
# pool-switch, share-rejected-high, low-hashrate, temp-high, device-lost
# (--hook, FEARMINER_HOOK)
# hook = []
# Watch the configuration file and reload it when it changes. Off by default:
# SIGHUP and PUT /api/v1/config reload it either way. A value the new file
# gives that does not validate is refused whole (E220) and the configuration
# in force is kept
# (--watch-config, FEARMINER_WATCH_CONFIG)
watch_config = false
# Run without a console: the process detaches from the terminal and keeps
# mining after the shell that started it is gone. Implies --no-tui (there is
# no screen to draw on); give --log-file to keep the log
# (--background, FEARMINER_BACKGROUND)
background = false
# The whole process's scheduling priority, 0 (idle) to 5 (highest), on the
# same scale as --cpu-priority, which sets the worker threads' priority alone.
# Above 2 needs a privilege on Linux; refused by the OS, it is E613 and the
# miner keeps the normal priority
# (--priority, FEARMINER_PRIORITY)
# priority = <N>详细说明与行为
发到 Telegram 聊天、Discord 频道、你自己的 webhook,或三者同时。
--notify-test | 向每个目标和心跳的 /start 各发一条 rig_up,按目标打印结果,全部送达则以 0 退出 |
|---|---|
| 每条消息 | 都点名矿机:worker 名,否则为主机名 |
| 事件 | 是向有界队列的非阻塞推送 |
| 投递 | 10 秒超时,5xx 或网络错误时在 5、30 和 120 秒后重试,4xx 时从不重试 |
机器人令牌、webhook 令牌和密钥永远不会出现在日志中。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --notify-telegram BOT_TOKEN:CHAT_ID --notify-test $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --notify-discord https://discord.com/api/webhooks/... $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --notify-url https://example.com/hook --notify-secret SECRET --notify-min-severity error $ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --heartbeat-url https://hc-ping.com/UUID
事件
事件 #
| 事件 | 级别 | 何时 |
|---|---|---|
rig_up | info | 矿工已启动并在挖矿。 |
rig_down | critical | 正常停止,或监督进程放弃。 |
gpu_down | error | 驱动报告已消失的显卡(Lost)。 |
gpu_unstable | warning | 非过期拒绝达到五个的显卡、自检失败的显卡,或对它的看门狗裁定。 |
gpu_invalid_share | error | 显卡交回了 CPU 复核在提交前拒绝的解;注释中的 invalid 是该显卡迄今的计数。 |
gpu_degraded | warning | 被看门狗保持 Degraded 的显卡:连续拒绝、份额饥荒(原因在消息中)。 |
gpu_quarantined | error | 被看门狗排除出挖矿的显卡:重启过于频繁。 |
hashrate_low | warning | 算力低于本次会话最佳十分钟平均的 70 %;带设备时,该显卡的十分钟平均低于 --hashrate-min。 |
hashrate_recovered | info | 回到其 90 %;带设备时,显卡回到其下限以上。 |
hashrate_suspect | warning | 超过 --hashrate-max 的数字:数字有误,不是显卡。 |
temp_high | warning | 被温控暂停的显卡。 |
temp_critical | critical | 暂停超过 10 分钟、读数超过限值 10 °C,或显卡超过 --temp-shutdown,后者会停止矿工。 |
shares_rejected_high | warning | 50 个及以上份额中超过 5 % 被拒绝。 |
pool_disconnected | warning | 与矿池的连接丢失或被拒绝。 |
pool_failover | warning | 会话切换到备用矿池。 |
pool_recovered | info | 回到主矿池,或已重连。 |
wallet_changed | critical | 正在挖的钱包不是该矿池上一次会话的钱包。 |
watchdog_restart | error | 监督进程重启了挖矿进程(原因在消息中)。 |
devfee_start · devfee_stop | info | 一轮费用开始、结束。 |
block_found | info | 预留:此版本对接的矿池都不会说明某个份额是否为区块。 |
update_available | info | 条款中带有更新的版本。 |
如何抑制噪音
如何抑制噪音 #
- --notify-min-severity(默认 warning)是门槛,低于它的不发送。
- 出现时为待定,持续满确认时长后触发:hashrate_low 120 秒,gpu_down 30 秒,temp_high 10 秒,pool_disconnected 60 秒;其余立即触发。三十秒内恢复的矿池根本不会被提起。
- 已触发的状况最多每四小时重复一次,消除时发一条消息解除:hashrate_low 由 hashrate_recovered 解除,pool_disconnected 和 pool_failover 由 pool_recovered 解除,temp_high 由恢复解除,gpu_down 由显卡重新挖矿解除。
- rig_down 覆盖 gpu_down,gpu_down 覆盖 hashrate_low,pool_disconnected 也覆盖它:被覆盖的警报不发送,其解除也不发送。
- 三十秒内要发的内容合为一组,每个聊天一条消息;严重事件不等待。日志以 alert firing: ... 和 alert resolved: ... 显示已发送的内容。/stats 统计 alerts_firing 和 notifications_sent。
Webhook
Webhook #
每条通知一次 POST:Content-Type application/json,User-Agent fearminer/<version>,X-FearMiner-Event 带事件名,带 --notify-secret 时另有 X-FearMiner-Signature,即用密钥对请求体做的 HMAC-SHA256。请求体,格式版本 1:
POST 你的 URL
Content-Type: application/json
User-Agent: fearminer/1.15.2
X-FearMiner-Event: gpu_down
X-FearMiner-Signature: sha256=<hex>
{
"version": 1,
"event": "gpu_down",
"severity": "error",
"status": "firing",
"rig": "rig1",
"ts": "2026-09-22T10:00:00.000Z",
"fingerprint": "gpu_down/rig1/0",
"labels": {"rig": "rig1", "device": "0", "pci": "0000:41:00.0", "device_name": "NVIDIA GeForce RTX 3090", "pool": "stratum+ssl://pool.example.com:3335"},
"annotations": {"cause": "..."},
"summary": "GPU0 lost (reported by the driver)",
"details": ""
}status | firing 或 resolved |
|---|---|
fingerprint | <event>/<rig>/<device 或 ->:在同一警报的两条消息中相同 |
labels | 只带适用的键,显卡的 device、pci 和 device_name,涉及矿池时的 pool |
annotations | 事件的数据(temp_c、cause、latest_version ...) |
Telegram 收到纯文本的 sendMessage(无 Markdown),Discord 收到同样文本的 content,每组一条消息。
心跳
心跳 #
--heartbeat-url | 每 60 秒 ping 一次(± 10 %),GET,或带 --heartbeat-post 时为带小型 JSON 体的 POST |
|---|---|
URL/start | 启动时,即 healthchecks.io 的约定 |
URL/fail | 严重事件时,同一约定 |
没有这两者的服务(带查询串的 Uptime Kuma push URL)用普通 URL 即可;其 /start 和 /fail 得到 404。
失败以 debug 级别记录,最多每十分钟一条警告。
ping:10 秒超时,从不阻塞挖矿。
在监督进程下,事件和心跳由挖矿进程发送;监督进程发送 watchdog_restart,放弃时发送 rig_down,使用相同设置。
GET https://hc-ping.com/UUID 每 60 秒
GET https://hc-ping.com/UUID/start 启动时
GET https://hc-ping.com/UUID/fail 严重事件时
POST {"rig","hashrate_hs","hashrate_effective_hs","shares_accepted","shares_rejected","uptime_secs","restarts","alerts_firing"} --heartbeat-post详细说明与行为
/stats 之外的带版本 API,默认于 127.0.0.1:4300:读取,外加三个写操作。
POST /api/v1/oc | 对显卡的设置 |
|---|---|
POST /api/v1/commands | 命令 |
PUT /api/v1/config | 配置重新加载 |
--api-bind 0.0.0.0:4300 | 向局域网开放 |
--no-api | 关闭 |
/api/v1 下的每个对象都带 api_version(1),即路径的版本。
服务器在获取条款之前和首次连接之前就已启动(在此之前为零和 null,mode 已设置),并在重连和费用轮次期间保持运行。
读取本机矿工的算力。响应片段示例:
curl -s http://127.0.0.1:4300/api/v1/summary | jq .hashrate
{ "local_hs": 618400000, "local_10m_hs": 611900000, "session_hs": 609800000, "effective_hs": 598200000, "effective_pct": 97.8 }单位在字段名中。
_hs | 每秒哈希数 |
|---|---|
_c | 摄氏度 |
_w | 瓦 |
_s | 秒 |
_pct | 百分比 |
429 并附 Retry-After | 每个对端在 /api/v1/* 和 /openapi.json 上超过每秒 20 次请求 |
405 并附 Allow | 路径不接受的方法 |
尚不能计算的数值为 null。
每一个写操作,POST /api/v1/oc、POST /api/v1/commands、PUT /api/v1/config,无论来自哪里都需要令牌,本机也不例外。
令牌文件只有矿工的用户能读。
令牌 #
| loopback 上的 TCP 对端 | 不需要令牌;这是默认绑定 |
|---|---|
| 来自其他机器 | 只有 --api-bind 0.0.0.0:4300 才可能:对 /api/v1/* 的每次请求都必须携带 Authorization: Bearer <token> |
| 三个写操作 | 无论来自哪里都需要它,本机也不例外 |
| 错误的令牌 | 401,无论来自哪里 |
/healthz、/readyz、/stats、/hive-stats、/mmpos | 从不要求它 |
令牌:32 个随机字节的 base64url,首次启动时生成到 <state dir>/api_token(权限 0600);启动日志说明它在哪里,不说明它是什么。
fearminer token show 打印它,fearminer token rotate 更换它;运行中的矿工沿用已加载的直到重启。
令牌从不放进 URL。
控制接口与示例
| 端点 | 令牌 | 返回内容 |
|---|---|---|
PUT /api/v1/config | 无论来自哪里 | 无论来自哪里都需要令牌。空请求体:从文件、环境和命令行重新读取。{"set": {"temp_limit": "85"}}:这些键置于所有来源之上,在之后每次重新加载时继续胜出,直到再次写入或写为 null,后者把该键交还给文件。应用任何内容之前先整体校验;未通过校验的配置为 422 并带 E220,任何东西都不改变。返回 {api_version, source, changed[], restart_required[], held[]}。400:键不是选项。422:键需要重启(E219)。409:运行中没有可重新加载的配置。 |
POST /api/v1/commands | 无论来自哪里 | 无论来自哪里都需要令牌:{"command": "pause", "devices": [0, 1]},devices 可选,省略即针对整台矿机。pause、resume、toggle 和 retune 默认即可使用;restart 和 stop 需要 --unrestricted-api operate,否则为 403 并带 E217。返回 {api_version, command, outcome, paused, paused_devices}。400:名称不是命令(E216)。404:本次运行未使用该显卡(E218)。此路径没有读取操作。 |
POST /api/v1/oc | 无论来自哪里 | 无论来自哪里都需要令牌,本机也不例外。请求体:{"device": 0, "core_offset_mhz": 100, "core_lock_mhz": 0, "mem_offset_mhz": 800, "mem_lock_mhz": 10251, "power_limit": "220", "fan": "70%"};除 device 外每个值都可选,power_limit 以瓦计或 "80%",fan 为百分比或 "auto",锁定值 0 即解锁。立即应用,回读,记录以便退出时恢复。应答 {api_version, card},card 为之后显卡的读数,被拒绝的值连同其代码放在 refused 中。400:请求体不是一组值。401:没有令牌。404:显卡不受超频控制。409:运行没有超频控制。 |
$ curl -s http://127.0.0.1:4300/api/v1/summary | jq .hashrate $ curl -s -H "Authorization: Bearer $(fearminer token show)" http://rig:4300/api/v1/devices $ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:4300/readyz $ fearminer token rotate $ curl -s -X POST -H "Authorization: Bearer $(fearminer token show)" -H 'Content-Type: application/json' -d '{"device": 0, "power_limit": "80%"}' http://127.0.0.1:4300/api/v1/oc $ curl -s -X POST -H "Authorization: Bearer $(fearminer token show)" -H 'Content-Type: application/json' -d '{"command": "pause"}' http://127.0.0.1:4300/api/v1/commands $ curl -s -X PUT -H "Authorization: Bearer $(fearminer token show)" http://127.0.0.1:4300/api/v1/config
HiveOS 下统计端口固定为 127.0.0.1:4300,h-stats.sh 从那里读取 /hive-stats。在可从不受信任网络访问的主机上,先用防火墙限制端口,再用 --api-bind 开放。
状态接口
| 端点 | 令牌 | 返回内容 |
|---|---|---|
GET /api/v1/summary | 来自其他机器时 | api_version、version、build、uptime_s、algo、mode、session_connected、pool {url, index, is_primary, switches}、hashrate {local_hs, local_10m_hs, session_hs, effective_hs, effective_pct}、shares {accepted, rejected, stale, invalid, best_difficulty}、fee {rate_pct, seconds_mined_for_fee, seconds_mined_for_user, shares_for_fee, shares_for_user}、efficiency_kh_per_w、restarts、alerts_firing、wallet_changed、time_to_first_share_s、engines[] {algo, role, version, platform, source}、os、service、update_ready、update、engine_index {origin, url, key_id}、bench。 |
GET /api/v1/devices | 来自其他机器时 | api_version 和 devices[],表中每行一项:index、kind、label、name、pci_bus_id、state、hashrate_hs、temp_c、fan_pct、power_w、power_limit_w、clock_mhz、throttle、shares {accepted, rejected, stale, invalid}、efficiency_kh_per_w、crashes;然后是显卡可能有的传感器,没有时为 null:temp_mem_c、temp_hotspot_c、energy_mj(驱动加载以来的毫焦计数器)、throttle_reasons(稳定标签,没有时为 [])、ecc_corrected、ecc_uncorrected(易失的,ECC 开启时)、pcie_replays、pcie_gen、pcie_width、pcie_max_gen、pcie_max_width。 |
GET /api/v1/pools | 来自其他机器时 | api_version、active_index,以及故障切换列表:每个矿池带 index、rank、is_primary、is_active 和它自启动以来跨重连的记录:shares {accepted, rejected, stale, unanswered, best_difficulty}(best_difficulty 是该矿池接受的最佳份额)、rejected_by_reason {low_difficulty, stale, duplicate, unknown_job, unauthorized, other}、uptime_s、reconnects、avg_reply_ms、latency_ms(最近二十次提交回复时间的滑动中位数,少于五次时为 null)、jobs_duplicate、jobs_replayed、nonce_space_exhausted。 |
GET /api/v1/history | 来自其他机器时 | 这台矿机自己的历史:?from=&to=&step=&metric=&device=。返回 {api_version, from_ms, to_ms, step_s, layer, device, clock {drift_ms, gaps, samples}, t_ms[], series[{metric, unit, aggregate, values[]}]}:各分桶起点在 t_ms 中给出一次,随后每个指标一个数组,没有采样处为 null。layer 是作答的分辨率(ten_second、minute、five_minute、hour),step_s 是分桶步长;更细的步长会被提升到该层的步长,而不是被拒绝。400:边界、步长、指标或设备不存在,或范围超过 20 000 个点(E202)。409:以 --history off 启动的运行(E223)。 |
GET /api/v1/config | 来自其他机器时 | api_version 和生效配置,绝无秘密:矿池的 pass 为 "***"、登录名在冒号处截断,设备选择,阈值,api_bind,以及公开的清单 reloadable[] 和 restart_required[](控制运行中的矿工)。 |
GET /api/v1/oc | 来自其他机器时 | api_version、enabled(没有超频选项或使用 --no-oc 时为 false)、backend、delay_s、cards[],每张受超频控制的卡一项:index、label、name、pci_bus_id、uuid、wanted(请求的值,未触碰处为 null)、readback(core_mhz、mem_mhz、core_offset_mhz、mem_offset_mhz、power_limit_w、fan_pct、fan_manual)、applied[]、pending[](被 --oc-delay 延后的)、refused[](setting、code、reason)、restore(运行触碰之前显卡的读数)。 |
GET /healthz | 从不 | 进程有响应时为 200 ok;无数据。用于存活探测。 |
GET /readyz | 从不 | 会话已连接且有设备在挖矿后为 200 {ready: true},之前为 503 {ready: false, reason}。用于就绪探测。 |
GET /openapi.json | 来自其他机器时 | 以上各项以及 /stats、/hive-stats 和 /mmpos 的 OpenAPI 3.0 文档。fearminer openapi 打印同样的内容;压缩包以 openapi.json 携带它。 |
GET /stats · GET /hive-stats | 从不 | HiveOS 自定义矿工对象:每卡 hs(kH/s,CPU 算法上每 CPU 行一个)、它们的总和 total_khs、temp、fan、uptime、ver、四元素的 ar([accepted, rejected, invalid, "invalid per row"])、algo、bus_numbers、各行的 state 和 crashes、计数器(hashes_total、accepted、rejected、shares_invalid、difficulty、best_difficulty、pool_rtt_ms、reconnects、wallet_changed、fee_percent、mode、time_to_first_share_s、hashrate_effective_hs、efficiency_kh_per_w、alerts_firing 等),以及带每卡份额(含 shares_invalid)、效率和传感器的 devices。 |
summary 示例 #
JSON 示例
{
"api_version": 1, "version": "1.15.2", "build": "a1b2c3d4e", "uptime_s": 3600, "algo": "quantus", "mode": "mining",
"session_connected": true,
"pool": {"url": "stratum+ssl://pool.example.com:3335", "index": 0, "is_primary": true, "switches": 0},
"hashrate": {"local_hs": 618400000, "local_10m_hs": 611900000, "session_hs": 609800000, "effective_hs": 598200000, "effective_pct": 97.8},
"shares": {"accepted": 412, "rejected": 3, "stale": 2, "invalid": 0, "best_difficulty": 91200000000},
"fee": {"rate_pct": 2.0, "seconds_mined_for_fee": 72, "seconds_mined_for_user": 3528, "shares_for_fee": 8, "shares_for_user": 404},
"efficiency_kh_per_w": 2150.4, "restarts": 0, "alerts_firing": 0, "wallet_changed": false, "time_to_first_share_s": 12.3
}字段定义
mode 为 mining 或 monitoring。时间窗内被接受份额不足十个时 effective_hs 和 effective_pct 为 null。没有功耗读数时 efficiency_kh_per_w 为 null。第一个份额被接受前 time_to_first_share_s 为 null。每个对象的完整 schema:/openapi.json。
一个设备,例如 #
JSON 示例
{
"api_version": 1,
"devices": [{
"index": 0, "kind": "gpu", "label": "GPU0", "name": "NVIDIA GeForce RTX 4070 Ti", "pci_bus_id": "0000:01:00.0", "state": "Mining",
"hashrate_hs": 618400000, "temp_c": 64, "temp_mem_c": 78, "temp_hotspot_c": null, "fan_pct": 62, "power_w": 271, "power_limit_w": 285, "clock_mhz": 2610,
"throttle": false, "throttle_reasons": ["power_cap"], "energy_mj": 9812044000, "ecc_corrected": null, "ecc_uncorrected": null,
"pcie_replays": 0, "pcie_gen": 4, "pcie_width": 16, "pcie_max_gen": 4, "pcie_max_width": 16,
"shares": {"accepted": 412, "rejected": 3, "stale": 2, "invalid": 0}, "efficiency_kh_per_w": 2281.9, "crashes": 0
}]
}字段定义
state | 选择与管理设备的状态之一 |
|---|---|
throttle_reasons | 显卡未限频时为 [] |
shares.invalid | 计数 CPU 复核在提交前拒绝的解,矿池从未见过它们(检查正确性并测量速度) |
crashes | 该显卡跨重启保存的计数 |
显卡或驱动不提供的传感器为 null;--no-nvml 时所有传感器都为 null。
详细说明与行为
命令和配置重新加载都作用于运行中的矿工,无需重启。四种入口:本机 API、终端面板、信号、状态目录中的文件。这里的一切都不离开本机。
默认可逆
pause、resume、toggle 和 retune 是矿工默认接受的仅有写操作。每一个都可逆,没有一个能动钱。
三个级别
默认:read。--unrestricted-api operate 增加会结束挖矿的 restart 和 stop;--unrestricted-api sensitive 增加钱包、矿池和超频。超出级别:以 E217 拒绝,无论令牌是否有效,并说明如何开启。
什么都不会被打断
暂停:每个工作线程先做完手上的搜索。重新加载:先整体校验配置,再应用其中任何一项。换池:会话在下一个半秒轮次干净地结束。整个过程中都是同一个进程在挖矿。
命令 #
| 命令 | 级别 | 作用 |
|---|---|---|
pause | read | 暂停整台矿机或指定的显卡:每个工作线程先做完手上的搜索,然后在最新任务上空转。不断开任何连接,不在批次中途打断。相应行显示 Paused (operator)。 |
resume | read | 继续挖矿。整机 resume 也会逐一释放被单独暂停的显卡。 |
toggle | read | 在挖矿时暂停,在暂停时继续:SIGUSR1 和终端面板的 p 发出的就是它。 |
retune | read | 在最新任务上、以新的种子重新开始整台矿机或指定显卡的搜索。启动几何在显卡上下文建立时测得,并缓存到进程结束:完整重测就是带 --retune 的重启。 |
restart | operate | 结束挖矿进程;监督进程会再次启动它。退出码 14,不计入 --max-restarts。需要 --unrestricted-api operate。 |
stop | operate | 彻底停止矿工。需要 --unrestricted-api operate。 |
sensitive 级别:钱包、矿池与登录相关的键、超频设置。除非矿工以 --unrestricted-api sensitive 启动,否则 PUT /api/v1/config 的 set 会以 E217 拒绝它们,无论出示了什么令牌。
级别只守护 API。
| 终端面板的按键 | 需要矿工绘制所在的终端 |
|---|---|
| 信号 | 需要向该进程发信号的权限 |
| 哨兵文件 | 需要对矿工自己的状态目录有写权限 |
<state dir>/stop 能停止一台完全没有开启任何放宽模式的矿工。
发送命令的四种方式
发送命令的四种方式 #
- POST /api/v1/commands,无论来自哪里都要带令牌,本机也不例外(使用本地 API)。
- 终端面板:p 暂停整台矿机并再次放行,1 到 9 各对应一张显卡(1 是 GPU0)。
- SIGUSR1 每发一次就切换一次整机暂停。发给服务管理器知道的那个 pid,也就是监督进程,由它转交给挖矿进程。
- 哨兵文件,不需要令牌,也不需要发信号的权限:<state dir>/stop、/pause 和 /resume。矿工在一秒内消费每个文件,也就是删除它。再次写入同一个文件就是再次发出同一条命令。无法删除的文件为 E137,不予执行。
$ curl -s -X POST -H "Authorization: Bearer $(fearminer token show)" -H 'Content-Type: application/json' -d '{"command": "pause", "devices": [0]}' http://127.0.0.1:4300/api/v1/commands $ kill -USR1 $(pgrep -o fearminer) $ touch ~/.cache/fearminer/pause command pause from file: the rig paused command stop from api refused: E217 command not allowed: stop needs --unrestricted-api operate
每条命令都连同它的来源(api、tui、signal、file)和结果一起写入日志,无论是否被拒绝。
热重载
热重载 #
SIGHUP、--watch-config 监视下的文件,以及 PUT /api/v1/config,做的是同一件事。
- 配置从文件,然后环境,然后命令行重新读取,命令行拥有最终发言权,与启动时一致。
- 应用任何内容之前先整体校验。
- 应用可重新加载的键。
- 打印改变了什么,钱包排在最前。
| 未通过校验的配置 | 整体被拒绝并报 E220,生效中的配置完整保留,挖矿不被打断 |
|---|---|
SIGHUP、--watch-config、不带请求体的 PUT /api/v1/config | 改变了且需要重启的键不算失败:其余照常应用,该键以 E219 被点名 |
PUT /api/v1/config 的 set | 更严格:点到这种键的 set 会以 E219 和 422 被拒绝,该请求中的任何内容都不会被应用 |
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --watch-config --log-file fearminer.log $ kill -HUP $(pgrep -o fearminer) $ curl -s -X PUT -H "Authorization: Bearer $(fearminer token show)" -H 'Content-Type: application/json' -d '{"set": {"temp_limit": "85"}}' http://127.0.0.1:4300/api/v1/config reload SIGHUP: 2 key(s) changed: temp_limit 90 -> 85 · url stratum+ssl://A -> stratum+ssl://B reload 1 key(s) held from the API, over the file: temp_limit (write one as null to hand it back) E219 the change needs a restart: algo (quantus -> randomx) is kept, the rest is applied
GET /api/v1/config 提供 reloadable[] 和 restart_required[];fearminer --help 打印它们。
| 可重新加载 | 矿池列表和每个矿池的全部取值、故障切换的各项时限、所有 --temp-* 阈值、所有看门狗阈值、通知目标和最低严重级别、heartbeat、日志级别、--history-retention、--history-max-size、超频设置,后者立即应用且不等 --oc-delay |
|---|---|
| 需要重启 | 算法、设备选择、线程数、API 绑定、引擎与 CPU 相关选项、网络选项、日志文件、--history 本身、监督进程自身的设置、命令相关的选项本身 |
两者合起来穷尽:配置文件接受的每个键恰好在其中之一。
- 改变矿池列表的重新加载在下一个半秒轮次干净地结束正在进行的会话。
- 没有东西在途中,也没有东西记在矿池账上。
- 下一个会话在新的主池上打开,仍是同一个进程。
- 用
set写入的键在之后每次重新加载时都继续压过文件。 - 每次重新加载都会在日志和
held[]中点名它正在保持的键。 - 把其中一个写为
null即可交还,这不需要任何级别。
钩子
钩子 #
--hook <EVENT>:<PATH>,可重复或用逗号分隔,在事件发生时运行一个本地程序。
- 程序直接运行,从不经过 shell。
- 它有 30 秒,超时即被杀死。
- 退出码写入日志,不为零时为
E139。 - 无论钩子返回什么,挖矿都照常进行。
| --hook | 何时触发 |
|---|---|
start | 矿工已开始挖矿。 |
exit | 挖矿进程正在正常结束。 |
crash | 挖矿进程已死,监督进程正在重新启动它。 |
pause · resume | 整机或某张卡被暂停或放行:命令、终端面板、信号、哨兵文件或温度保护。 |
pool-switch | 会话切换到列表中的另一个矿池,或切回主池。 |
share-rejected-high | 矿池拒绝的份额过多(E114、E316)。 |
low-hashrate | 超过宽限窗口后算力仍低于 --hashrate-min(E313)。 |
temp-high | 某张卡达到 --temp-limit 并被暂停(E306)。 |
device-lost | 驱动报告某张卡消失(E302)。 |
上下文通过环境传给程序,从不放在命令行上:FEARMINER_EVENT 始终存在,然后是该事件带有的字段。
FEARMINER_DEVICEFEARMINER_PCI_BUSFEARMINER_UUIDFEARMINER_ALGOFEARMINER_POOLFEARMINER_CODEFEARMINER_SUMMARY
事件不携带的字段是不存在,而不是为空,这样脚本才能分清没有显卡和 0 号显卡。
四个设备变量的拼写与 --oc-script 一致。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --hook temp-high:/opt/rig/hot.sh --hook device-lost:/opt/rig/lost.sh # hot.sh: FEARMINER_EVENT, FEARMINER_DEVICE, FEARMINER_PCI_BUS, FEARMINER_UUID, FEARMINER_ALGO, FEARMINER_POOL, FEARMINER_CODE, FEARMINER_SUMMARY E139 hook script failed: temp-high /opt/rig/hot.sh exited 1 after 0.4 s
--check-config只检查取值的形式。- 路径是在事件发生时才检查的,所以
--hook temp-high:/nonexistent能通过,并在矿机第一次过热时变成E139。 E221(错误的钩子)说的是取值本身,即<EVENT>:<PATH>,其中 event 必须确有其事。
--background · --priority
--background · --priority #
--background | 不带控制台。矿工以自己的参数重新启动自己,处于独立会话中,三个标准流都指向 /dev/null,打印新的 pid,返回 0 |
|---|---|
--priority 0 到 5 | 设置整个进程的调度优先级 |
--cpu-priority | 只移动工作线程 |
发出命令的 shell 得以释放;终端关闭也不会带走任何一个进程。
请同时给出 --log-file,否则日志无处可去,只能通过 API 了解矿机。
在 Linux 上高于 2 需要特权;被操作系统拒绝时:E613,矿工保持普通优先级。
详细说明与行为
每台矿机把自己的历史保存在自己的状态目录里:没有服务器,没有数据库,什么都不用搭。
它离线作答;仪表盘通过 API 读取同一份数据。
最近 24 小时保存在内存中,并每分钟写入 <state dir>/history.bin 一次:重启或 kill -9 都不会丢失。
在磁盘上,同样的采样会在每个窗口关闭时被汇总。
| 步长 | 保留 | 来自哪里 |
|---|---|---|
10 s | 24 h | 每 10 秒一个采样,约 8 600 个点,直接由内存作答,不读一个字节。 |
1 min | 7 d | 每分钟一个,在每分钟关闭时汇总。 |
5 min | 30 d | 每五分钟一个,覆盖一个月。 |
1 h | 90 d | 每小时一个,直到 --history-retention 天,默认 90。 |
所请求的步长决定由哪一层作答:最近一小时按 10 秒来自内存,上个月按小时来自粗粒度层。
--history-max-size | 默认 32 MB,硬上限;文件从第一个字节起就按它布局 |
|---|---|
--history off | 什么都不留、什么都不写 |
它优先于保留天数:显卡很多的矿机会少留几天,而不是把文件撑大。
一台八卡矿机的九十天:约 7 MB。
一个采样包含:
| 整机 | 本地算力和有效算力、接受、拒绝和无效的份额、整机功耗、时钟漂移、当前矿池、整机状态 |
|---|---|
| 每张卡 | 算力、温度、风扇、功耗和频率 |
合并时:
- 速率、温度和百分比取平均
- 份额计数相加
- 矿池和状态取最新的那一个
每个回答都在 aggregate 字段里按指标说明用的是哪一种。
fearminer history #
fearminer history 直接读取该文件:不需要任何矿工在运行,也不向网络索取任何东西。
$ fearminer history --from -24h --step 5m $ fearminer history --from 2026-09-15 --to 2026-09-16 --step 1h --metric temp_c --device 0 $ fearminer history --from -7d --step 1h --format json | jq .series[0] time_ms,time,hashrate_hs,hashrate_effective_hs,shares_accepted,temp_c_0 1789776000000,2026-09-19T00:00:00Z,611900000,598200000,37,64 1789776300000,2026-09-19T00:05:00Z,612400000,601100000,41,65
--from、--to | now、-24h、-7d、-90m、-3600s、以秒或毫秒计的 unix 时间戳、ISO 8601 的 UTC 时间戳(2026-09-20T10:00:00Z;只写日期表示零点)。默认:一天前和现在 |
|---|---|
--step | 10s、1m、5m、1h、1d、纯秒数。默认:能够回溯到 --from 的最细一层。更细的步长会被提升到该层的步长,而不是被拒绝,回答会说明实际使用的步长 |
--metric、--device | 缩小输出范围 |
--format csv | 默认:表头行,每个点一行,时间以 ISO 8601 与毫秒并列给出,没有采样处留空 |
--format json | API 提供的同一个对象 |
没有历史:E223,退出码 2。
GET /api/v1/history
GET /api/v1/history #
同一份数据也在 API 端口上提供,查询写在 URL 里:来自其他机器时需要令牌,与 /api/v1 下的各处一样。
$ curl -s 'http://127.0.0.1:4300/api/v1/history?from=-24h&step=5m&metric=hashrate_hs'
{"api_version": 1, "from_ms": 1789689600000, "to_ms": 1789776000000, "step_s": 300, "layer": "minute", "device": null,
"clock": {"drift_ms": 12, "gaps": 0, "samples": 288},
"t_ms": [1789689600000, 1789689900000, ...],
"series": [{"metric": "hashrate_hs", "unit": "H/s", "aggregate": "avg", "values": [611900000, 612400000, null, ...]}]}layer | 作答的那一档分辨率(ten_second、minute、five_minute、hour) |
|---|---|
step_s | 分桶的步长 |
| 400 | 边界、步长、指标或设备不存在,或范围超过 20 000 个点(E202) |
| 409 | 以 --history off 启动的运行(E223) |
没有采样的分桶是 null,而不是零。
每个采样都带着矿机的单调时钟和它的墙上时钟;两个采样之间的间隔取两者差值中较大的那个。
NTP 把时钟往回拨绝不会让间隔变成负数;挂起了两小时的机器会显示那段空白。
墙上时钟的漂移:clock.drift_ms,也是一个独立指标 clock_drift_ms。
history.bin
history.bin #
一个 64 字节的文件头,然后是每层一个固定大小的环。文件头包含:
FEARHIST,即魔数- 格式版本
- 采样模式版本
- 记录大小
- 字段数量
- 设备槽位数
- 每一层的容量和步长
- 一个 CRC-32
一条记录:两个时钟、跨度、f32 值、一个 CRC-32。
一分钟的记录按层各写一次,写在该层在文件中自己的位置上;别的什么都不动。
文件从不增长,也从不被重写:最旧的采样被覆盖掉,一次一个槽位。
| 被断电撕裂的记录 | CRC 校验失败:它不存在 |
|---|---|
| 被截短的文件 | 按它所含的内容读取 |
| 不是我们格式的文件 | 会被替换 |
| 写不进去的文件 | E222,只说一次,挖矿不受影响 |
这些都不会阻止矿工启动。
另一个版本或另一种语言写的读取程序,靠以下做法保持兼容:
- 检查魔数
- 从文件头读取字段数量和记录大小,而不是写死在代码里
- 取自己所知与文件所述之中较小的那个
- 并按记录大小跳过其余部分
字段只会追加,绝不重排、改名或删除。
理解与排查问题
first share accepted after 12.3 s hashrate 588.5 MH/s
示例输出。算力和已接受的份额表示挖矿已开始,矿池已接受你的工作。
终端面板读数与按键
终端面板是全屏面板:算力、迷你图、份额走带、每张显卡一行、日志。
l | 只看日志 |
|---|---|
q | 退出 |
p | 暂停整台矿机并再次放行 |
1 到 9 | 各对应一张显卡(控制运行中的矿工) |
--no-tui 把同样的记录打印为纯文本滚动日志,用于服务或挖矿系统。
--log-file 在任一模式下把它们保存到文件。
本地与有效
| 大数字 | 本地算力,即显卡计算出的 |
|---|---|
eff | 有效算力,即矿池承认的:最近一小时内被接受份额的难度除以该时间,以及它占同一小时本地平均值的百分比 |
两者的差别来自过期份额、延迟、时间窗内的运气和费用轮次。
一小时内被接受的份额不足十个时,eff 显示 -,面板则以暗色显示从第一个份额起的估计值及其误差:~118.2 T ±41 %。
每张显卡的份额
每行显示 acc/rej,即矿池对该显卡份额的裁定,过期的在括号里,以及 CPU 复核在提交前拒绝解之后的 invalid 计数(检查正确性并测量速度)。
- 过期是因任务已过而被拒的份额:延迟,不是显卡。
- 硬件故障表现为非过期的拒绝,或
invalid计数增长。 - 连续五个非过期拒绝让该卡保持
Degraded(E316);五个触发gpu_unstable。
kH/W
效率,标题栏中是整台矿机的,每行是单卡的:会话的哈希数除以驱动报告的板卡功耗焦耳数(NVIDIA 上为 NVML),每秒采样两次。
是板卡功耗而不是墙上功耗:电源损耗和机器其余部分不计入。
不报告功耗的引擎(Vulkan、CPU)显示 -。
第一分钟
第一分钟 #
连接之前,矿工打印算力去向和运行环境:纯文本日志(--no-tui)显示下面这些行,终端面板在标题栏和设备行中显示同样内容。
fearminer 1.15.2 (a1b2c3d4e, 2026-09-22) wallet qzjd5MS1GSCpXLYp8DjZASifnkgtUpx5WwhmEzW3ppHdDe3uq (checksum ok) worker rig1 pool stratum+ssl://pool.example.com:3335 (primary) pool stratum+tcp://backup.example.com:3333 (backup 2/2) custody pool (the pool pays the wallet) algo quantus fee 2.00% of the mining time to the fee pool build 1.15.2 (a1b2c3d4e, 2026-09-22) sha256 3a3524b62caa8307 egress stratum+ssl://pool.example.com:3335 · fee pool (one-minute rounds) · cfg.fearminer.com (terms, every 20 min) · telemetry.fearminer.com (telemetry every 15 min: event, install id, format, version, system, mining, hardware, hashrate bucket, features, uptime bucket, errors, pool host; fearminer telemetry show, fearminer.com/telemetry) · download.fearminer.com (engines, hourly) driver NVIDIA 570.86, libcuda.so.1 and libnvidia-ml.so.1 present gpu #0 NVIDIA GeForce RTX 4070 Ti [0000:01:00.0]: compute 8.9, 11470 MB free of 12282 ram 64.0 GB host bare metal, kernel lockdown none, Secure Boot off network dns system · ip any dns pool.example.com → 203.0.113.10 (system resolver) cpu off on 32 threads, 1 GPU (-t N turns it on) connected to stratum+ssl://pool.example.com:3335 (203.0.113.10:3335) fee window: 2.00 % of the time, first round in about 49 min job 9dd830e6 diff 18.25G first share accepted after 12.3 s fee round started (1 min) fee round ended: 2 share(s)
- wallet
- 按链校验过的地址(checksum ok),或带 --ignore-wallet-check 时的 UNCHECKED。worker 附加在其后:你看到的正是矿池看到的。
- pool
- 按 -o 给定的矿池:第一个为主矿池,其余按顺序作为备用。没有矿池的钱包在这一行之前就被拒绝(E224)。
- custody · fee
- custody:谁向钱包付款(矿池)。fee:该算法的费率,以一分钟为一轮在单独的连接上挖取,Quantus 2 %,RandomX 0.85 %,Pearl 1 %,TensorCash 2 %(由其引擎在同一矿池上挖取);已签名条款未为它指定费用矿池时不收费。
- build · egress
- build:版本号和运行中二进制文件 SHA-256 的前十六位十六进制。egress:矿工将通信的每一台主机,此外没有别的;telemetry.fearminer.com 会连同其频率、所发送的字段组以及查看方式一起列出(使用 --no-telemetry 时,它的位置显示 no telemetry (--no-telemetry))。
- driver · gpu · ram · host · network · dns · cpu
- 预检包括:NVIDIA 驱动及其库;每张卡的 compute capability 和空闲显存是否满足算法需要;系统内存;主机(裸机或虚拟机、kernel lockdown、Secure Boot)。然后是如何到达矿池(代理或 DNS 模式、地址族、首次使用即信任)、每个矿池名称解析到什么、由谁应答。未通过检查的卡标为 Excluded 并附代码;其余卡继续挖矿。cpu:与它们一起挖矿的 CPU 线程,有 GPU 的矿机上关闭(除非 -t N),RandomX 上每个物理核心一个。超过机器能腾出的数量(全部线程减二,且每张卡减一)会被限制到该值,该行会说明。
- fee window · fee round
- 引擎启动后,fee window 给出费率占时间的比例以及第一轮何时到来。每一轮记录 fee round started (1 min) 和 fee round ended: N share(s)。没有任何一行点名费用矿池。条款中没有费用矿池的算法说明一次,并免费挖矿。
- first share
- 第一个份额之前,每个引擎都要通过其已知答案测试(检查正确性并测量速度);同一二进制文件、驱动和显卡上的启动会跳过它并说明。首次启动还会在你的显卡上测量几种启动几何并缓存最优的(--retune 重新测量)。然后是第一个任务,然后是第一个被接受的份额,连同延迟说一次,/stats 以 time_to_first_share_s 携带它。每分钟一个份额时,十分钟后有效算力才有意义。
终端面板:滚动算力、带最小值、平均值和最大值的迷你图、份额走带、每张显卡一行(状态、温度、风扇、功耗、acc/rej、距上次份额的时间),以及日志。按键:
纯文本日志
纯文本日志 #
--no-tui 每条记录打印一行:被接受(✔)和被拒绝(✘)的份额及显卡、难度和往返时间,新任务,连接,带代码的判定。
每分钟一行给出三个算力,各以其时间窗命名,然后是有效算力:
- 瞬时速率
- 十分钟平均
- 会话平均:启动以来的全部哈希除以运行时间
- 矿池承认的算力,及其占本地算力的比例
无论算力多少这一行都按进程的时钟出现:为零时它点名暂停中的显卡,如下所示。
--no-color 去掉颜色,-v 加入 debug 记录。
19:12:14 ✔ 5/6 · GPU0 · 18.25G · 24 ms 19:12:21 hashrate 588.5 MH/s (10m 587.9, session 586.2, eff 580.2 / 98 %) 19:13:21 hashrate 0.0 H/s (10m -, session -, eff -) - GPU0 Paused (mem 106 °C) - shares 3/3 - diff 1.60M
日志文件及其轮转
日志文件及其轮转 #
--log-file PATH 写入矿工记录的每一条,面板模式或纯文本模式,每条一行:2026-09-20T19:33:49.788Z INFO message(UTC,毫秒,无颜色),矿池密码替换为 ***。
追加写入,从不截断。按大小轮转为 PATH.1 ... PATH.N。
--log-max-size | 轮转大小,默认 10 MB |
|---|---|
--log-keep | 保留的文件数,默认 5;--log-keep 0 则重新开始文件 |
--log-level-file | 文件自己的级别,带 -v 时为 debug,否则为 info,所以可以在安静的控制台下记录 debug 文件 |
轮转失败会报告到控制台,矿工继续写入。
$ fearminer -o stratum+ssl://POOL:PORT -u YOUR_WALLET --log-file fearminer.log --log-level-file debug --log-max-size 10 --log-keep 5 2026-09-20T19:33:49.788Z INFO connected to stratum+ssl://pool.example.com:3335 (203.0.113.10:3335)
详细说明与行为
每个故障行只带一个代码和一条消息。
fearminer explain <CODE> 离线打印原因、影响和处理方法。
E1xx | 网络 |
|---|---|
E2xx | 配置 |
E3xx | 硬件 |
E4xx | 钱包 |
E5xx | 内核与引擎 |
E6xx | 特权与性能前提(MSR 调优、大页、辅助程序) |
E7xx | 超频 |
E8xx | 服务与远程控制 |
已发布的编号永不复用。
$ fearminer explain E302
E302 device lost
cause: The driver reported the card gone in the middle of a search: an Xid error, a PCIe reset, a crash of the card, an overclock or a power supply that cannot hold it.
impact: The card's worker has exited. With the watchdog on, the miner exits with code 10 and the supervisor restarts it (the card comes back with the driver, the process does not get it back); with --no-watchdog the others mine on without it.
action: If it struck after a long stable run, lower the clock or the power limit and try again. If it struck at the first search, check the driver (nvidia-smi, dmesg for Xid) and the riser or slot.退出码 #
| 代码 | 含义 | 监督进程 |
|---|---|---|
0 | 请求停止(SIGTERM、Ctrl+C、q),正常。 | |
1 | 未分类错误。 | 重启 |
2 | 无效的配置或参数,每次拒绝都带有代码(E2xx;无法解码的钱包为 E4xx)。 | 最终 |
3 | 缺少前提条件:没有设备、引擎无法启动、所有设备自检失败、端口被占用,或没有 --allow-root 却以 root 启动。 | 最终 |
4 | 另一个实例正在运行(--allow-multiple 可运行多个)。 | 最终 |
10 | 设备崩溃或挂起。 | 重启 |
11 | 看门狗裁定:零算力、幽灵算力或算力低、份额饥荒、没有被接受的份额,或显卡超过 --temp-shutdown。 | 重启 |
12 | 监督进程在 --restart-window 内重启 --max-restarts 次后放弃。 | 最终 |
13 | 子进程死于意料之外的信号。 | 重启 |
14 | 执行了 restart 命令:监督进程再次启动挖矿进程,不计入 --max-restarts。 | 重启 |
- 监督进程不重启子进程时以子进程的退出码退出(0、2、3、4)。
- 放弃时 12。
- 请求停止后 0,无论是否杀死了子进程。
启动脚本在 2、3、4、12 时停下,其余重启;systemd 单元用 RestartPreventExitStatus=2 3 4 12。
fearminer --help 打印这张表。
错误代码 #
设备故障(E302 到 E305、E313 到 E319、E506 到 E508)看发生时机:第一次搜索就出现是矿工或驱动,长时间稳定运行后是超频。
fearminer explain 列出所有代码;fearminer explain E302、e302 或 302 打印一条。
E1xx · 网络
E101 | pool unreachable |
E102 | TLS handshake failed |
E103 | TLS certificate pin mismatch |
E104 | login refused |
E105 | no job from the pool |
E106 | no pool answers |
E107 | pool address does not resolve |
E108 | connection lost |
E109 | unreadable message from the pool |
E110 | pool accepts no share |
E111 | fee terms not fetched |
E113 | pool answers no submit |
E114 | pool refuses every share |
E115 | proxy connection failed |
E116 | DNS over HTTPS failed |
E117 | name not found by the DoH resolver |
E118 | TLS certificate changed since first use |
E119 | TLS trust file unusable |
E120 | TLS certificate not verified |
E125 | share unanswered |
E126 | pool redirect refused |
E127 | nonce space exhausted |
E128 | job replayed by the pool |
E129 | pool latency over the limit |
E135 | command channel closed |
E136 | command failed |
E137 | sentinel file unusable |
E138 | configuration file not watched |
E139 | hook script failed |
E2xx · 配置
E201 | bad pool URL |
E202 | bad option value |
E203 | wrong number of per-pool values |
E204 | wallet required |
E205 | pool required |
E206 | bad device selection |
E207 | stats port unusable |
E208 | log file unusable |
E209 | state directory unusable |
E210 | another instance is running |
E211 | configuration file unusable |
E212 | unknown configuration key |
E213 | bad value in the configuration file |
E214 | this miner cannot run that chain |
E215 | the wallet matches several chains |
E216 | unknown command |
E217 | command not allowed |
E218 | bad command target |
E219 | the change needs a restart |
E220 | reload rejected |
E221 | bad hook |
E222 | history file unusable |
E223 | no history kept |
E224 | wallet without a pool |
E3xx · 硬件
E301 | no device to mine on |
E302 | device lost |
E303 | device hang |
E304 | zero hashrate |
E305 | ghost hashrate |
E306 | thermal pause |
E307 | NVIDIA driver missing |
E308 | NVIDIA driver too old |
E309 | GPU engine cannot start |
E310 | not enough free GPU memory |
E311 | NVIDIA driver mismatch |
E312 | every worker has exited |
E313 | hashrate low |
E314 | hashrate suspect |
E315 | share famine |
E316 | shares refused in a row |
E317 | device back to mining |
E318 | device quarantined |
E319 | thermal shutdown |
E320 | engine process restarted |
E321 | engine index refused |
E322 | engine index not fetched |
E323 | engine download refused |
E324 | no engine to run |
E325 | engine not supported by this miner |
E326 | engine updated |
E327 | engine update rolled back |
E328 | fee engine started per round |
E329 | machine below the algorithm's requirements |
E4xx · 钱包
E401 | wallet does not decode for the chain |
E402 | wallet check skipped |
E5xx · 内核与引擎
E501 | kernel load failed |
E502 | compute capability unsupported |
E503 | tuning failed |
E504 | degraded kernel |
E505 | share could not be encoded |
E506 | kernel gives wrong results |
E507 | invalid share caught before submit |
E508 | engine refused its own candidates |
E6xx · 特权与性能
E601 | helper not available |
E602 | helper call failed |
E603 | MSR tweaks skipped in a virtual machine |
E604 | MSR tweaks skipped under kernel lockdown |
E605 | MSR tweaks skipped: msr module missing |
E606 | MSR tweaks skipped: writes disabled |
E607 | MSR tweaks skipped: no preset for this CPU |
E608 | MSR values not restored |
E609 | huge pages short |
E610 | 1 GB pages unavailable |
E611 | MSR tweaks unavailable on this platform |
E612 | Lock pages in memory right missing |
E613 | priority not applied |
E614 | MSR values restored |
E615 | huge pages not released |
E616 | run named to the helper by its pid alone |
E7xx · 超频
E701 | memory clock is not a step of the card |
E702 | overclock value out of the card's range |
E703 | overclock needs privileges |
E704 | overclock not supported |
E705 | overclock refused by the driver |
E706 | overclock restore file unusable |
E707 | overclock script failed |
E708 | overclock restored |
E8xx · 服务与远程
E801 | no service manager |
E802 | the mining OS runs the miner |
E803 | service manager step failed |
E804 | service not installed |
E805 | service privilege |
E806 | service starts with your session |
E807 | option makes no service |
E808 | a service is already there |
E809 | remote command refused |
E810 | enrolment refused |
E811 | relay refused the rig |
E812 | relay unreachable |
E813 | update refused |
E814 | updater not installed |
E815 | release not downloaded |
E816 | release failed its checks |
E817 | new binary failed its checks |
E818 | update rolled back |
E819 | updated |
E820 | benchmark refused |
名称是矿工自己的,与 explain 打印的一致,不翻译:日志行与此表逐字对应。
详细说明与行为
FearMiner 在第一个数据包之前检查钱包,每次启动都说明算力去向,钱包变化时发出警告,拒绝它不需要的特权,并列出它通信的每一台主机。
钱包检查与钱包变更警告
钱包检查与钱包变更警告 #
在矿工连接任何地方之前检查。
| Quantus | Quantus 网络的 SS58 地址,前缀 189,32 字节账户,验证 blake2b 校验和 |
|---|---|
| RandomX | Monero 主网地址,标准、子地址或集成,验证 keccak 校验和。被点名拒绝:testnet 和 stagenet |
| TensorCash | TensorCash 的 tc1... segwit(bech32)地址或该链的 base58check 地址,由其引擎验证校验和 |
- 钱包是
-u中.worker之前的部分。 +diff后缀和solo:前缀不参与检查,原样发送。- 无法解码的地址或属于其他网络的地址:拒绝并给出原因,退出码 2,不连接,也不在链之间猜测。
--ignore-wallet-check原样发送,启动时警告(E402),把横幅标为UNCHECKED。
钱包还按矿池主机记忆:主机和钱包的哈希,存于状态目录的 wallets.json,从不明文,在会话第一个份额被接受后写入。
若文件记得该主机的另一个钱包,下次启动:
- 打印
WARN wallet changed since the last session on <host> (was <date>) - 标题栏显示
wallet changed - 在
/stats和 API 上置wallet_changed - 发送严重警报
wallet_changed - 继续挖矿
在新钱包挣到一个份额之前,每次启动都会再次警告。
root 与密码
root 与密码 #
- Linux 和 macOS 上以 root 启动的矿工以 3 退出。
--allow-root让它照常运行;HiveOS 安装包会传入它。- systemd 单元在专用用户下运行矿工。
- 监督进程在派生挖矿进程前检查一次;Windows 没有检查。
-p或FEARMINER_PASS中的真实矿池密码(惯例x以外的任何值)会出现在进程列表中,矿工启动时说明一次。--pass-file改从文件读取,每个矿池一行;挖矿进程只看到路径,不是密码。- 其他用户可读的文件会被警告。
- 日志文件和
/api/v1/config中的密码都是***。
RandomX 需要 root 的 MSR 调优和大页预留经由 fearminer-helper(算法、费用与要求)。
- 独立、经过审计的二进制文件,无网络、无配置
- 在首次连接前通过
sudo -n到达,之后不再使用 - 以 root 运行的矿工在进程内完成,不用辅助程序
设置频率、功耗上限或风扇需要矿工本身是 root(--allow-root),否则超频留在外部。
中继无法读取驾驶舱的加密消息或签署你的命令。它能看到连接 IP 地址、时间和流量大小、矿机标识符、公钥、注册记录、软件版本及最后联系时间。
中继不可用时,矿机会重连并继续挖矿。缓存或随包提供的已验证引擎和费用条款可让挖矿不依赖 FearMiner 服务器。挖矿仍需要连接矿池。
矿工与哪些主机通信 #
- 你的矿池,通过 stratum+tcp 或 stratum+ssl:有备用时是列表中的每个矿池;经由 --proxy 指定的 SOCKS5 代理,此时名称也由它解析。
- 费用矿池,在一分钟的费用轮次期间,用它自己的连接,经由同一个代理。
- cfg.fearminer.com,获取签名的费用条款,启动时和之后每 20 分钟,直连,不经过代理,除非设置了 HTTPS_PROXY。无法到达时最多延迟启动五秒,矿工用最近验证过的条款(terms.bin)或内置条款挖矿。
- telemetry.fearminer.com,匿名遥测:运行开始后上报一次,之后每 15 分钟定期上报(--telemetry-interval),正常停止时再上报一次,与矿池走同样的代理和解析器。共 22 个字段,分为 12 组(
event、install、format、version、system、mining、hardware、hashrate、features、uptime、errors、pool),绝不含钱包、矿工名、机器名或地址。每个字段及其处理方式见 FearMiner 收集什么。--no-telemetry(FEARMINER_NO_TELEMETRY=1)关闭全部,且不损失任何功能;条款仍会获取。 - 只有你要求时才会直接连接:通知和心跳端点(api.telegram.org、discord.com、你自己的 URL)以及 --dns doh 的 DNS over HTTPS 解析器。
- relay.fearminer.com,仅在矿机加入驾驶舱之后,之前不会:一条出站连接(端口 443),承载只有你的矿场能读的密封消息,与矿池走同样的代理和解析器。--remote-relay 可把你自己的中继放在前面。
- download.fearminer.com:启动时和每小时获取签名的引擎索引,缺少引擎或有新版本时下载引擎;可由驾驶舱更新的服务约每小时读取 latest.json,只在请求更新或自动更新时下载新版本(算法、费用与要求,引擎)。
启动时的 egress 行列出了全部。统计端点监听 127.0.0.1,除非 --api-bind 另有指定。
所有矿池连接共用一个拨号器:--proxy、--dns 和 --ip 对会话、探测和费用轮次一视同仁。
只要配置了代理,就永不直接联系矿池(连接矿池)。
验证下载
验证下载 #
每个发布版本都带文件的 SHA256SUMS 和 SHA256SUMS.minisig,即发布密钥对它的 minisign 签名。
fearminer verify 内置该密钥,逐项检查,每文件一行:
- 离线验签(Ed25519)
- 校验和文件列出的、位于同一目录的每个文件的 SHA-256
ok | 文件与其校验和一致 |
|---|---|
MISSING | 校验和文件列出了它,目录中没有。你没有下载全部资产时本来就会这样,不是失败 |
MISMATCH | 文件在,校验和不同。这才是失败:删掉重新下载 |
只有签名正确且每个存在的文件都匹配才退出 0。
否则打印 verification FAILED; do not run this download。
给它压缩包时,它在旁边找 SHA256SUMS。
minisign 和 sha256sum 可手动做同样的事。
密钥只随宣布它的发布版本更换。
$ fearminer verify SHA256SUMS $ fearminer verify fearminer-linux-x86_64.tar.gz $ minisign -Vm SHA256SUMS -P RWQR3owV+nRhfgNJeUBqcRK868S52NFG2BOrIzKpkQ5ey6lCEfM9+3Eg $ sha256sum -c SHA256SUMS --ignore-missing PS> .\fearminer.exe verify SHA256SUMS PS> Get-FileHash .\fearminer-windows-x86_64.zip -Algorithm SHA256
校验和也覆盖 sbom.cdx.json,即二进制文件的 CycloneDX 物料清单:其中每个组件及其版本,可与漏洞数据库比对。
Linux 和 Windows 二进制文件在一个节中携带依赖列表,cargo audit bin 可读。
每个压缩包都带 THIRD-PARTY-NOTICES.txt,即内含开源组件的许可证。
为什么二进制文件没有签名
为什么二进制文件没有签名 #
二进制文件还没有代码签名,所以首次运行时 Windows 和 macOS 会拦下它;杀毒软件把任何矿工程序归入 HackTool 或 CoinMiner。前者说发布者未知,后者说这个程序在挖矿。
先检查下载。每个发布版本都带文件的 SHA256SUMS 和 SHA256SUMS.minisig,即发布密钥对它的 minisign 签名。fearminer verify 内置该密钥:离线验签,再检查校验和文件列出的、同一目录下每个文件的 SHA-256;只有全部匹配才退出 0。minisign 用公布的密钥检查同一个签名。sha256sum,或 PowerShell 里的 Get-FileHash,把哈希与发布页上的校验和手动比对。
检查通过时,你下载过的每个文件都打印 ok,没下载的资产打印 MISSING:退出码仍是 0。只有签名不对或出现 MISMATCH 才算失败,那时会打印 verification FAILED; do not run this download:删掉,重新下载。此后出现的只是操作系统在说缺少签名,而不是在说这个文件。
签名在计划之内,但不承诺日期:Authenticode 证书和 Apple 开发者账号是一笔每年都要付的账。在那之前,真正有分量的是 SHA256SUMS 上的那个签名,你可以自己离线验证。
写入磁盘的内容
写入磁盘的内容 #
每个归档解开后是一个与归档同名的文件夹。
fearminer | 矿工程序(Windows 上是 fearminer.exe) |
|---|---|
start_<algo> | 每种算法一个启动脚本:同样的命令,钱包放在变量里,外加重启循环 |
readme.txt | 与本页相同的参考手册,可离线看 |
openapi.json | API 说明 |
engines/ | 签名的引擎索引和本平台的引擎,首次启动无需联网即可挖矿 |
fearminer-helper | 仅 Linux:RandomX 使用的特权辅助程序(算法、费用与要求) |
~/.config/fearminer/tuning.json | GPU 调优缓存(Windows 在 %USERPROFILE%\.config\fearminer,macOS 在 ~/Library/Caches/fearminer)。 |
~/.cache/fearminer/ | 状态目录(Windows 在 %USERPROFILE%\.cache\fearminer;FEARMINER_STATE_DIR 可移动它),存放下面的文件。 |
terms.bin · fearminer.lock · crashes.json | 最近验证的条款;单实例锁;每张显卡的崩溃计数。 |
selftest.json · bench-<algo>.json | 每个引擎的自检裁定(通过时的二进制文件、驱动、显卡);每个算法的最近一次基准测试,连同其校验和。 |
tls-pins.json · oc-restore.json | --tls-tofu 记住的证书,以 host:port 为键;超频触碰之前每张卡的读数,以 UUID 为键,直到恢复为止。 |
/run/fearminer-helper/msr.json | 由辅助程序写入,root 拥有,仅 Linux:原始 MSR 值,直到 msr restore 或下次开机。 |
history.bin | 这台矿机自己的历史,每档分辨率一个固定大小的环,受 --history-max-size(默认 32 MB)限制,绝不超出(查看挖矿历史)。 |
stop · pause · resume | 没有令牌的编排程序用来暂停、继续或停止矿机的哨兵文件:矿工在一秒内执行并删除该文件(控制运行中的矿工)。 |
wallets.json · watchdog.log · api_token | 按矿池主机的钱包指纹(哈希,从不是钱包本身);监督进程日志,最多 256 KB;API 令牌,只有你可读。 |
telemetry-id | 遥测的安装 ID(32 位随机十六进制数字)及其上次运行的版本,仅你的账户可读;使用 --no-telemetry 时从不写入;fearminer telemetry rotate-id 会替换它。 |
engines/ | 引擎缓存:签名的引擎索引,以及每个算法引擎的两个最新版本,每次启动前都按索引校验。 |
remote-commands.log · remote-sheet.json · benchmark-run.json · benchmark-last.json · update-health.json | 矿场发来的命令(无论执行还是拒绝)及其应用的挖矿方案;驾驶舱请求的基准测试及其结果;新矿工启动后更新所等待的信息。 |
fearminer.toml | 只读不写,位于二进制文件旁或配置目录中。日志文件只在 --log-file 指定的位置。 |
中继能看到什么
中继能看到什么 #
| 连接 | 矿机发起的一条出站连接,端口 443,无需开放端口,与矿池走同样的代理和解析器;矿机加入后才建立,之前不会 |
|---|---|
| 状态 | 每分钟一次,驾驶舱打开时每 10 秒一次,密封后只有你的矿场能读 |
| 中继 | 只转发密封消息;无法读取它们,无法让矿机加入,无法签署命令 |
| 命令 | 由你的矿场签名,针对一台矿机,一分钟内有效且只能用一次:pause、resume、toggle、retune、restart、stop、挖矿方案、update(升级到新版本,限带更新器的 Linux 服务)以及 benchmark。每条命令,无论执行还是拒绝,都记录在矿机上的 remote-commands.log |
| 中继不可用 | 挖矿照常;连接自行重试 |
| 自己的中继 | --remote-relay wss://HOST,先于 wss://relay.fearminer.com 尝试 |
详细说明与行为
给出对应的选项或命令。日志行带代码时,先问 fearminer explain <CODE>。
算力低于预期。
某张 GPU 显示 Paused (temp 91 °C)。
某张 GPU 显示 Paused (temp 91 °C)。 #
温控。传感器在该行:temp 为核心,mem 为显存。核心在 --temp-resume(75 °C)恢复,显存在限值减 --temp-hysteresis(10 °C)恢复。暂停需要超过限值持续 --temp-hold(15 秒);尖峰不起作用。改善风道或用厂商工具降低功率上限。--temp-limit 85 更早暂停,--temp-limit 0 关闭核心温控,--temp-limit 85,80,_ 给显卡 1 单独设值。暂停十分钟后发送 temp_critical;--temp-shutdown 95 在暂停中的显卡继续升温时让矿工停止。
份额被拒绝。
我的显卡显示 Degraded 或 Quarantined,怎么办?
我的显卡显示 Degraded 或 Quarantined,怎么办? #
Degraded 是怀疑,原因在该行,显卡继续挖矿:十分钟平均低于 --hashrate-min(E313,若持续则在 --hashrate-grace 后重启)、连续拒绝(E316,下一个被接受的份额即清除)、份额饥荒(E315,其搜索被重启)。第一次搜索就出现是矿工或驱动;长时间稳定运行后是超频:降低它。Quarantined(E318):该显卡在 --restart-window(30 分钟)内把矿工拖垮 --device-quarantine 次(3),跳过本次运行,其他显卡照常挖矿。修好原因(超频、转接板、驱动)并重启;--reset-crashes 清除计数,--device-quarantine 0 关闭该规则。
某张显卡自检失败。
钱包被拒绝(E401、E214、E215)。
矿池不可达(E101、E107、E106)。
如何开机自启?
如何运行多台矿机?
文件在哪里?
文件在哪里? #
状态目录 ~/.cache/fearminer(Windows 上是 %USERPROFILE%\.cache\fearminer):terms.bin、fearminer.lock、crashes.json、wallets.json、selftest.json、bench-<algo>.json、watchdog.log、api_token、history.bin。调优缓存 ~/.config/fearminer/tuning.json(macOS 上是 ~/Library/Caches/fearminer)。配置文件从二进制文件旁边或 ~/.config/fearminer、%APPDATA%\fearminer、~/Library/Application Support/fearminer 读取;日志文件只在 --log-file 指定的地方。矿场、更新和引擎缓存还会在那里保存几个文件(写入磁盘的内容)。
费用如何收取?
费用如何收取? #
Quantus 2 %,RandomX 0.85 %,Pearl 1 %,TensorCash 2 %,由 --list-algorithms 和终端面板标题栏打印。以一分钟为一轮,在与费用矿池的单独连接上挖取,从不占用你的会话。启动时:fee window: 2.00 % of the time, first round in about N min;每轮记录 fee round started (1 min) 和 fee round ended: N share(s);告警为 devfee_start 和 devfee_stop;/api/v1/summary 统计双方的秒数和份额。该费率是上限:已签名的条款可以调低或按算法关闭,永远不能调高。TensorCash 没有轮次:它的引擎持有矿池会话,自己在那里为 FearMiner 的账户挖取费用。
矿工自己重启了。为什么?
矿工自己重启了。为什么? #
看门狗的一次裁定重启了挖矿进程。控制台的 supervisor: ... 一行和 watchdog.log 带有原因及其代码(E302 丢失、E303 挂起、E304 零算力、E305 幽灵、E313 算力低、E315 份额饥荒、E110 两个矿池上都没有被接受的份额、E319 温控停机)。fearminer explain <CODE> 说明怎么做。该行的崩溃计数指出是哪张显卡;三十分钟内被归咎三次的显卡跳过下一次运行(Quarantined)。三十分钟内五次重启:它放弃并以退出码 12 退出,--on-failure script:<path> 随后运行你的脚本。
它拒绝以 root 运行。
我的 GPU 不是 NVIDIA 也不是 Apple。
Windows 提示未知发布者;杀毒软件报警。
RandomX 很慢。
RandomX 很慢。 #
读启动块。E609 huge pages short 损失 20 到 30 %;带代码的 MSR 行(E601 到 E607)在 Intel 上最多 30 %,在 Zen 上 6 %;light mode(放不下 2 GiB 数据集的机器)更多。performance 行给出达到理想配置的比例。fearminer-helper(算法、费用与要求)在启动时完成这两件事。没有它:Linux,vm.nr_hugepages 用 E609 行给出的数字,刚开机时;Windows,Lock pages in memory。保持 2 GiB 空闲。线程数保持每个物理核心一个;-t 接受数字、百分比或增减量。
矿工能经 Tor 或代理工作吗?
矿工会给我的显卡超频吗?
如何接入仪表板?
如何接入仪表板? #
app.fearminer.com 上的驾驶舱(从驾驶舱管理矿机)不需要这些。自建仪表板时:在矿机上 curl http://127.0.0.1:4300/api/v1/summary 不需要任何东西。从其他机器:启动时加 --api-bind 0.0.0.0:4300,再发送 Authorization: Bearer <token>,令牌来自 fearminer token show。/stats 和 /hive-stats 无需令牌提供扁平的 HiveOS 对象。/openapi.json 描述每个字段。GET /api/v1/history 按你要求的步长提供矿机自己记录的数据:不需要时序数据库(查看挖矿历史)。三个写操作,对显卡的设置、对运行中矿工的命令、配置的重新加载,无论来自哪里都需要令牌,并且不会超出 --unrestricted-api 所允许的范围(控制运行中的矿工)。
systemd 单元示例
# /etc/systemd/system/fearminer.service [Unit] Description=FearMiner After=network-online.target [Service] User=fearminer StateDirectory=fearminer WorkingDirectory=/var/lib/fearminer Environment=HOME=/var/lib/fearminer FEARMINER_NO_TUI=1 EnvironmentFile=/etc/default/fearminer ExecStart=/usr/local/bin/fearminer Restart=always RestartSec=2s RestartPreventExitStatus=2 3 4 12 TimeoutStopSec=30s KillSignal=SIGINT [Install] WantedBy=multi-user.target
该单元把重启留给矿工的监督进程,只在它放弃后才让 systemd 重启整个程序;最终退出码不做处理。环境文件中的 FEARMINER_NO_SUPERVISOR=1 把全部重启交给 systemd。
完整参考
详细说明与行为
选项、取值、默认值、环境变量、作用。
每个选项也可以通过环境变量 FEARMINER_<OPTION> 设置,或在配置文件中用下划线形式的长名称设置(--temp-limit 即 temp_limit;--1gb-pages 即 huge_pages_1g)。
命令行优先于两者。
用法
用法 #
fearminer [OPTIONS] [WALLET] [COMMAND]
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
WALLET | 钱包:等同于 -u,同样要和矿池(-o)一起给出;未给 -a 时从地址读出链。 | |||
-h, --help | 打印帮助。-h 打印摘要,--help 打印全部:选项、示例、退出码。 | |||
-V, --version | 打印版本、提交哈希和构建日期。 |
矿池
矿池 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
-o, --url | <URL> | FEARMINER_URL | 矿池 URL:stratum+tcp://host:port、stratum+ssl://host:port 或 host:port(无 --tls 时为明文 TCP)。每次连接都重新解析主机名。重复或逗号分隔给出备用矿池:第一个为主矿池,它失败时按顺序尝试其余的;它恢复响应后即回到它。对于由引擎自己持有矿池会话的算法(TensorCash),用 wss://host[:port]/path。别名 --pool。 | |
-u, --user | <WALLET[.WORKER]> | FEARMINER_USER | 钱包地址,可选 worker 名,形式 WALLET.WORKER。一个值用于所有矿池;备用矿池需要别的值时按矿池顺序每池一个(重复或逗号分隔)。别名 --wallet。 | |
-w, --worker | <NAME> | FEARMINER_WORKER | worker 名,在 --user 没有时以 WALLET.WORKER 形式附加。 | |
-p, --pass | <PASS> | x | FEARMINER_PASS | 矿池密码。矿池会忽略它;惯例为 x。用于所有矿池,或像 --user 一样每池一个。真实密码写在这里会出现在进程列表中;请用 --pass-file。 |
--pass-file | <PATH> | FEARMINER_PASS_FILE | 从此文件读取矿池密码,代替 -p:一行用于所有矿池,或按矿池顺序每池一行。优先于 -p 和 FEARMINER_PASS。Unix 上若其他用户可读该文件会警告。 | |
--ignore-wallet-check | false | FEARMINER_IGNORE_WALLET_CHECK | 不检查钱包是否为该算法链上的地址就发送;横幅随后显示 UNCHECKED。 | |
--tls | false | FEARMINER_TLS | 在裸的 host:port 上使用 TLS(stratum+ssl:// URL 已隐含)。 | |
--tls-fingerprint | <SHA256> | FEARMINER_TLS_FINGERPRINT | 用 SHA-256 指纹(64 位十六进制)固定矿池的 TLS 证书,用于自签名证书;否则按公共根证书验证。用于所有矿池,或像 --user 一样每池一个(没有指纹的矿池用短横线 -)。别名 --tls-cert-sha256。 | |
--tls-spki | <sha256/BASE64> | FEARMINER_TLS_SPKI | 按矿池 TLS 证书公钥(SPKI)的 SHA-256 固定证书,形式 sha256/BASE64(HPKP 记法);保留密钥的证书续期不会破坏它。用于所有矿池,或像 --user 一样每池一个(没有的矿池用短横线 -)。同一矿池上优先于 --tls-fingerprint。 | |
--pool-retries | <N> | 3 | FEARMINER_POOL_RETRIES | 网络错误时对一个矿池的连接尝试次数,之后尝试下一个矿池。拒绝登录的矿池立即让位。所有矿池都不可用:矿工无限轮流重试,每轮之间暂停最多 60 秒。 |
--job-timeout | <SECS> | 按链 | FEARMINER_JOB_TIMEOUT | 在其他方面正常的连接上,多少秒没有新任务就把会话视为已死:工作线程停止,矿工像连接丢失后一样重连。默认按链:quantus 120,randomx 300(最多每分钟一个任务),pearl 180,tensorcash 300(由其引擎判断矿池)。0:关闭这项保护。 |
--submit-timeout | <SECS> | 10 | FEARMINER_SUBMIT_TIMEOUT | 已提交的份额等待矿池回复多少秒后算作未应答(E125)。连续 --max-no-submit-responses 次未应答会重连会话。 |
--max-latency | <MS> | 0 | FEARMINER_MAX_LATENCY | 矿池应答一次提交的最长时间,毫秒,取最近二十次回复的中位数。超过它两分钟:会话移到列表中更快的矿池,如果有(E129)。0 关闭。 |
-a, --algo | <ALGO> | quantus | FEARMINER_ALGO | 要挖的算法或币种(--list-algorithms 给出名称和别名)。默认:从钱包读出的链;没有钱包时为 quantus。别名 --coin。 |
--list-algorithms | 列出引擎索引(缓存的或随发布附带的副本)中的算法及其费用上限,然后退出;配合 --json,输出一个 {name, coin, class, fee_bps, aliases, unit, hive, requirements, refused} 数组。 | |||
--engine | <ALGO=VERSION> | FEARMINER_ENGINE | 把某算法的引擎固定在签名索引中的一个版本,ALGO=VERSION(可重复,或用逗号分隔):运行该版本,来自缓存或下载,每小时的更新不会动这个算法。 | |
--engine-opt | <NAME=VALUE> | FEARMINER_ENGINE_OPT | 算法引擎的一个选项,NAME=VALUE(可重复,或用逗号分隔):--list-algorithms 会列出某算法有哪些选项以及各自接受的值。算法没有的选项或它不接受的值会被拒绝。 | |
--tsc-precision | <VALUE> | FEARMINER_TSC_PRECISION | 早期矿工为某个引擎的精度提供的选项:现在是 --engine-opt precision=VALUE,对引擎带有该选项的算法,本选项仍会设置它。其他算法忽略它。 |
配置
配置 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--config | <PATH> | FEARMINER_CONFIG | 从此 TOML 文件读取配置,每个选项一个键。默认:二进制文件旁的 fearminer.toml,再是配置目录中的那个,有则读取。--config "" 不读取任何文件。 | |
--dry-run | 打印生效的配置并退出;不联系任何主机。每个键的值及来源(default、file、env、cli),密码打码;然后是模式、算法、矿池、被排除的显卡;再是 --check-config 的判定。矿工能启动则 0,否则 2 并给出带代码的原因。 | |||
--check-config | 不挖矿只检查配置:选项、设备选择与驱动列出的显卡、矿池列表、钱包与其链。矿工能启动则 0,否则 2 并给出带代码的原因。不联系任何主机。 |
网络
网络 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--proxy | <URL> | FEARMINER_PROXY | 通过这个 SOCKS5 代理到达每个矿池(Tor:socks5://127.0.0.1:9050);凭据写作 socks5://user:pass@host:port。矿池名称由代理解析:关于它们的 DNS 查询不离开本机,.onion 矿池也能用。代理失败即连接失败:不会直接回退到矿池。socks5h:// 含义相同。 | |
--dns | <MODE> | system | FEARMINER_DNS | 矿池名称解析:system(操作系统解析器)、doh(通过 --doh-url 的 DNS over HTTPS,端点不应答时用系统解析器,端点说名称不存在时绝不回退)、doh-strict(只用 DNS over HTTPS)。DoH 只对本地解析器隐藏名称:TLS SNI 仍然可见。与 --proxy 同用时无意义。 |
--doh-url | <URL> | https://cloudflare-dns.com/dns-query | FEARMINER_DOH_URL | --dns doh 和 doh-strict 使用的 DNS over HTTPS 解析器(RFC 8484)。本地 DNS 无法解析解析器自己的名称时,给出它的 IP(https://1.1.1.1/dns-query)。 |
--ip | <any|4|6> | any | FEARMINER_IP | 连接矿池使用的地址族:any(IPv6 优先,250 毫秒后 IPv4,先连上的胜出)、4 或 6。 |
--ipv4-only | false | 仅 IPv4:与 --ip 4 相同。 | ||
--ipv6-only | false | 仅 IPv6:与 --ip 6 相同。 | ||
--tls-tofu | false | FEARMINER_TLS_TOFU | 首次使用即信任矿池的 TLS 证书,用于使用自签名证书的节点或 P2Pool:第一次握手的指纹写入状态目录的 tls-pins.json;之后该矿池的任何其他证书都被拒绝。带 --tls-fingerprint 或 --tls-spki 的矿池改为按其固定值检查。 | |
--tls-insecure | false | FEARMINER_TLS_INSECURE | 接受未固定的 stratum+ssl:// 矿池出示的任何 TLS 证书:不检查证书链、名称和有效期。用于 TLS 端口转发或代理,此时所连接的名称不是矿池的名称。会话仍然加密,但不再验证矿池身份(每次启动都有 E120)。带 --tls-fingerprint 或 --tls-spki 的矿池保留其固定值,费用轮次与矿池走同样的路。与 --tls-tofu 同用时拒绝,没有剩下未固定的 stratum+ssl:// 矿池时也拒绝。 | |
--tls-tofu-reset | <HOST:PORT> | 连接前忘记为此矿池记住的证书(host:port,如 E118 行打印的那样);现在出示的证书被信任并记住。多个矿池时重复使用。 | ||
--remote-relay | <URL> | FEARMINER_REMOTE_RELAY | 用于远程控制的自有中继,先于内置中继(wss://relay.fearminer.com)尝试:wss://HOST[:PORT],或用 ws:// 指向本机或本网络中的中继。多个时重复使用。矿机加入之前不会联系任何中继。 | |
--remote-wallet-delay | <MIN> | 0 | FEARMINER_REMOTE_WALLET_DELAY | 驾驶舱挖矿方案中的新钱包在生效前等待的分钟数,并附两个地址通知;期间任意驾驶舱或 fearminer remote cancel 都可取消。默认 0,表示立即生效。 |
--no-auto-update | false | FEARMINER_NO_AUTO_UPDATE | 不自动更新。以 Linux 服务安装的矿机会在首次发现新版 FearMiner 后两小时内自行更新,签名检查和回滚与驾驶舱的“更新”按钮相同;设置此项后,只有该按钮或 fearminer service update 会更新。驾驶舱可以为单台矿机或整个矿场开启或关闭。 | |
--enroll | <CODE> | FEARMINER_ENROLL | 启动时加入此代码对应的矿场(fm1_...,来自驾驶舱的「添加矿机」):等同于 fearminer enroll CODE,用于服务、HiveOS flight sheet 或部署脚本。矿机已在该矿场时不做任何事。 |
设备
设备 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
-d, --devices | <LIST> | 全部 | FEARMINER_DEVICES | 要挖矿的 GPU,逗号分隔:索引(0)、PCI id(pci:0000:41:00.0、41:00.0,或只写总线,十六进制 pci:41 或十进制 bus:65)、完整 UUID(GPU-3f2a...),均按 --list-devices 所印;厂商(nvidia、amd、intel:其全部显卡);或以 ! 开头的排除项(!1、!pci:41:00.0、!GPU-3f2a...、!nvidia)。使用列表和排除列表不能混用。CPU 线程由 -t 决定。NVIDIA 精确选中所列显卡;未匹配本机任何显卡的项是 E206,退出码 2,除非 --device-missing first 或 last 改在现有显卡上挖矿。Vulkan 和 Metal 取前 N 张显卡,只接受 0..N-1。排除全部显卡是允许的:显卡显示为 Excluded,由 CPU 线程挖矿;没有 CPU 线程则是 E301,退出码 3。 |
--device-missing | <POLICY> | match | FEARMINER_DEVICE_MISSING | 当 -d 指向本机没有的显卡时:match 拒绝启动(E206);first 和 last 保留配置并在现有显卡上挖矿,逐卡列表(--temp-limit 85,80)从第一个位置起或从最后一个位置倒着铺开。 |
--temp-limit | <C[,C...]> | 90 | FEARMINER_TEMP_LIMIT | GPU 核心温度(摄氏度)达到或超过此值并持续 --temp-hold 秒时暂停,直到降温到 --temp-resume;0:不做核心温控。用于所有显卡,或按 -d 顺序每卡一个(85,80,_,90:_ 保留默认值,较短的列表让其余保持默认)。 |
--temp-resume | <C[,C...]> | 75 | FEARMINER_TEMP_RESUME | 被 --temp-limit 暂停的 GPU 恢复挖矿的核心温度;必须低于 --temp-limit。用于所有显卡,或按 -d 顺序每卡一个。 |
--temp-limit-mem | <C> | 105 | FEARMINER_TEMP_LIMIT_MEM | GPU 显存传感器达到或超过此温度并持续 --temp-hold 秒时暂停,直到降温 --temp-hysteresis 度;0:不做显存温控。没有该传感器的显卡不按它判定。 |
--temp-limit-hotspot | <C> | 100 | FEARMINER_TEMP_LIMIT_HOTSPOT | 热点传感器的同类设置;0 关闭。NVML 不提供热点读数:NVIDIA 上该传感器缺失,显卡不按它判定。 |
--temp-hysteresis | <C> | 10 | FEARMINER_TEMP_HYSTERESIS | 显存或热点传感器必须降到其限值以下多少度 GPU 才恢复,摄氏度。核心有自己的一对,--temp-limit 和 --temp-resume。 |
--temp-hold | <SECS> | 15 | FEARMINER_TEMP_HOLD | 传感器必须在其限值或以上持续多少秒 GPU 才被暂停;更短的尖峰不改变任何事。0 在第一次读数时就暂停。 |
--temp-shutdown | <C> | 0 | FEARMINER_TEMP_SHUTDOWN | 当暂停中的 GPU 核心从暂停起算在此温度或以上持续 --temp-hold 秒时停止矿工(退出码 11,E319)。0 关闭;必须高于 --temp-limit。 |
--no-nvml | false | FEARMINER_NO_NVML | 不打开 NVML:没有 GPU 传感器(温度、风扇、功率、频率、限频、能耗),/api/v1/devices 和 /stats 上每个传感器都为 null,挖矿继续。gpu 启动行显示 sensors off (--no-nvml): no thermal cut-off。 | |
-t, --threads | <N|N%|-N|ALGO:N,...> | FEARMINER_THREADS | CPU 挖矿线程:数字(8)、自动值的百分比(50%,按线程取整)、增减(-2、+2),或每算法一个(randomx:16,其余用不带前缀的值)。自动值:有 GPU 的矿机为 0(CPU 在那里用 17 % 的功耗只赚约 0.5 % 的算力),无 GPU 的为全部线程减二;RandomX 每物理核心一个线程,受 L3 缓存限制(每线程 2 MiB)。超过机器能腾出的数量(全部线程减二,每张卡再减一)会被限制到该值,日志 cpu 行会说明(asked 999 with -t, capped to 30 of 32)。 | |
--igpu | false | FEARMINER_IGPU | 也在集成 GPU 上挖矿,即使旁边有独立显卡。 | |
--skip-preflight | false | FEARMINER_SKIP_PREFLIGHT | 忽略首次连接前检查的结论(驱动版本、compute capability、空闲显存):报告照常打印,不排除任何显卡,也不阻止启动。 | |
--retune | false | FEARMINER_RETUNE | 重新测量 GPU 启动几何,忽略缓存的结果。 | |
--self-test | [=<ALGO>] | FEARMINER_SELF_TEST | 引擎的已知答案测试。挖矿运行时强制在启动时执行(否则同一二进制文件、驱动和显卡此前通过时会跳过)。单独运行、没有矿池和钱包时:为 -a 的算法离线运行(--self-test=ALGO 指定另一算法,--self-test=all 全部),每设备一个裁定,退出 0,失败则 3。 | |
--self-test-nonces | <N> | 256 | FEARMINER_SELF_TEST_NONCES | 自检在每张显卡上搜索的 nonce 数,每一个都在 CPU 上重新哈希。 |
--verify-shares | <on|off> | on | FEARMINER_VERIFY_SHARES | 提交前在 CPU 上复核 GPU 解(on,默认)或不复核(off):检查开销低于一个核心的 1 % 时每个都复核,超出后十个复核一个:错误的解被丢弃并在显卡行计为 invalid,而非被矿池拒绝。CPU 解从不复核。 |
--gpu-batch | <N> | 1000000 | FEARMINER_GPU_BATCH | GPU 批大小,每次启动的 nonce 数:一个下限,向上取整到显卡调优几何的整数遍(启动行给出生效的批大小)。 |
--cpu-batch | <N> | 1000 | FEARMINER_CPU_BATCH | CPU 批大小,两次取消检查之间的哈希数。 |
--throttle | <MS> | 0 | FEARMINER_THROTTLE | GPU 批之间的暂停,毫秒;0 为不暂停。 |
--list-devices | 列出本机可挖矿的 GPU(索引、名称、PCI id、UUID)并退出;不打印其他内容。--json 给出机器可读形式。 | |||
--json | 配合 --list-devices 或 --list-algorithms,以 JSON 打印列表:显卡及其显存、compute capability、驱动、厂商、引擎,加上 CPU 和 RAM;或算法及其 name、coin、class、fee_bps、aliases、unit、hive、requirements、refused。 |
CPU
CPU #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--cpu-affinity | <MASK|LIST> | FEARMINER_CPU_AFFINITY | 把 CPU 工作线程按线程顺序绑定到这些逻辑 CPU:十六进制掩码(0xff,第 i 位对应 CPU i)或列表(0-7,16-23)。取代自动放置,即每物理核心一个、分布到各 NUMA 节点。 | |
--cpu-priority | <0-5> | FEARMINER_CPU_PRIORITY | CPU 工作线程的优先级,0(空闲)到 5(最高),XMRig 的刻度:Linux 上为 nice 19、5、0、-5、-10、-15,Windows 上为线程优先级类。Linux 上高于 2 需要特权(被拒时 E613)。默认:进程自己的优先级。 | |
--msr | <auto|off|PRESET|LIST> | auto | FEARMINER_MSR | RandomX 的 MSR 调优(CPU 预取器,XMRig 的公开值),首次连接前通过 fearminer-helper 应用,退出时恢复。auto 按 CPU 选择预设(zen1、zen2、zen3、zen4、zen5、intel);辅助程序缺失或机器无法接受(虚拟机、kernel lockdown、没有 msr 模块)时以一行带代码的信息跳过,从不拒绝启动。off 什么都不写。预设名或列表 addr:value:mask,... 强制这些值,仅限预设所调的寄存器(0x1a4、0xc0011020 到 0xc0011022、0xc001102b)。 |
--1gb-pages | false | FEARMINER_1GB_PAGES | RandomX:CPU 支持时(pdpe1gb)为数据集预留 1 GiB 页,每个 NUMA 节点三个:比 2 MiB 页快 1 到 3 %。默认关闭,与 XMRig 相同。仅在内核默认大页尺寸为 1 GiB 时(内核命令行上的 default_hugepagesz=1G)。文件中为 huge_pages_1g。 | |
--helper | <PATH> | FEARMINER_HELPER | 特权辅助程序(fearminer-helper),以 sudo -n PATH 运行,用于 MSR 调优和大页预留。默认:已安装的 /usr/local/bin/fearminer-helper(sudoers 行中的路径),否则是矿工二进制文件旁的副本。给出 PATH 后它是唯一尝试的路径,不会再试已安装的辅助程序;sudo 拒绝它或那里没有程序时报 E601。PATH 处没有可用程序并不拒绝启动:RandomX 运行报 E601 并在无调优下挖矿,--check-config 给出警告。矿工是 root 时(--allow-root)不使用:它在进程内做同样的事。 |
输出
输出 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--api-bind | <IP:PORT> | 127.0.0.1:4300 | FEARMINER_API_BIND | 统计端点和 API 监听的地址。0.0.0.0:4300 向局域网开放,此时 /api/v1/* 需要令牌。 |
--no-api | false | FEARMINER_NO_API | 不提供统计端点和 API。 | |
--no-tui | false | FEARMINER_NO_TUI | 用纯文本滚动日志代替全屏面板(管道和哑终端本来就得到这个)。 | |
--no-color | false | FEARMINER_NO_COLOR | 日志无颜色;面板使用终端自身的颜色。环境中的 NO_COLOR 效果相同。 | |
-v, --verbose | false | FEARMINER_VERBOSE | debug 级别日志。 | |
--log-file | <PATH> | FEARMINER_LOG_FILE | 同时把日志写入此文件:每条记录一行,UTC 时间戳,无颜色,矿池密码打码。追加写入,从不截断;按大小轮转(--log-max-size、--log-keep)。面板模式和纯文本模式都会写入。 | |
--log-level-file | <LEVEL> | info · debug 带 -v | FEARMINER_LOG_LEVEL_FILE | 日志文件的级别,独立于控制台:trace、debug、info、warn 或 error。 |
--log-max-size | <MB> | 10 | FEARMINER_LOG_MAX_SIZE | 日志文件轮转为 PATH.1、.2 ... 的大小,MB。 |
--log-keep | <N> | 5 | FEARMINER_LOG_KEEP | 保留的轮转文件数(PATH.1 到 PATH.N);0 则重新开始文件。 |
--no-telemetry | false | FEARMINER_NO_TELEMETRY | 完全不发送遥测:不生成也不保存安装 ID,也不向 telemetry.fearminer.com 发送任何东西(它原本会携带什么:FearMiner 收集什么)。没有任何功能依赖它。已签名的费用条款仍从 cfg.fearminer.com 获取。 | |
--telemetry-interval | <MIN> | 15 | FEARMINER_TELEMETRY_INTERVAL | 两次遥测定期上报之间的分钟数,5 到 1440:低于 5 提高到 5,超过一天降为一天,日志会说明。 |
历史
历史 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--history | <on|off> | on | FEARMINER_HISTORY | 这台矿机的历史存于 <state dir>/history.bin(on,默认)或不存(off):24 小时内每 10 秒一个采样,之后一周每分钟一个、一个月每五分钟一个、再往前每小时一个。由 GET /api/v1/history 和 fearminer history 读取。off 什么都不留;改动需要重启。 |
--history-retention | <DAYS> | 90 | FEARMINER_HISTORY_RETENTION | 保留多少天历史。超过一周采样间隔五分钟,超过一个月一小时:九十天只有几兆字节。无需重启即可重新加载。 |
--history-max-size | <MB> | 32 | FEARMINER_HISTORY_MAX_SIZE | 历史文件的硬上限,MB:文件从第一个字节起就按它布局,绝不超出。它优先于 --history-retention,后者被削减以适应。无需重启即可重新加载。 |
基准测试
基准测试 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
-B, --benchmark | 测量本机的算力和功耗后退出;不需要矿池和钱包。使用 -a all 或列表(-a quantus,randomx)时依次测试每个算法,最后给出汇总;本机无法运行的算法会被跳过并说明原因,TensorCash 也是(没有离线基准测试:它的速率在矿池上测量)。计时在预热之后开始,每个 worker 一次不计时的搜索,因此引擎准备(RandomX 数据集构建)不计入。结果写入状态目录(bench-<algo>.json);下次运行会把它们与新结果并列显示。 | |||
--duration | <SECS> | 10 · 60 | 每个算法的基准测试时长,秒:单个算法为 10,多个为 60。 | |
--bench-seed | <N> | 确定性基准测试:工作和每个 worker 的 nonce 序列由此种子导出。运行在每个 worker 找到 --bench-solutions 个解后结束,而非按 --duration。每个解都在 CPU 上复核并打印校验和:同一硬件上两次运行校验和相同,硬件错误则不同。 | ||
--bench-solutions | <K> | 4 | 带种子的基准测试每个 worker 要跑到的解数。 | |
--warmup | <SECS> | 0 | 引擎就绪(准备、自动调优和首次搜索完成)之后、计时开始之前的不计时哈希:让显卡先达到工作温度和频率。为 0 时,所有设备一就绪就开始计时。 | |
--report | <FILE> | 把基准测试的机器可读报告(schema fearminer.benchmark/1)写入 FILE:先写到旁边再重命名,成功和失败时都写。 |
监督进程
监督进程 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--no-supervisor | false | FEARMINER_NO_SUPERVISOR | 以单进程运行矿工,不带崩溃后重启它的监督进程。用于 systemd、HiveOS 或其他自行重启矿工的看门狗,以及调试。 | |
--stop-timeout | <SECS> | 8 | FEARMINER_STOP_TIMEOUT | SIGTERM 或 Ctrl+C 后监督进程等待多少秒,然后杀死挖矿进程。 |
--max-restarts | <N> | 5 | FEARMINER_MAX_RESTARTS | 监督进程在 --restart-window 内允许的重启次数,超过则放弃(退出码 12)并执行 --on-failure。 |
--restart-window | <MIN> | 30 | FEARMINER_RESTART_WINDOW | --max-restarts 的时间窗,分钟。 |
--on-failure | <ACTION> | exit | FEARMINER_ON_FAILURE | 监督进程放弃时的动作:exit,或 script:<path> 先运行该脚本(环境中有 FEARMINER_EXIT_CODE、FEARMINER_CAUSE 和 FEARMINER_RESTARTS),然后退出。 |
--allow-multiple | false | FEARMINER_ALLOW_MULTIPLE | 即使此账户下已有另一个 fearminer 在运行也照常启动;跳过单实例锁。 | |
--allow-root | false | FEARMINER_ALLOW_ROOT | 以 root 挖矿。不带它时以 root 启动的矿工以退出码 3 退出。HiveOS 以 root 运行每个矿工,其安装包会传入此选项。 | |
--reset-crashes | 清除跨重启按 GPU 保存的崩溃计数,连同隔离,然后照常启动;单独运行、没有矿池时只清除并退出。 |
看门狗
看门狗 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--no-watchdog | false | FEARMINER_NO_WATCHDOG | 关闭看门狗:不检查挂起、算力、份额和拒绝,不隔离;丢失的显卡无论如何都让其他显卡继续挖矿。 | |
--hang-timeout | <SECS> | 60 | FEARMINER_HANG_TIMEOUT | 一次搜索没有任何 GPU 活动迹象的秒数,超过则显卡算作挂起,矿工退出以便重启(退出码 10)。 |
--zero-hashrate-timeout | <SECS> | 300 | FEARMINER_ZERO_HASHRATE_TIMEOUT | 其他显卡在挖矿而某张 GPU 报告零哈希的秒数,超过则矿工退出以便重启(退出码 11);启动后和温控恢复后有 5 分钟宽限期。 |
--no-share-timeout | <SECS> | 1800 | FEARMINER_NO_SHARE_TIMEOUT | 会话连接后,任何设备都没有被接受的份额多少秒后切换到下一个矿池;在下一个矿池上再出现一次则退出以重启(退出码 11)。0 关闭。其他显卡有收获而单独一张没有的,按其预期份额间隔的十倍单独判定,10 到 60 分钟。 |
--hashrate-min | <RATE> | 50% | FEARMINER_HASHRATE_MIN | GPU 十分钟平均算力的下限:参考值的百分比(50%,本次会话见过的最佳十分钟平均,或 --hashrate-reference)或绝对算力(300M、1.2G)。低于它显卡为 Degraded;--hashrate-grace 之后仍低于则退出以重启(退出码 11)。矿机的总和平均用同一下限。0 关闭。 |
--hashrate-max | <RATE> | 0 | FEARMINER_HASHRATE_MAX | GPU 十分钟平均算力的上限,形式相同;超过它则该数字有误并被报告(E314),绝不重启。0 关闭。 |
--hashrate-grace | <SECS> | 300 | FEARMINER_HASHRATE_GRACE | GPU 可以低于 --hashrate-min 多少秒,之后矿工退出以重启;0 永不重启(只有 Degraded 和警报)。 |
--hashrate-reference | <RATE[,RATE...]> | FEARMINER_HASHRATE_REFERENCE | --hashrate-min 和 --hashrate-max 的百分比所参照的基准,H/s(600M):用于所有显卡,或按引擎顺序每卡一个,逗号分隔。未给出时自动学习:本次会话见过的最佳十分钟平均。 | |
--share-famine | <N> | 5 | FEARMINER_SHARE_FAMINE | GPU 可以多少个预期份额间隔(难度除以显卡算力)没有份额,不少于 10 分钟,之后为 Degraded 并重启其搜索;第二次饥荒则退出以重启(退出码 11)。0 关闭。 |
--max-rejects-device | <N> | 5 | FEARMINER_MAX_REJECTS_DEVICE | 矿池可以连续拒绝一张 GPU 多少份额(过期的除外),之后该卡为 Degraded,直到有份额被接受;也包括 CPU 复核在十分钟内可以拒绝的解。0 关闭。 |
--max-rejects | <N> | 15 | FEARMINER_MAX_REJECTS | 矿池可以连续拒绝来自任何设备的多少个份额,之后会话重连;第二次这样的连串则切换到下一个矿池。0 关闭。 |
--max-no-submit-responses | <N> | 10 | FEARMINER_MAX_NO_SUBMIT_RESPONSES | 在 --submit-timeout 内连续未应答多少次提交后会话重连;第二次同样的情况则移到下一个矿池。0 关闭。 |
--device-quarantine | <N> | 3 | FEARMINER_DEVICE_QUARANTINE | --restart-window 内归咎于一张 GPU 的重启次数,达到后它在下次启动时为 Quarantined:其他显卡继续,它被排除在挖矿之外,直到矿工重启。绝不会是最后一个能挖矿的设备。0 关闭。 |
通知
通知 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--notify-url | <URL> | FEARMINER_NOTIFY_URL | 把警报以 JSON 发送到此 URL(POST,格式版本 1);重复或逗号分隔以设置多个。5xx 或网络错误时重试,4xx 时从不重试。 | |
--notify-telegram | <BOT_TOKEN:CHAT_ID> | FEARMINER_NOTIFY_TELEGRAM | 通过机器人把警报发送到 Telegram 聊天:BOT_TOKEN:CHAT_ID,令牌来自 @BotFather。 | |
--notify-discord | <WEBHOOK_URL> | FEARMINER_NOTIFY_DISCORD | 通过 webhook URL 把警报发送到 Discord 频道。 | |
--notify-secret | <SECRET> | FEARMINER_NOTIFY_SECRET | 用此密钥对每个 --notify-url 请求体做 HMAC-SHA256 签名,放在 X-FearMiner-Signature: sha256=<hex> 中。 | |
--notify-min-severity | <LEVEL> | warning | FEARMINER_NOTIFY_MIN_SEVERITY | 发送的最低严重级别:info、warning、error 或 critical。 |
--notify-test | 向每个通知目标和心跳的 /start 发送一条测试消息(rig_up),打印结果,全部送达则退出 0,否则 1。 | |||
--heartbeat-url | <URL> | FEARMINER_HEARTBEAT_URL | 每 60 秒 ping 此 URL(GET;带 --heartbeat-post 时为 POST),启动时另发 URL/start,严重事件时发 URL/fail:即 healthchecks.io 的约定。Uptime Kuma 的 push URL 可直接使用。 | |
--heartbeat-post | false | FEARMINER_HEARTBEAT_POST | 心跳改为带小型 JSON 体的 POST(算力、有效算力、份额、运行时间、重启次数),而不是 GET。 |
超频
超频 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--cclock | <MHZ[,MHZ...]> | FEARMINER_CCLOCK | 核心频率偏移,MHz,带符号(+100、-50),通过驱动应用(NVIDIA,驱动 520 或更新)。用于所有显卡,或按 -d 顺序每卡一个(100,_,-50:_ 跳过那张卡)。设置后回读;驱动拒绝时以其代码拒绝(E703:需要 root,--allow-root)。没有超频选项时,不触碰任何频率、功耗上限或风扇寄存器。 | |
--lock-cclock | <MHZ[,MHZ...]> | FEARMINER_LOCK_CCLOCK | 把核心频率锁定在这么多 MHz(nvidia-smi -lgc);0 解除锁定。用于所有显卡,或按 -d 顺序每卡一个。锁定无法回读,所以退出时重置为驱动默认值。 | |
--mclock | <MHZ[,MHZ...]> | FEARMINER_MCLOCK | 显存频率偏移,MHz,带符号(+800、-500)。一个值用于所有显卡,或按 -d 顺序每卡一个。 | |
--lock-mclock | <MHZ[,MHZ...]> | FEARMINER_LOCK_MCLOCK | 把显存频率锁定在这么多 MHz(nvidia-smi -lmc);必须是显卡公布的档位(405、810、5001、10251...;否则 E701 列出它们)。0 解除锁定。用于所有显卡,或按 -d 顺序每卡一个。 | |
--pl | <W|N%[,...]> | FEARMINER_PL | 功耗上限,瓦(220)或显卡默认上限的百分比(80%),须在显卡公布的范围内(否则 E702 给出最小值和最大值)。用于所有显卡,或按 -d 顺序每卡一个。 | |
--fan | <N%|auto[,...]> | FEARMINER_FAN | 风扇转速百分比(70%),或 auto 把风扇交回驱动的曲线。用于所有显卡,或按 -d 顺序每卡一个。没有风扇控制的卡(笔记本)会拒绝(E704)。 | |
--oc-delay | <SECS> | 0 | FEARMINER_OC_DELAY | 显卡开始挖矿后(第一个被接受的份额,或最多 30 秒)等待多少秒才应用其核心偏移和锁定:针对偏移落在冷卡上就崩溃的矿机。0 在启动时与其余设置一起应用。 |
--no-oc | false | FEARMINER_NO_OC | 忽略所有超频选项和文件中的任何 [oc] 段:不触碰任何频率、功耗上限或风扇寄存器,启动行会说明。用于超频在外部设置的矿机(HiveOS、Afterburner、脚本)。 | |
--oc-reset-on-start | false | FEARMINER_OC_RESET_ON_START | 在应用超频选项之前,把每张选中的卡置为驱动默认值(解除锁定、偏移归 0、默认功耗上限、风扇回到曲线)。 | |
--oc-script | <PATH> | FEARMINER_OC_SCRIPT | 挖矿开始前为每张卡运行一次这个程序,直接运行,从不经过 shell,环境中带 FEARMINER_DEVICE、FEARMINER_PCI_BUS、FEARMINER_UUID 和 FEARMINER_ALGO;最多 30 秒,退出码写入日志(不为 0 时 E707)。 |
命令
命令 #
| 选项 | 取值 | 默认 | FEARMINER_* | 作用 |
|---|---|---|---|---|
--unrestricted-api | <LEVEL> | read | FEARMINER_UNRESTRICTED_API | 运行中的矿工在可逆命令之外接受的命令:read(默认:pause、resume、toggle、retune)、operate(另加 restart、stop)、sensitive(另加钱包、矿池、超频)。超出该级别的命令以 E217 被拒绝,无论令牌是否有效。只守护 API(控制运行中的矿工)。 |
--hook | <EVENT:PATH> | FEARMINER_HOOK | EVENT 发生时运行这个程序,直接运行,从不经过 shell,环境中带 FEARMINER_EVENT 和该事件的上下文;最多 30 秒,退出码写入日志(不为 0 时 E139)。重复或逗号分隔可设置多个。事件:start、exit、crash、pause、resume、pool-switch、share-rejected-high、low-hashrate、temp-high、device-lost。 | |
--watch-config | false | FEARMINER_WATCH_CONFIG | 监视配置文件,变化时重新加载。默认关闭:SIGHUP 和 PUT /api/v1/config 无论如何都能重新加载。未通过校验的值会导致整份新文件被拒绝(E220);生效中的配置保持不变。 | |
--background | false | FEARMINER_BACKGROUND | 不带控制台运行:进程脱离终端,其 shell 关闭后仍继续挖矿。隐含 --no-tui;请同时给出 --log-file 以保留日志。仅限 Unix;Windows 上请以服务方式运行矿工。 | |
--priority | <0-5> | FEARMINER_PRIORITY | 整个进程的调度优先级,0(空闲)到 5(最高),用 --cpu-priority 的刻度,后者只管工作线程。Linux 上高于 2 需要特权;被操作系统拒绝时为 E613,保持普通优先级。 |
命令
命令 #
| 命令 | 作用 |
|---|---|
fearminer explain [CODE] | 解释日志中的错误代码(E302、e302 或 302):原因、影响和处理办法,离线。不带代码则列出全部。 |
fearminer token show | 打印来自其他机器的请求必须携带的 API 令牌;没有时先生成。 |
fearminer token rotate | 换一个新令牌并打印;旧令牌在矿工下次启动时失效。 |
fearminer verify <FILE>... | 用内置的发布密钥离线验证下载。给出 SHA256SUMS(其 .minisig 在旁)或压缩包(其 SHA256SUMS 在旁):检查签名,再检查同一目录中列出的每个文件的 SHA-256,每个文件一行,ok、MISSING 或 MISMATCH。只有签名正确且每个存在的文件都匹配时才以 0 退出。 |
fearminer config example | 打印完整的配置文件,每个键带默认值和注释形式的帮助,处于监控模式(无钱包、无矿池),可重定向到 fearminer.toml 后编辑。 |
fearminer history --from --to --step | 离线打印这台矿机做过什么,取自它自己的历史:不需要矿工在运行。读取 <state dir>/history.bin,按 --step 打印 --from 与 --to 之间的采样,CSV 或 JSON,与 GET /api/v1/history 提供的是同一份数据(查看挖矿历史)。 |
fearminer oc show | 按卡打印:读数(频率、偏移、功耗上限、风扇)、它公布的档位和范围,以及某次运行留在 oc-restore.json 中待恢复的内容。-d 缩小卡的范围,与运行时相同。 |
fearminer oc reset [--defaults] | 恢复某次运行记录在 oc-restore.json 中而自己没有恢复的内容(未经清理就被杀死的运行):每卡一行,说明恢复了什么以及之后的读数。--defaults 则改为把选中的卡重置为驱动默认值。-d 缩小卡的范围。 |
fearminer cockpit | 显示本机上已在运行的矿工的驾驶舱:与前台运行相同的全屏面板,每秒从该矿工的 API 读取一次。不会启动矿工;q 或 Ctrl+C 只关闭视图。stdout 不是终端时,打印矿工的日志行,并每 10 秒打印一次文本摘要。没有矿工应答时退出码为 2(E822)。别名:watch。 |
fearminer service <COMMAND> | 把矿工作为服务运行,随机器启动,崩溃后重启:install、status、logs、stop、start、restart、update、rollback、uninstall(update 和 rollback 仅限 Linux;服务)。 |
fearminer enroll [CODE] | 加入给出代码的驾驶舱的矿场;--status 显示所属矿场,--leave 立即让矿机退出。挖矿均不受影响(从驾驶舱管理矿机)。 |
fearminer remote <COMMAND> | 本机的远程通道:off、on、status、cancel(从驾驶舱管理矿机)。 |
fearminer telemetry show | 打印运行中的矿工会发送的定期上报,不发送任何东西;运行时的选项跟在命令之后。若还没有安装 ID 就生成一个(使用 --no-telemetry 时绝不生成);只有运行中才能测量的内容按启动时的样子显示。--json 只打印 JSON。 |
fearminer telemetry rotate-id | 为遥测生成一个新的随机安装 ID:从矿工下次启动起,本机被计为一个新安装。 |
fearminer gui | 打开窗口:选择算法、矿池、钱包和显卡,启动和停止矿工,查看它的显卡、份额和日志。与双击打开的是同一个窗口;设置写入同一个 fearminer.toml。 |
开关在文件或环境中取 true 或 false(FEARMINER_NO_TUI=1)。列表选项(url、user、pass、tls_fingerprint、tls_spki、hook)接受一个字符串或字符串数组。没有变量的选项是一次性动作,不能从环境设置。