当前位置:网站首页>lotus-local-net 2k v1.17.0-rc4
lotus-local-net 2k v1.17.0-rc4
2022-07-31 10:55:00 【mixboot】
系列文章目录
lotus
前言
Local network
一、依赖
- Ubuntu
# cat /etc/issue
Ubuntu 18.04.6 LTS \n \l
apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y
- rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
# rustc --version
rustc 1.62.1 (e092d0b6b 2022-07-16)
- go
wget https://studygolang.com/dl/golang/go1.18.4.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile && source ~/.profile
# go version
go version go1.18.4 linux/amd64
二、源码编译
1.清理环境
rm -rf $LOTUS_PATH
rm -rf $LOTUS_MINER_PATH
rm -rf ~/.lotus/
rm -rf ~/.lotusminer/
rm -rf ~/.genesis-sectors/
rm -rf ~/devgen.car
rm -rf ~/localnet.json
2.环境变量
.bashrc
# lotus 2k
export LOTUS_PATH=/2k/lotus-local-net
export LOTUS_MINER_PATH=/2k/lotus-miner-local-net
export LOTUS_SKIP_GENESIS_CHECK=_yes_
export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
export CGO_CFLAGS="-D__BLST_PORTABLE__"
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
3.源码编译
git clone https://github.com/filecoin-project/lotus lotus-local-net
# cd lotus-local-net/
# git checkout v1.17.0-rc4
# git show
commit fd1207c5c73213b496b12da0860c1e55d69465e2 (HEAD, tag: v1.17.0-rc4, origin/release/v1.17.0)
make clean 2k
make install
# lotus --version
lotus version 1.17.0-rc4+2k+git.fd1207c5c
三、创世
- 2k 复制证明参数
lotus fetch-params 2048
- 预封装2个扇区
lotus-seed pre-seal --sector-size 2KiB --num-sectors 2
- 生成创世块
lotus-seed genesis new localnet.json
- 生成钱包地址
lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
- 启动创世节点lotus daemon
lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false
- 导入创世矿工密钥
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
- 初始化创世旷工
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
报错
ERROR main lotus-miner/init.go:264 Failed to initialize lotus-miner: failed to configure miner:
main.storageMinerInit
/root/lotus-local-net/cmd/lotus-miner/init.go:506
- GasEstimateMessageGas error: estimating gas used: CallWithGas failed: failed to set up vm: Serialization error for Cbor protocol: RequireLength {
name: "tuple", expect: 1, value: 0 }
- 清理环境,切换到
lotus-local-net目录
# cd lotus-local-net/
./lotus fetch-params 2048
./lotus-seed pre-seal --sector-size 2KiB --num-sectors 2
./lotus-seed genesis new localnet.json
./lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false
./lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
./lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
./lotus-miner run --nosync
# lotus-miner info
Enabled subsystems (from miner API): [Mining Sealing SectorStorage Markets]
Enabled subsystems (from markets API): [Mining Sealing SectorStorage Markets]
Chain: [sync ok] [basefee 100 aFIL]
Miner: t01000 (2 KiB sectors)
Power: 40 Ki / 40 Ki (100.0000%)
Raw: 4 KiB / 4 KiB (100.0000%)
Committed: 4 KiB
Proving: 4 KiB
Projected average block win rate: 20024.16/week (every 30s)
Projected block win with 99.9% probability every 41s
(projections DO NOT account for future network and miner growth)
Miner Balance: 4315.656 FIL
PreCommit: 0
Pledge: 2 aFIL
Vesting: 3236.742 FIL
Available: 1078.914 FIL
Market Balance: 0
Locked: 0
Available: 0
Worker Balance: 50000000 FIL
Total Spendable: 50001078.914 FIL
Sectors:
Total: 2
Proving: 2
Workers: Seal(1) WdPoSt(0) WinPoSt(0)
Storage Deals: 0, 0 B
Retrieval Deals (complete): 0, 0 B
1.后台运行
nohup lotus daemon --genesis=/root/lotus-local-net/devgen.car --profile=bootstrapper >> /var/log/2k/daemon.log 2>&1 &
nohup lotus-miner run --nosync >> /var/log/2k/miner.log 2>&1 &
四、第二个节点
参考
边栏推荐
猜你喜欢
随机推荐
Many mock tools, this time I chose the right one
The principle of v-model
【LeetCode】36.有效的数独
unity computeshader的可读写buffer
医院管理系统数据库,课程设计,SQLserver,纯代码设计
SQL study notes - REGEXP operator
内网渗透学习(四)域横向移动——SMB和WMI服务利用
nodeJs--url模块
Experience innovation and iteration through the development of a lucky draw applet
顺序表的删除
初识二叉搜索树
矩形脉冲波形的占空比及脉冲和瞬态特征的测量
sql力扣刷题八
csdn file export to pdf
【LeetCode】203.移除链表元素
众多mock工具,这一次我选对了
Sql优化总结!详细!(2021最新面试必问)
【LeetCode】Day108-和为 K 的子数组
Three ways of single sign-on
金鱼哥RHCA回忆录:CL210管理OPENSTACK网络--开放虚拟网络(OVN)简介(课后练习)








