FileStar v1.2.2 搭建
安装依赖
apt update
apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y
# go version
go version go1.15.7 linux/amd64
# rustc --version
rustc 1.51.0 (2fd73fabe 2021-03-23)
源码编译
git clone https://github.com/filestar-project/lotus.git --recursive
cd lotus/
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make all
使用Releases安装包
- Intel
filestar_v1.2.2_linux-intel64.tar.gz
tar -zxvf filestar_v1.2.2_linux-intel64.tar.gz
- AMD
tar -zxvf filestar_v1.2.2_linux-amd64.tar.gz -C /usr/local/bin/
下载区块高度快照
wget wget https://filestar-proofs.s3.cn-east-1.jdcloud-oss.com/snapshot/filestar.car
lotus daemon
- 设置环境变量
# filestar初始化目录,目录不用创建,初始化时自动创建。seal挂载nvme固态
export LOTUS_PATH=/seal/lotus
export LOTUS_MINER_PATH=/seal/miner
export LOTUS_WORKER_PATH=/seal/worker
# 目录需要手动创建
export TMPDIR=/seal/tmp
export FIL_PROOFS_PARENT_CACHE=/seal/filecoin-parents
# 复制证明
export FIL_PROOFS_PARAMETER_CACHE=/seal/filecoin-proof-parameters-v28
export IPFS_GATEWAY=https://filestar-proofs.s3.cn-east-1.jdcloud-oss.com/ipfs/
# 日志
export RUST_BACKTRACE=full
export RUST_LOG=Info
# 最大化内存参数
export FIL_PROOFS_MAXIMIZE_CACHING=1
# GPU计算,没有GPU可以不用设置
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
#export BELLMAN_CUSTOM_GPU="GeForce RTX 3090:10496"
#export BELLMAN_CPU_UTILIZATION=0
#export FIL_PROOFS_USE_MULTICORE_SDR=1
下载复制证明参数
lotus fetch-params 32GiB
同步区块高度
lotus daemon
重新同步,导入区块快照
lotus daemon --import-snapshot filestar.car
lotus sync wait
lotus sync status
- 重新运行 lotus
nohup lotus daemon >> /var/log/chain/daemon.log 2>&1 &
创建钱包
lotus wallet list
lotus wallet new bls
- 转账完 查看余额
lotus wallet balance
配置远程 lotus daemon
vim /seal/lotus/config.toml
- ListenAddress 修改为本机IP地址
# Default config:
[API]
# ListenAddress = "/ip4/127.0.0.1/tcp/1234/http"
ListenAddress = "/ip4/192.168.1.10/tcp/1234/http"
- 重新运行 lotus daemon
lotus daemon stop
nohup lotus daemon >> /var/log/chain/daemon.log 2>&1 &
cat /seal/lotus/api
- lotus token FULLNODE_API_INFO
lotus auth api-info --perm admin
创建miner
- 环境变量添加 lotus token FULLNODE_API_INFO
# filestar初始化目录,目录不用创建,初始化时自动创建。
export LOTUS_PATH=/cephfs/lotus
export LOTUS_MINER_PATH=/cephfs/miner
export LOTUS_WORKER_PATH=/cephfs/worker
# 目录需要手动创建
export TMPDIR=/seal/tmp
export FIL_PROOFS_PARENT_CACHE=/seal/filecoin-parents
# 复制证明
export FIL_PROOFS_PARAMETER_CACHE=/seal/filecoin-proof-parameters-v28
export IPFS_GATEWAY=https://filestar-proofs.s3.cn-east-1.jdcloud-oss.com/ipfs/
# 日志
export RUST_BACKTRACE=full
export RUST_LOG=Info
# 最大化内存参数
export FIL_PROOFS_MAXIMIZE_CACHING=1
# GPU计算,没有GPU可以不用设置
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
export BELLMAN_CUSTOM_GPU="GeForce RTX 3090:10496"
export BELLMAN_CPU_UTILIZATION=0
#export FIL_PROOFS_USE_MULTICORE_SDR=1
# lotus 远程
export FULLNODE_API_INFO=
- 查看钱包
lotus wallet list
初始化矿工
lotus-miner init --no-local-storage --owner=f3钱包地址 --sector-size=32GiB
运行矿工
nohup lotus-miner run >> /var/log/miner/miner.log 2>&1 &
lotus-miner info
- 设置存储目录
lotus-miner storage attach --init --store /cephfs/store
lotus-miner storage list
修改矿工配置
vim /cephfs/miner/config.toml
[API]
# ListenAddress = "/ip4/127.0.0.1/tcp/2345/http"
ListenAddress = "/ip4/192.168.1.11/tcp/2345/http"
# RemoteListenAddress = "127.0.0.1:2345"
RemoteListenAddress = "192.168.1.11:2345"
[Storage]
ParallelFetchLimit = 200
AllowAddPiece = false
AllowPreCommit1 = false
AllowPreCommit2 = false
AllowCommit = false
AllowUnseal = false
- 重启矿工
- miner API
lotus-miner auth api-info --perm admin
远程矿工
# filestar初始化目录,目录不用创建,初始化时自动创建。seal挂载nvme固态
export LOTUS_PATH=/seal/lotus
export LOTUS_MINER_PATH=/seal/miner
export LOTUS_WORKER_PATH=/seal/worker
# 目录需要手动创建
export TMPDIR=/tmp
export FIL_PROOFS_PARENT_CACHE=/seal/filecoin-parents
# 复制证明目录
export FIL_PROOFS_PARAMETER_CACHE=/seal/filecoin-proof-parameters-v28
export IPFS_GATEWAY=https://filestar-proofs.s3.cn-east-1.jdcloud-oss.com/ipfs/
# 日志
export RUST_BACKTRACE=full
export RUST_LOG=Info
# 最大化内存参数
export FIL_PROOFS_MAXIMIZE_CACHING=1
# GPU计算,没有GPU可以不用设置
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
# GPU
export BELLMAN_CUSTOM_GPU="GeForce RTX 3080:8704"
# 全部使用CPU计算,不使用GPU
#export BELLMAN_NO_GPU=1
#export BELLMAN_VERIFIER=cpu
export BELLMAN_CPU_UTILIZATION=0
# P1优化
export FIL_PROOFS_USE_MULTICORE_SDR=1
# 远程矿工
export MINER_API_INFO=token
参考: