From 90d30a834740413eec8576ded930576d28b81990 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 27 Jul 2023 16:34:41 +0800 Subject: [PATCH] fix: link and error --- README.md | 42 ++++++++-------- {posts/aleo => aleo}/.gitkeep | 0 {posts/aleo => aleo}/how-testnet3-start.md | 0 .../ansible-deploy-tool-usage.md | 0 {posts/filecoin => filecoin}/auto-pledge.md | 0 .../daemon-deployment.md | 0 .../filecoin => filecoin}/daemon-operation.md | 0 .../filecoin => filecoin}/datacap-process.md | 0 .../deals-configuration.md | 0 .../distributed-miner-configuration.md | 0 .../environment-usage.md | 0 .../hardware-configuration.md | 0 .../lotus-datacap-application.md | 0 .../lotus-mining-process.md | 0 .../filecoin => filecoin}/lotus-multisig.md | 0 .../lotus-ops-checklist.md | 0 {posts/filecoin => filecoin}/lotus-upgrade.md | 0 {posts/filecoin => filecoin}/miner-keep.md | 0 .../mining-cluster-deployment.md | 0 .../monitoring-deployment.md | 0 .../myscheduler-configuration.md | 0 .../new-miner-checklist.md | 0 {posts/filecoin => filecoin}/questions.md | 0 {posts/filecoin => filecoin}/raid + xfs .md | 0 .../sector-life-cycle.md | 0 {posts/filecoin => filecoin}/snap-deals.md | 0 .../filecoin => filecoin}/storage-manage.md | 0 .../wallet-management.md | 0 .../phala => phala}/cluster-architecture.md | 0 {posts/phala => phala}/cluster-deployment.md | 0 {posts/phala => phala}/phala-ops.md | 0 {posts/phala => phala}/problem.md | 0 .../cluster-mining-tutorial.md | 48 ++++++++++++++----- 33 files changed, 56 insertions(+), 34 deletions(-) rename {posts/aleo => aleo}/.gitkeep (100%) rename {posts/aleo => aleo}/how-testnet3-start.md (100%) rename {posts/filecoin => filecoin}/ansible-deploy-tool-usage.md (100%) rename {posts/filecoin => filecoin}/auto-pledge.md (100%) rename {posts/filecoin => filecoin}/daemon-deployment.md (100%) rename {posts/filecoin => filecoin}/daemon-operation.md (100%) rename {posts/filecoin => filecoin}/datacap-process.md (100%) rename {posts/filecoin => filecoin}/deals-configuration.md (100%) rename {posts/filecoin => filecoin}/distributed-miner-configuration.md (100%) rename {posts/filecoin => filecoin}/environment-usage.md (100%) rename {posts/filecoin => filecoin}/hardware-configuration.md (100%) rename {posts/filecoin => filecoin}/lotus-datacap-application.md (100%) rename {posts/filecoin => filecoin}/lotus-mining-process.md (100%) rename {posts/filecoin => filecoin}/lotus-multisig.md (100%) rename {posts/filecoin => filecoin}/lotus-ops-checklist.md (100%) rename {posts/filecoin => filecoin}/lotus-upgrade.md (100%) rename {posts/filecoin => filecoin}/miner-keep.md (100%) rename {posts/filecoin => filecoin}/mining-cluster-deployment.md (100%) rename {posts/filecoin => filecoin}/monitoring-deployment.md (100%) rename {posts/filecoin => filecoin}/myscheduler-configuration.md (100%) rename {posts/filecoin => filecoin}/new-miner-checklist.md (100%) rename {posts/filecoin => filecoin}/questions.md (100%) rename {posts/filecoin => filecoin}/raid + xfs .md (100%) rename {posts/filecoin => filecoin}/sector-life-cycle.md (100%) rename {posts/filecoin => filecoin}/snap-deals.md (100%) rename {posts/filecoin => filecoin}/storage-manage.md (100%) rename {posts/filecoin => filecoin}/wallet-management.md (100%) rename {posts/phala => phala}/cluster-architecture.md (100%) rename {posts/phala => phala}/cluster-deployment.md (100%) rename {posts/phala => phala}/phala-ops.md (100%) rename {posts/phala => phala}/problem.md (100%) rename {posts/spacemesh => spacemesh}/cluster-mining-tutorial.md (81%) diff --git a/README.md b/README.md index 520fd05..15d9880 100644 --- a/README.md +++ b/README.md @@ -11,29 +11,29 @@ MinerDAO是面向中文社区的挖矿技术交流学习组织,我们尝试以 ## 技术文章 #### Spacemesh -- [SpaceMesh 集群P盘教程](./posts/spacemesh/cluster-mining-tutorial.md) - 如何使用postcli搭建集群P盘的详细教程 +- [SpaceMesh 集群P盘教程](./spacemesh/cluster-mining-tutorial.md) - 如何使用postcli搭建集群P盘的详细教程 #### Filecoin -- [Filecoin封装流程详解](./posts/filecoin/lotus-mining-process.md) -- [Filecoin挖矿硬件推荐配置](./posts/filecoin/hardware-configuration.md) -- [扇区生命周期详解,扇区状态管理](./posts/filecoin/sector-life-cycle.md) -- [Filecoin节点搭建及启动](./posts/filecoin/daemon-deployment.md) -- [节点管理,节点常用操作,节点同步常见问题](./posts/filecoin/daemon-operation.md) -- [钱包管理及使用场景](./posts/filecoin/wallet-management.md) -- [Lotus-ops部署运维工具使用说明](./posts/filecoin/ansible-deploy-tool-usage.md) -- [Filecoin同构集群搭建流程](./posts/filecoin/mining-cluster-deployment.md) -- [Filecoin存储管理,存储i/o性能分析,网络分析](./posts/filecoin/storage-manage.md) -- [新矿工节点上线CheckList](./posts/filecoin/new-miner-checklist.md) -- [Filecoin监控报警系统搭建](./posts/filecoin/monitoring-deployment.md) -- [Filecoin 订单配置](./posts/filecoin/deals-configuration.md) -- [分布式Miner模块配置和使用](./posts/filecoin/distributed-miner-configuration.md) -- [如何避免掉算力](./posts/filecoin/miner-keep.md) -- [Lotus日常运维CheckList](./posts/filecoin/lotus-ops-checklist.md) -- [常用环境变量说明](./posts/filecoin/environment-usage.md) -- [自动Pledge脚本使用说明](./posts/filecoin/auto-pledge.md) -- [常见运维问题定位与解决](./posts/filecoin/questions.md#1-顽固扇区如何删除) - 顽固扇区如何删除, Worker掉线如何处理 -- [Filecoin Datacap申请](./posts/filecoin/lotus-datacap-application.md) - Datacap如何申请及注意事项 -- [Snap Deals操作详解](./posts/filecoin/snap-deals.md) - Snap Deals操作流程及遇到的问题 +- [Filecoin封装流程详解](./filecoin/lotus-mining-process.md) +- [Filecoin挖矿硬件推荐配置](./filecoin/hardware-configuration.md) +- [扇区生命周期详解,扇区状态管理](./filecoin/sector-life-cycle.md) +- [Filecoin节点搭建及启动](./filecoin/daemon-deployment.md) +- [节点管理,节点常用操作,节点同步常见问题](./filecoin/daemon-operation.md) +- [钱包管理及使用场景](./filecoin/wallet-management.md) +- [Lotus-ops部署运维工具使用说明](./filecoin/ansible-deploy-tool-usage.md) +- [Filecoin同构集群搭建流程](./filecoin/mining-cluster-deployment.md) +- [Filecoin存储管理,存储i/o性能分析,网络分析](./filecoin/storage-manage.md) +- [新矿工节点上线CheckList](./filecoin/new-miner-checklist.md) +- [Filecoin监控报警系统搭建](./filecoin/monitoring-deployment.md) +- [Filecoin 订单配置](./filecoin/deals-configuration.md) +- [分布式Miner模块配置和使用](./filecoin/distributed-miner-configuration.md) +- [如何避免掉算力](./filecoin/miner-keep.md) +- [Lotus日常运维CheckList](./filecoin/lotus-ops-checklist.md) +- [常用环境变量说明](./filecoin/environment-usage.md) +- [自动Pledge脚本使用说明](./filecoin/auto-pledge.md) +- [常见运维问题定位与解决](./filecoin/questions.md#1-顽固扇区如何删除) - 顽固扇区如何删除, Worker掉线如何处理 +- [Filecoin Datacap申请](./filecoin/lotus-datacap-application.md) - Datacap如何申请及注意事项 +- [Snap Deals操作详解](./filecoin/snap-deals.md) - Snap Deals操作流程及遇到的问题 - Filecoin 订单市场操作详解 - 分离订单市场、离线订单 [TODO] - FVM合约开发及部署 [TODO] diff --git a/posts/aleo/.gitkeep b/aleo/.gitkeep similarity index 100% rename from posts/aleo/.gitkeep rename to aleo/.gitkeep diff --git a/posts/aleo/how-testnet3-start.md b/aleo/how-testnet3-start.md similarity index 100% rename from posts/aleo/how-testnet3-start.md rename to aleo/how-testnet3-start.md diff --git a/posts/filecoin/ansible-deploy-tool-usage.md b/filecoin/ansible-deploy-tool-usage.md similarity index 100% rename from posts/filecoin/ansible-deploy-tool-usage.md rename to filecoin/ansible-deploy-tool-usage.md diff --git a/posts/filecoin/auto-pledge.md b/filecoin/auto-pledge.md similarity index 100% rename from posts/filecoin/auto-pledge.md rename to filecoin/auto-pledge.md diff --git a/posts/filecoin/daemon-deployment.md b/filecoin/daemon-deployment.md similarity index 100% rename from posts/filecoin/daemon-deployment.md rename to filecoin/daemon-deployment.md diff --git a/posts/filecoin/daemon-operation.md b/filecoin/daemon-operation.md similarity index 100% rename from posts/filecoin/daemon-operation.md rename to filecoin/daemon-operation.md diff --git a/posts/filecoin/datacap-process.md b/filecoin/datacap-process.md similarity index 100% rename from posts/filecoin/datacap-process.md rename to filecoin/datacap-process.md diff --git a/posts/filecoin/deals-configuration.md b/filecoin/deals-configuration.md similarity index 100% rename from posts/filecoin/deals-configuration.md rename to filecoin/deals-configuration.md diff --git a/posts/filecoin/distributed-miner-configuration.md b/filecoin/distributed-miner-configuration.md similarity index 100% rename from posts/filecoin/distributed-miner-configuration.md rename to filecoin/distributed-miner-configuration.md diff --git a/posts/filecoin/environment-usage.md b/filecoin/environment-usage.md similarity index 100% rename from posts/filecoin/environment-usage.md rename to filecoin/environment-usage.md diff --git a/posts/filecoin/hardware-configuration.md b/filecoin/hardware-configuration.md similarity index 100% rename from posts/filecoin/hardware-configuration.md rename to filecoin/hardware-configuration.md diff --git a/posts/filecoin/lotus-datacap-application.md b/filecoin/lotus-datacap-application.md similarity index 100% rename from posts/filecoin/lotus-datacap-application.md rename to filecoin/lotus-datacap-application.md diff --git a/posts/filecoin/lotus-mining-process.md b/filecoin/lotus-mining-process.md similarity index 100% rename from posts/filecoin/lotus-mining-process.md rename to filecoin/lotus-mining-process.md diff --git a/posts/filecoin/lotus-multisig.md b/filecoin/lotus-multisig.md similarity index 100% rename from posts/filecoin/lotus-multisig.md rename to filecoin/lotus-multisig.md diff --git a/posts/filecoin/lotus-ops-checklist.md b/filecoin/lotus-ops-checklist.md similarity index 100% rename from posts/filecoin/lotus-ops-checklist.md rename to filecoin/lotus-ops-checklist.md diff --git a/posts/filecoin/lotus-upgrade.md b/filecoin/lotus-upgrade.md similarity index 100% rename from posts/filecoin/lotus-upgrade.md rename to filecoin/lotus-upgrade.md diff --git a/posts/filecoin/miner-keep.md b/filecoin/miner-keep.md similarity index 100% rename from posts/filecoin/miner-keep.md rename to filecoin/miner-keep.md diff --git a/posts/filecoin/mining-cluster-deployment.md b/filecoin/mining-cluster-deployment.md similarity index 100% rename from posts/filecoin/mining-cluster-deployment.md rename to filecoin/mining-cluster-deployment.md diff --git a/posts/filecoin/monitoring-deployment.md b/filecoin/monitoring-deployment.md similarity index 100% rename from posts/filecoin/monitoring-deployment.md rename to filecoin/monitoring-deployment.md diff --git a/posts/filecoin/myscheduler-configuration.md b/filecoin/myscheduler-configuration.md similarity index 100% rename from posts/filecoin/myscheduler-configuration.md rename to filecoin/myscheduler-configuration.md diff --git a/posts/filecoin/new-miner-checklist.md b/filecoin/new-miner-checklist.md similarity index 100% rename from posts/filecoin/new-miner-checklist.md rename to filecoin/new-miner-checklist.md diff --git a/posts/filecoin/questions.md b/filecoin/questions.md similarity index 100% rename from posts/filecoin/questions.md rename to filecoin/questions.md diff --git a/posts/filecoin/raid + xfs .md b/filecoin/raid + xfs .md similarity index 100% rename from posts/filecoin/raid + xfs .md rename to filecoin/raid + xfs .md diff --git a/posts/filecoin/sector-life-cycle.md b/filecoin/sector-life-cycle.md similarity index 100% rename from posts/filecoin/sector-life-cycle.md rename to filecoin/sector-life-cycle.md diff --git a/posts/filecoin/snap-deals.md b/filecoin/snap-deals.md similarity index 100% rename from posts/filecoin/snap-deals.md rename to filecoin/snap-deals.md diff --git a/posts/filecoin/storage-manage.md b/filecoin/storage-manage.md similarity index 100% rename from posts/filecoin/storage-manage.md rename to filecoin/storage-manage.md diff --git a/posts/filecoin/wallet-management.md b/filecoin/wallet-management.md similarity index 100% rename from posts/filecoin/wallet-management.md rename to filecoin/wallet-management.md diff --git a/posts/phala/cluster-architecture.md b/phala/cluster-architecture.md similarity index 100% rename from posts/phala/cluster-architecture.md rename to phala/cluster-architecture.md diff --git a/posts/phala/cluster-deployment.md b/phala/cluster-deployment.md similarity index 100% rename from posts/phala/cluster-deployment.md rename to phala/cluster-deployment.md diff --git a/posts/phala/phala-ops.md b/phala/phala-ops.md similarity index 100% rename from posts/phala/phala-ops.md rename to phala/phala-ops.md diff --git a/posts/phala/problem.md b/phala/problem.md similarity index 100% rename from posts/phala/problem.md rename to phala/problem.md diff --git a/posts/spacemesh/cluster-mining-tutorial.md b/spacemesh/cluster-mining-tutorial.md similarity index 81% rename from posts/spacemesh/cluster-mining-tutorial.md rename to spacemesh/cluster-mining-tutorial.md index 3563a7a..2496a5e 100644 --- a/posts/spacemesh/cluster-mining-tutorial.md +++ b/spacemesh/cluster-mining-tutorial.md @@ -37,7 +37,15 @@ make build smcli也可以直接去官方下载编译好的:https://github.com/spacemeshos/smcli/releases。 ## 2 集群P盘流程 -这里主要分享多机器集群P盘的详细操作。简单来说,先初始化,然后用postcli算好需要P盘的文件数,然后计算index,再分配到集群的多台机器开始P盘,最终全部P完后,再合并到一起,然后由`go-spacemesh`来扫盘并生成证明。 +这里主要分享多机器集群P盘的详细操作流程,主要包括以下步骤: + +- 使用`smcli`创建钱包并备份助记词和钱包密码; +- 使用编译好的go-spacemesh进行初始化; +- 使用postcli的 `-printNumFiles` 计算生成的`.bin`文件数量; +- 计算分段索引,将文件分段并分发给多台机器; +- 按照计算好的分段索引在每台机器上启动P盘; +- 等所有机器P盘完成后,将生成的文件合并到运行go-spacemesh的机器上; +- 重新启动go-spacemesh,开始扫盘并生成证明。 ### 2.1 创建钱包 使用上面编译好的smcli来创建钱包,注意要备份好助记词和钱包密码。 @@ -46,7 +54,7 @@ smcli也可以直接去官方下载编译好的:https://github.com/spacemeshos ``` 钱包创建完毕后,会输出到一个`/path/to/wallet_2023-07-21T07-17-52.946Z.json`文件中。 -下一步执行导入钱包,并输入创建时的密码,就能看到钱包地址(格式为:sm1xxxxxxxxx)。 +下一步执行导入钱包,并输入创建时的密码,就能看到刚才创建的钱包地址(格式为:sm1xxxxxxxxx)。 ```shell ./smcli wallet read /path/to/wallet_2023-07-21T07-17-52.946Z.json ``` @@ -54,7 +62,7 @@ smcli也可以直接去官方下载编译好的:https://github.com/spacemeshos ### 2.2 初始化 先用编译好的`go-spacemesh`初始化: ```shell -./go-spacemesh --config config.mainnet.json --smeshing-coinbase sm1xxxxxxx --smeshing-opts-numunits 5 --smeshing-opts-datadir /mnt/spacemesh/post_data --data-folder ~/md0/spacemesh/node_data +./go-spacemesh --config config.mainnet.json --smeshing-coinbase sm1xxxxxxx --smeshing-opts-numunits 5 --smeshing-opts-datadir /mnt/spacemesh/post_data --data-folder /mnt/spacemesh/node_data ``` 该命令会启动一个Spacemesh节点,并同时启动P盘,参数说明: - `--config`: 节点配置文件,通过`wget https://smapp.spacemesh.network/config.mainnet.json`获取; @@ -94,26 +102,34 @@ SpaceMesh是以`numUnits`为基本的存储单元,每个`numUnits = 64GB`,P Subset是把要P的文件分段并分发给多台机器来跑,通过`-fromFile`,`-toFile`来设置开始及结束的文件索引。 -例如,上面的`-numUnits=5`总共需要生成40个.bin文件,如果平均分配到4台机器上,则每台机器的启动命令分别为: +例如,上面的`-numUnits=5`总共需要生成80个.bin文件,如果平分给4台机器,则每台机器的`-fromFile`和`-toFile`分别为: +机器| -fromFile | - toFile +------|-------:|------: +机器1 | 0 | 19 +机器2 | 20 | 39 +机器3 | 40 | 59 +机器4 | 60 | 79 + +启动命令分别为: - 机器1 (0 - 19) ```shell -./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=0 -toFile=19 -datadir=/mnt/spacemesh/data +./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=0 -toFile=19 -datadir=/mnt/spacemesh/post_data ``` - 机器2 (20 - 39) ```shell -./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=20 -toFile=39 -datadir=/mnt/spacemesh/data +./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=20 -toFile=39 -datadir=/mnt/spacemesh/post_data ``` - 机器3 (40 - 59) ```shell -./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=40 -toFile=59 -datadir=/mnt/spacemesh/data +./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=40 -toFile=59 -datadir=/mnt/spacemesh/post_data ``` - 机器4 (60 - 79) ```shell -./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=60 -toFile=79 -datadir=/mnt/spacemesh/data +./postcli -provider=0 -commitmentAtxId=9eebff023abb17ccb775c602daade8ed708f0a50d3149a42801184f5b74f2865 -id=[hex_decoded_id] -numUnits=5 -fromFile=60 -toFile=79 -datadir=/mnt/spacemesh/post_data ``` ### 2.5 启动P盘 @@ -129,7 +145,11 @@ Subset是把要P的文件分段并分发给多台机器来跑,通过`-fromFile - `-datadir` P盘完成后的文件保存目录。 ### 2.6 合并P盘文件 -等所有subset的机器P盘完成后,需要将每台机器上生成的文件,合并到运行`go-spacemesh`服务机器的`--smeshing-opts-datadir`路径下,然后重新启动`go-spacemesh`就可以开始扫盘并生成证明了。如果文件完整,就会输出类似下面的日志: +等所有subset的机器P盘完成后,需要将每台机器上生成的文件,合并到运行`go-spacemesh`服务机器的`--smeshing-opts-datadir`路径下,然后重新启动`go-spacemesh`就可以开始扫盘并生成证明了。 + +**注意**`.bin`文件合并后,需要在每个运行postcli机器的`postdata_metadata.json`文件里,找到一个全局最小的nonce,作为`go-spacemesh`的`--smeshing-opts-datadir`路径下`postdata_metadata.json`的nonce (有的postcli进程可能找不到nonce)。 + +启动后如果文件完整,扫码文件时会输出类似下面的日志: ```shell 2023-07-23T15:57:24.849+0800 INFO fb26a.post initialization: file already initialized {"node_id": "fb26a9d2da5626ded24027da14054bf0fbf8886bd7ec4a29d05ee2fdd44edddd", "module": "post", "fileIndex": 0, "currentNumLabels": 268435456, "targetNumLabels": 268435456, "startPosition": 0} @@ -137,7 +157,7 @@ Subset是把要P的文件分段并分发给多台机器来跑,通过`-fromFile ... ``` -### 2.7 扫盘及提交证明 +### 2.7 扫盘并提交证明 文件扫描完毕后,开始读取文件并生成证明,生成证明开始的日志类似: ```shell 2023-07-23T15:57:59.995+0800 INFO fb26a.post calculating proof of work for nonces 0..144 @@ -146,11 +166,13 @@ Subset是把要P的文件分段并分发给多台机器来跑,通过`-fromFile 扫盘持续时间根据机器配置和磁盘速率而定,可通过每隔5秒钟输出磁盘I/O: `iostat -dmt /dev/md0 5` -据我个人的测试观察,整个扫盘并生成证明的过程,在刚开始会有10-20分钟的准备时间(20T数据),然后开始有磁盘I/O。 +据我个人测试观察,整个扫盘并生成证明的过程,在刚开始会有10-20分钟的准备时间(20T数据),然后开始有磁盘I/O。 + +**扫盘时间 = (总容量 / 磁盘读速率) + 30分钟的准备时间** -可以根据自己的磁盘速率,估算扫盘及生成证明的时间。 +可根据自己的磁盘速率,估算扫盘及生成证明的时间。 -比如磁盘读写为2G/s,那么20T数据的扫盘+证明时间大致为:`(20 * 1024) / 2 /3600`约为2.8小时,加上准备时间,大约为3个小时。 +比如磁盘读写为2G/s,那么20T数据的扫盘+证明时间大致为:`(20 * 1024) / 2 /3600`约为2.8小时,加上准备时间,大约3小时。 扫盘完成后,会输出类似下面的日志: ```shell