小贴士和技巧
附加提示
欢迎来到附加提示部分!无论您是经验丰富的Farmer,还是刚刚开始使用 Autonomys Network,这些提示和技巧都旨在提升您的体验和效率。在这里,我们将深入探讨一些实用建议和鲜为人知的技术,帮助您优化农场设置,并轻松应对常见挑战。从环境配置到后台进程管理,这些见解专为确保您的 Farmer 运行顺畅、高效而设计。让我们一同探索,如何充分发挥 Autonomys Network Farmer 的潜力。
从 Autonomys 的旧版本/不同版本切换到新快照
除非开发团队特别说明,否则在新版本发布时,您 不需要 清除您的配置。
通常,您应该能够下载最新版本,并使用与启动前一个版本相同的命令重 新启动 Node 和 Farmer,并且不会出现任何错误。
在某些情况下,版本更新会导致您的 Node 和Farmer 出现问题,通常是在发生错误时,您可能必须清除Node。如果您有任何问题,您可以随时查看我们的 论坛 并跳转到我们的 Discord 服务器寻求帮助。
清空
如果您在此之前一直在运行一个node节点,并且想要切换到新的网络,请执行以下步骤,然后再次按照指南操作:
<PATH_TO_FARM>: Path to your farm directory<BASE_PATH>: Path to your node data directory
./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2026-11-25 wipe <PATH_TO_FARM>
./subspace-node-ubuntu-x86_64-skylake-mainnet-2026-11-25 wipe <BASE_PATH>
现在从头开始按照安装指南进行操作。
使用多个磁盘
为了最大限度地提高存储能力,您可以直接使用多个磁盘。这通常比依赖 RAID 配置更有效:
<REWARD_ADDRESS>: Your wallet address for farming rewards
./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2026-11-25 farm --reward-address "<REWARD_ADDRESS>" \
path="/media/ssd1,size=4TiB" \
path="/media/ssd2,size=8TiB"
优化DSN同步
DSN 可能是一个复杂微妙的话题,为了更好地理解我们的分散式存储网络,请参阅我们学院的本指南。
--out-peers
--in-peers
--dsn-target-connections
--dsn-pending-in-connections
--dsn-in-connections
推荐参数:
默认参数的设置考虑了常见消费级调制解调器/路由器的功能。调整某些参数可以通过增加并行度来增强 DSN 同步性能。但是,如果您决定大幅增加这些参数,请确保您的调制解调器/路由器的性能足以处理增加的流量。 Node:
--dsn-out-connections
--dsn-pending-out-connections
Farmer: 增加Farmer参数的值可以提高绘图速度。
--out-connections
--pending-out-connections
帮助
Node 和 farmer 都有各种选项和参数。要查看完整列表,请将 --help 选项附加到 node 或 farmer 命令。
关于 Node、Farmer 和 Docker 的一些额外提示
- Farmer
- Node
- Docker
绘图并发(仅CPU)
在绘图过程中,数据表生成既有并行部分,也有顺序部分。通过同时生成多个数据表,我们可以将顺序部分与并行部分重叠,从而提高 CPU 利用率。虽然为所有记录生成数据表需要大量 RAM,但一次只为少数记录生成数据表可以在 CPU 和 RAM 使用率之间实现最佳平衡。
我们添加了 --cpu-record-encoding-concurrency 选项来覆盖默认行为,该行为每两个核心分配一条记录,但并行不超过八个。根据我们对 P 核、E 核和 P+E 核组合的内部测试,此设置似乎可以实现最佳性能。
如果您更喜欢使用以前的行为,或者您的 RAM 使用率过高,您可以将 --cpu-record-encoding-concurrency 设置为 1。您也可以尝试将其设置为 2、3 等,这可能会产生更好的结果,具体取决于您的特定 CPU/RAM 配置。
创建不存在的农场
A farmer has the option to specify whether the system should automatically create missing farms upon startup. If you provide a path to a farm that isn't found, the system will generate a new one. However, this may not be desirable if a drive fails to mount properly.
By default, this option is set to true, but you can override it by adding --create false. Setting this flag to false after establishing your farms can prevent unintentional file writes to the wrong drive.
记录块读取模式
Upon startup, each farm will benchmark the performance to identify the most efficient proving method, yielding either ConcurrentChunks or WholeSector results. If you already know the optimal method for your setup, you can specify it as an argument for each farm to save time benchmarking.
<PATH_TO_FARM>: Directory where you want to store the farm<FARM_SIZE>: Amount of space allocated for farming (e.g. 4TiB, 8TiB)<RECORD_CHUNKS_MODE>: EitherConcurrentChunksorWholeSector
For example, you can include record-chunks-mode= after defining the path and size, assigning the desired value, e.g., path=<PATH_TO_FARM>,size=<FARM_SIZE>,record-chunks-mode=<RECORD_CHUNKS_MODE>. If you do not provide this parameter, the system will benchmark each disk on startup to identify the most efficient method.
对 Farmer 进行基准测试
基准测试可以帮助您测试farmer针对不同版本的 Autonomys Network 的绘图速度。
./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2026-11-25 benchmark audit <PATH_TO_FARM>
Replace <PATH_TO_FARM> with the actual path to your farm.
This will provide you with metrics and insights regarding plotting performance.
目前,Autonomys Node 支持“rayon”实现机制,该机制可以根据farming线程数多次打开文件,并且每个线程使用专用的文件句柄。
结果解读:通常,您会评估吞吐量来确定任意数量磁盘的最大可审计大小。CPU 和磁盘性能都会影响此指标。
要了解有关审计基准测试的更多信息, [请阅读此论坛帖子.
还有第二个可用的命令,它可以帮助您确定farmer 在审核后有多少时间来提供证明。
./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2026-11-25 benchmark prove <PATH_TO_FARM>
Each farmer has ~4 seconds to audit and prove, so depending on how fast auditing is, the remaining time will be used for proving. Proving performance doesn't depend on the farm size.
如果计算环境中没有足够的时间进行证明步骤,farmer 就会记录如下消息:
Proving for solution skipped due to farming time limit slot=6723846 sector_index=46
要了解有关证明基准测试的更多信息,请阅读此论坛帖子(https://forum.autonomys.xyz/t/audit-benchmark-result-explanation-please/2150)
清除你的Farmer
In certain situations, especially when the farmer terminates unexpectedly or encounters an error, it might fail to restart correctly. The scrub command assists in resolving such issues by cleaning or resetting the specified farm.
./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2026-11-25 scrub <PATH_TO_FARM>
Replace <PATH_TO_FARM> with your actual farm path.
Use this command cautiously as it modifies the farm state to recover from errors.
指定绘图/重新绘图的具体CPU 核心数(仅限CPU)
此选项将覆盖 Autonomys农民 可能使用的任何自定义逻辑。
您可以通过添加 --cpu-plotting-cores 来指定绘图 CPU 核心,后跟所需的核心参数。核心应以逗号分隔的值列出,并使用空格分隔不同的线程池或编码实例。
例如,--cpu-plotting-cores 0,1 2,3 将导致同时编码两个扇区,每个扇区使用一对 CPU 核心。
同样,您可以使用“--cpu-replotting-cores”自定义重新绘制 CPU 核心,后面跟着与上面的“--cpu-plotting-cores”示例中使用的参数类似的参数。