ubuntu 安装 lotus testnet/3
- 1,ubuntu 安装 lotus testnet/3
- 2,运行testnet/3
- 3,创建矿工
- 4,问题
1,ubuntu 安装 lotus testnet/3
- lotus 编译安装 终端代理 (木马)
- git socks5 代理
- 设置环境变量
export LOTUS_STORAGE_PATH=/storage/lotuswork/lotusstorage
export LOTUS_PATH=/storage/lotuswork/lotus
export WORKER_PATH=/storage/lotuswork/lotusworker
export FIL_PROOFS_PARAMETER_CACHE=/storage/filecoin-proof-parameters
export TMPDIR=/storage/lotuswork/tmpdir
# rm -rf lotus
# git clone https://github.com/filecoin-project/lotus.git
# cd lotus/
# git checkout testnet/3
分支 'testnet/3' 设置为跟踪来自 'origin' 的远程分支 'testnet/3'。
切换到一个新分支 'testnet/3'
git clone -b testnet/3 https://github.com/filecoin-project/lotus.git
# make clean all && make install
install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
install -C ./lotus-seal-worker /usr/local/bin/lotus-seal-worker
# lotus --version
lotus version 0.3.0+git6d6a3cee
2,运行testnet/3
nohup lotus daemon >> /storage/lotus.log 2>&1 &
kill -9 $(ps aux | grep "lotus daemon" | grep -v grep | awk '{print $2}')
3,创建矿工
lotus wallet new bls
nohup lotus-storage-miner run >> /storage/miner.log 2>&1 &
3.1,命令
lotus-storage-miner info
lotus-storage-miner sectors pledge
lotus-storage-miner workers list
lotus-storage-miner storage list
lotus-storage-miner sectors list
lotus-storage-miner sectors status 0
lotus-storage-miner sectors status --log 0
lotus net peers
lotus net connect /ip4/192.168.1.149/tcp/46375/p2p/12D3KooWDmAYavDsprGFi7BLNRLQJo2WXVGdTdKrfXmM77MELMXQ
lotus net listen
lotus net id
{12D3KooWA976ju1tT6MFJRhUEdpM2DLyxVEtkCEjNGQgUzQ7wSCW: [/ip4/192.168.40.88/tcp/6000]}
4,问题
4.1,区块链无法同步
2020-03-29T19:42:31.653+0800 INFO chain chain/sync_manager.go:100 sync bootstrap has 1 peers
2020-03-29T19:42:31.653+0800 INFO chain chain/sync_manager.go:283 scheduling incoming tipset sync: [bafy2bzacea6s6efokrj7bi7uzyfxhuniv2vuuh3jdmk2wwrfwan5ipzhzk62w bafy2bzaceb7j6nvpakh3jrfudnczd7ntybnhai3rmm52mliyius6ja4fgugny bafy2bzaceck5hq5gdea7hshvxjjv2wc2ez2msf76ixlqxnxl2btfc4mdozidm]
2020-03-29T19:42:37.540+0800 WARN blocksync blocksync/blocksync_client.go:103 BlockSync request failed for peer 12D3KooWBAzGRP2uYPf27H2FsrMeJjxVDrnoPW46Cu4BxfBwbaYZ: blocksync req failed: i/o deadline reached
2020-03-29T19:42:37.541+0800 ERROR chain chain/sync.go:996 failed to get blocks: GetBlocks failed with all peers:
github.com/filecoin-project/lotus/chain/blocksync.(*BlockSync).GetBlocks
/root/lotus/chain/blocksync/blocksync_client.go:122
- blocksync req failed:
github.com/filecoin-project/lotus/chain/blocksync.(*BlockSync).sendRequestToPeer
/root/lotus/chain/blocksync/blocksync_client.go:261
- i/o deadline reached
github.com/filecoin-project/lotus/chain.(*Syncer).collectHeaders
/root/lotus/chain/sync.go:996
github.com/filecoin-project/lotus/chain.(*Syncer).collectChain
/root/lotus/chain/sync.go:1204
github.com/filecoin-project/lotus/chain.(*Syncer).Sync
/root/lotus/chain/sync.go:413
github.com/filecoin-project/lotus/chain.(*SyncManager).syncWorker
/root/lotus/chain/sync_manager.go:386
2020-03-29T19:42:37.541+0800 ERROR chain chain/sync_manager.go:388 sync error: collectChain failed:
github.com/filecoin-project/lotus/chain.(*Syncer).Sync
/root/lotus/chain/sync.go:419
sync bootstrap has 1 peers
只连接了一个节点
# lotus net peers
{12D3KooWBAzGRP2uYPf27H2FsrMeJjxVDrnoPW46Cu4BxfBwbaYZ: [/ip4/18.237.253.149/tcp/1347]}
# lotus net findpeer 12D3KooWBAzGRP2uYPf27H2FsrMeJjxVDrnoPW46Cu4BxfBwbaYZ
{12D3KooWBAzGRP2uYPf27H2FsrMeJjxVDrnoPW46Cu4BxfBwbaYZ: [/ip4/127.0.0.1/tcp/1347 /dns4/t01000.miner.interopnet.kittyhawk.wtf/tcp/1347 /ip4/18.237.253.149/tcp/1347 /ip4/10.0.1.176/tcp/1347 /ip4/114.114.114.114/tcp/1347]}
lotus daemon
运行之后连接一个已经同步完区块高度的节点
- 查看已经同步完区块高度的节点ID
# lotus net listen
/ip4/127.0.0.1/tcp/46375/p2p/12D3KooWDmAYavDsprGFi7BLNRLQJo2WXVGdTdKrfXmM77MELMXQ
/ip4/192.168.1.149/tcp/46375/p2p/12D3KooWDmAYavDsprGFi7BLNRLQJo2WXVGdTdKrfXmM77MELMXQ
/ip6/::1/tcp/38085/p2p/12D3KooWDmAYavDsprGFi7BLNRLQJo2WXVGdTdKrfXmM77MELMXQ
- 连接节点,该节点不可用,需要连接一个有公网IP的节点
# lotus net connect /ip4/192.168.1.149/tcp/46375/p2p/12D3KooWDmAYavDsprGFi7BLNRLQJo2WXVGdTdKrfXmM77MELMXQ
# lotus sync status
- 快速同步区块高度:拷贝已经同步完区块高度节点区块链数据进行替换
lotus/datastore
替换目录datastore