├── CommomLinkForFilecoin.txt └── README.md /CommomLinkForFilecoin.txt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 请看 [Readme.md](../Readme.md) 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 一、常用链接: 3 | 4 | 5 | ## 0.0. CoinSummer 整理的常用命令和链接 6 | 7 | https://github.com/CoinSummer/filecoin 8 | 9 | ## 0.1. 同步数据每日备份 10 | 11 | 来源于 **CoinSummer**: 12 | 13 | https://filecoin.coinsummer.io/datastore.html 14 | 15 | 16 | ## 1. lotus安装文档: 17 | https://docs.lotu.sh/en+install-lotus-ubuntu 18 | 19 | ## 2. GOPROXY(编译时使用): 20 | export GOPROXY=https://goproxy.io 21 | 或者 22 | export GOPROXY=https://goproxy.cn 23 | 24 | ## 3. 区块浏览器: 25 | https://stats.testnet.filecoin.io/ 【按ESC可以选择看Testnet3的数据】 26 | https://filscout.io/en/ 【星际联盟团队开发,可切换Testnet2和Testnet3】 27 | https://filscan.io/#/ 28 | http://testnet3.1475ipfs.com:10300/d/z6FtI92Zz/testnet3?orgId=1&refresh=25s 【1475团队开发, 仅Testnet3】 29 | 30 | ## 4. 区块同步数据备份(目前是Testnet2的同步数据): 31 | https://lotus-archives.textile.io/ 32 | 33 | ## 5. 官方博客: 34 | https://filecoin.io/blog/ 35 | 36 | ## 6. Lotus Specification 说明文档: 37 | https://filecoin-project.github.io/specs/ 38 | 39 | ## 7. Slack: 40 | https://filecoinproject.slack.com/ 41 | 42 | ## 8. Lotus 代码下载: 43 | Lotus: https://github.com/filecoin-project/lotus 44 | Go-filecoin: https://github.com/filecoin-project/go-filecoin 45 | Rust-fil-proof: https://github.com/filecoin-project/rust-fil-proofs 46 | 47 | ## 9. testnet/3 使用文档: 48 | 49 | 在Github项目中的Testnet/3分支下: 50 | 51 | https://github.com/filecoin-project/lotus/blob/testnet/3/documentation/en/join-testnet.md 52 | 53 | 搭建Testnet/3的本地测试网: 54 | 55 | https://github.com/filecoin-project/lotus/blob/testnet/3/documentation/en/local-dev-net.md 56 | 57 | ## 10. 水龙头地址: 58 | Testnet2(旧版): https://faucet.testnet.filecoin.io/ 59 | Testnet3(新版): http://t01000.miner.interopnet.kittyhawk.wtf 60 | 61 | ## 11. Benchmark数据共享: 62 | Testnet2(V20): https://github.com/filecoin-project/lotus/issues/839 63 | Testnet3(V24): https://github.com/filecoin-project/lotus/issues/1475 64 | Testnet3(V25): https://filecoin-benchmarks.on.fleek.co/ 65 | 66 | ## 12. 甘特图: 67 | https://app.instagantt.com/shared/s/1152992274307505/latest 68 | 69 | ## 13 Proof 证明文件下载: 70 | JDCloud(v20): https://s3.cn-south-1.jdcloud-oss.com/proof-parameters/filecoin-proof-parameters-v20.tar.gz 71 | JDCloud(v25): env IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ 72 | CoinSummer(中国专用/ v24和v25): https://filecoin-proofs.coinsummer.io/ 73 | CoinSummer(v25 URL): https://filecoin-proofs.coinsummer.io/v25.txt 74 | 最新版发布地址(最快更新 Proof 参数的地方【官方】): https://proofs.filecoin.io/ 75 | 76 | ### A. 使用方法一: 77 | 78 | 直接导出环境变量,然后再运行 miner init 的时候,或者启动 miner 的时候都会自动从这个 JDCloud 中下载: 79 | ```Shell 80 | export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ 81 | ``` 82 | 83 | ### B. 使用方法二: 84 | 85 | 下载 https://filecoin-proofs.coinsummer.io/v25.txt 中的url地址,保存这些 URL 地址到一个文件中(比如,保存到 url.txt 文件中),然后使用 wget 工具下载,命令如下: 86 | ```Shell 87 | wget -c -t 0 -i url.txt 88 | ``` 89 | 90 | **【注意】** v25 版本的参数命名方式比较特别,在 Windows 上下载的时候会出现问题,因为 Windows 上不支持这种命名方式,如果在 Windows 上下载证明参数,然后再拷贝到 Linux 中,则需要自己手动重命名每个文件名。 91 | 92 | [参考](https://filecoinproject.slack.com/archives/CPFTWMY7N/p1587615402405300) 93 | 94 | ## 14 rust 和 rustup 的安装环境配置(Cargo): 95 | 96 | 当你不正确的安装 rust 环境,此时 lotus 编译的时候会找不到你的 cargo,你会看到如下的错误: 97 | 98 | ```Shell 99 | Error: cargo is not installed. 100 | ``` 101 | 102 | 此时,你就需要卸载以前的安装版本(如果安装有的话),比如,使用sudo方式安装的版本等: 103 | 104 | ```Shell 105 | # 尝试执行以下命令 106 | sudo /usr/local/lib/rustlib/uninstall.sh 107 | sudo apt remove cargo 108 | ``` 109 | 110 | 然后使用官方推荐的方式安装 Cargo (注意不要使用 sudo 安装): 111 | 112 | ```Shell 113 | # 方法一: 114 | curl https://sh.rustup.rs -sSf | sh 115 | 116 | # 方法二: 117 | wget https://sh.rustup.rs -O ./cargo_install_script.sh # 下载安装脚本 118 | chmod +x ./cargo_install_script.sh # 添加可执行权限 119 | ./cargo_install_script.sh # 安装,不要用 sudo 120 | ``` 121 | 122 | **参考链接:** 123 | 124 | [【官方文档】](https://www.rust-lang.org/tools/install) 125 | 126 | [【社区文档】](https://learnku.com/docs/rust-lang/2018/ch01-01-installation/4494) 127 | 128 | [【免翻墙版】](https://www.cnblogs.com/honyer/p/11877145.html) 129 | 130 | ## 15. Lotus 可执行文件备份 131 | 132 | 地址: https://github.com/NewMai/lotus_bin 133 | 134 | 下载: 135 | ```Shell 136 | git clone https://github.com/NewMai/lotus_bin.git 137 | ``` 138 | ## 16. 使用 GPU 算 Precommit2 139 | 140 | https://github.com/filecoin-project/neptune 141 | 142 | [【相关链接】](https://filecoinproject.slack.com/archives/CEGB67XJ8/p1587776730458900) 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | # 二、常用命令: 155 | 156 | ## 1. v25 版本代码的编译命令: 157 | 158 | ```Shell 159 | env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean all 160 | ``` 161 | 特别是针对 AMD 处理器,使用该命令自己编译出来的代码更适合自己的机器。 162 | 163 | ## 2. 启用内存最大化参数: 164 | 165 | ```Shell 166 | export FIL_PROOFS_MAXIMIZE_CACHING=1 167 | ``` 168 | 该参数仅针对测试网3的 32 GB 扇区有效。 169 | 170 | ## 3. 启用 Log 日志: 171 | 172 | ```Shell 173 | export RUST_LOG=Debug 174 | ``` 175 | 运行 miner 之前加入该参数可以在 miner 的日志中查看更详细的输出信息(底层 rust 代码的输出信息),Log 登记从低到高分别有: **`Trace`**、**`Debug`**、**`Info`**、**`Warn`**、**`Error`**,**`Trace`** 输出的信息最详细,**`Error`** 输出的信息最少,仅输入错误信息。 176 | 177 | ## 4. 手动设置链的高度(比如设置成 3800): 178 | 179 | ```Shell 180 | lotus chain sethead --epoch 3800 181 | ``` 182 | 183 | ## 5. Testnet3 设置存储路径: 184 | 185 | ```Shell 186 | # 设置密封扇区的存储路径,密封完成之后该路径下的数据会被自动清空,相当于临时目录 187 | # 执行该命令可能需要一点时间等待 188 | lotus-storage-miner storage attach --seal --init /path/to/fast_cache 189 | 190 | # 设置数据存储路径,该路径用来存储最终密封好的数据 191 | # 执行该命令可能需要一点时间等待 192 | lotus-storage-miner storage attach --store --init /path/to/persistent_storage 193 | ``` 194 | 195 | 以上两个命令都是在启动了 miner 之后才可以执行,是一种动态添加存储路径的方式,非常灵活。 196 | 当然还可以在命令中添加权重 `--weight=10`,默认权重是 10。 197 | 198 | 默认存储路径是: ~/.lotusstorage ,每个存储路径下都会有个 sectorstore.json 配置文件, 199 | 该文件可以配置该存储路径的用途,比如,是否可以用来存储密封过程中生成的临时文件("CanSeal": true,), 200 | 是否可以用来存储密封好的数据("CanStore": true),以及该路径的权重("Weight": 10)和一唯一标识符:ID。 201 | 202 | ```Json 203 | user@user:~/.lotusstorage$ cat sectorstore.json 204 | { 205 | "ID": "508165ac-5103-45b4-9bb9-a95f5973776e", 206 | "Weight": 10, 207 | "CanSeal": true, 208 | "CanStore": true 209 | } 210 | ``` 211 | 212 | ## 6. Testnet3 查看 Worker 信息 213 | 214 | ```Shell 215 | lotus-storage-miner workers list 216 | ``` 217 | 218 | ## 7. Testnet3 启动 worker: 219 | 220 | ```Shell 221 | lotus-seal-worker run --address=192.168.1.201:2333 --precommit1=false --precommit2=true --commit=true 222 | ``` 223 | 要给 worker 指定**本机地址**和一个**随机端口(四位数以上)**,`precommit1`、`precommit2` 和`commit` 是默认启动,如果想要禁用,可以设置为 `false`,例如:`--precommit1=false`。 224 | 最后,`commit` 参数是配置 `commit2` 的,而 `commit1` 是无法在 Worker 中启用的。 225 | 226 | 227 | ## 8. 查看本节点与连接其它节点 228 | 229 | ```Shell 230 | # 查看本节点所监听的地址: 231 | lotus net listen 232 | # 连接其它节点的地址(命令中的地址为示例地址): 233 | lotus net connect /ip4/47.240.110.221/tcp/44845/p2p/12D3KooWRgxLL84TSkYSjhvhCy5ZNSuJZZzHWp2FXDY7ufqGBmUW 234 | ``` 235 | 当启动 daemon 之后无法正常同步链上的数据,可以试试在启动 daemon 的时候禁用自动连接 peers (即:加上 `--bootstrap=false` 参数),然后手动连接到一个正常节点,例如: 236 | ```Shell 237 | lotus daemon --bootstrap=false 238 | lotus net connect /ip4/47.240.110.221/tcp/44845/p2p/12D3KooWRgxLL84TSkYSjhvhCy5ZNSuJZZzHWp2FXDY7ufqGBmUW 239 | ``` 240 | 上述的节点是示例节点,当您在使用该命令的时候,您需要自己去找一个可以使用的节点。 241 | 242 | ## 9. 赎回已获得的奖励(Testnet3 才需要手动赎回) 243 | 244 | ```Shell 245 | lotus-storage-miner rewards redeem 246 | lotus-storage-miner rewards list 247 | ``` 248 | 赎回之后,可能需要过一段时间才能看到自己钱包的余额增加。 249 | 250 | ## 10. 手动修改扇区状态 251 | 252 | ```Shell 253 | lotus-storage-miner sectors update-state --really-do-it 254 | # 例如:手动修改扇区 1 的状态到 Unsealed 状态 255 | ./lotus-storage-miner sectors update-state --really-do-it 1 Unsealed 256 | ``` 257 | ## 11. 查看扇区的历史状态 258 | 259 | ```Shell 260 | # 列举所有扇区信息: 261 | lotus-storage-miner sectors list 262 | # 查看某个扇区的历史状态 263 | lotus-storage-miner sectors status --log 264 | ``` 265 | 266 | ## 12. 未完 267 | 268 | ```Shell 269 | lotus sync status 270 | ``` 271 | 272 | 273 | 【**注**】以上内容仅为个人整理,如有侵权或不当的地方,请及时指出,我会及时修改! 274 | 275 | --------------------------------------------------------------------------------