Giter Site home page Giter Site logo

filecoin's Introduction

Filecoin资源分享

CoinSummer实验室Filecoin资源分享。

常用链接

节点操作

查看节点信息

# 查看本节点所监听的地址:
lotus net listen
# 查看连接的节点列表:
lotus net peers

手动连接其它节点(命令中的地址为示例地址)

lotus net connect /ip4/47.240.110.221/tcp/44845/p2p/12D3KooWRgxLL84TSkYSjhvhCy5ZNSuJZZzHWp2FXDY7ufqGBmUW

当启动 daemon 后无法正常同步链上的数据,可以试试在启动 daemon 的时候禁用自动连接 peers (即:加上 --bootstrap=false 参数),然后手动连接到一个正常节点,例如:

lotus daemon --bootstrap=false
lotus net connect /ip4/47.240.110.221/tcp/44845/p2p/12D3KooWRgxLL84TSkYSjhvhCy5ZNSuJZZzHWp2FXDY7ufqGBmUW

上述的节点是示例节点,当您在使用该命令的时候,您需要自己去找一个可以使用的节点。

手动设置链的高度

# 设置高度到9700
lotus chain sethead --epoch=9700

编译参数

v25 版本代码的编译命令:

env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean all

特别是针对 AMD 处理器,使用该命令自己编译出来的代码更适合自己的机器。

启用内存最大化参数:

export FIL_PROOFS_MAXIMIZE_CACHING=1

该参数仅针对Testnet3的 32GB 扇区有效。

启用 Log 日志:

export RUST_LOG=Debug

运行 miner 之前加入该参数可以在 miner 的日志中查看更详细的输出信息(底层 rust 代码的输出信息),Log 登记从低到高分别有: Trace、Debug、Info、Warn、Error,Trace 输出的信息最详细,Error 输出的信息最少,仅输入错误信息。

修改proof文件路径

export FIL_PROOFS_PARAMETER_CACHE=/path/to/proof_params/v25/

Storage miner操作

查看扇区状态

# 列举所有扇区信息:
lotus-storage-miner sectors list
# 查看某个扇区的历史状态
lotus-storage-miner sectors status --log <SectorID>

手动修改扇区状态

lotus-storage-miner sectors update-state --really-do-it <SectorID> <NewSectorStatus>
# 例如:手动修改扇区 1 的状态为 FaultedFinal 状态
lotus-storage-miner sectors update-state --really-do-it 1 FaultedFinal

更改默认存储路径

export LOTUS_STORAGE_PATH="/path/to/.lotusstorage"
  • 默认存储路径是~/.lotusstorage,可通过指定LOTUS_STORAGE_PATH环境变量来更改;
  • 每个存储路径下都会有sectorstore.json配置文件,该文件可以配置该存储路径的用途,比如,是否可以用来存储密封过程中生成的临时文件"CanSeal": true, 是否可以用来存储密封好的数据"CanStore": true,以及该路径的权重"Weight": 10和一唯一标识符:ID
{
  "ID": "e59facdc-6a82-418f-a25e-4cbd9165b5de",
  "Weight": 10,
  "CanSeal": true,
  "CanStore": true
}

增加存储路径

# 设置数据存储路径,该路径用来存储最终密封好的数据
# 执行该命令可能需要一点时间等待
lotus-storage-miner storage attach --store --init /path/to/persistent_storage

# 设置密封扇区的存储路径,密封完成之后该路径下的数据会被自动清空,相当于临时目录
# 执行该命令可能需要一点时间等待
lotus-storage-miner storage attach --seal --init /path/to/fast_cache

以上两个命令都是在启动了 miner 之后才可以执行,是一种动态添加存储路径的方式,非常灵活。 当然还可以在命令中添加权重 --weight=10,默认权重是 10。 执行该命令后,可通过以下命令查看存储列表:

lotus-storage-miner storage list

赎回已获得的奖励(Testnet3 才需要手动赎回)

lotus-storage-miner rewards redeem
lotus-storage-miner rewards list

赎回之后,可能需要过一段时间才能看到自己钱包的余额增加。

v26 版本参数中使用GPU计算Precommit2的方法

运行 miner 之前导出已下环境变量(目前官方还未放出v26参数):

export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1

参考

Worker操作

Testnet3 查看 Worker 信息

lotus-storage-miner workers list

Testnet3 启动 worker

lotus-seal-worker run --address=192.168.1.201:2333 --precommit1=false --precommit2=true --commit=true

启动worker需要注意以下几点:

  • 要给 worker 指定本机地址和一个随机端口(四位数以上);
  • precommit1precommit2commit默认是启用的,如果想要禁用,可以设置为 false,例如: --precommit1=false;
  • commit 参数是配置 commit2 的,commit1 无法在 Worker 中启用。

常见问题(待续)

  • Testnet/3 的Actual Power,Byte Power 是什么?
  • lotus sync status时的base和target代表什么?
  • lotus sync时的worker是如何工作的?

持续更新中,有问题请在Issues中反馈...

参考文档

filecoin's People

Contributors

maxvint avatar newmai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.