lotus v0.4.0 testnet 測試

1,二進制安裝包下載

1.1 下載源碼編譯

  1. 設置環境變量 vim /root/.bashrc
# lotus
export LOTUS_PATH=/storage/lotuswork/lotus
export LOTUS_STORAGE_PATH=/storage/lotuswork/lotusstorage
export WORKER_PATH=/storage/lotuswork/lotusworker
export TMPDIR=/storage/lotuswork/tmpdir

#parameters
export FIL_PROOFS_PARAMETER_CACHE=/storage/filecoin-proof-parameters-v27
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/

export RUST_LOG=info
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_MAXIMIZE_CACHING=1
  1. 下載源碼編譯
  • 終端代理 (使用troj),設置環境變量
# export ALL_PROXY=socks5://127.0.0.1:1080
# git config --global http.proxy 'socks5://127.0.0.1:1080'
# export GO111MODULE=on
# export GOPROXY=https://goproxy.cn
  • 下載源碼使用master分支
git clone https://github.com/filecoin-project/lotus.git
  • 編譯
  • lotus版本
# cd lotus/
# git show
commit ffa7be86fe6ee738ab4b095469029b9fac51e090 (HEAD -> master, tag: v0.4.0, origin/master, origin/HEAD)
Merge: b99b8f55 c41c210c
Author: Łukasz Magiera <[email protected]>
Date:   Fri Jun 19 01:29:01 2020 +0200

    Merge pull request #2070 from filecoin-project/feat/reset-genesis

    New Genesis
  • amd CPU 編譯
env RUSTFLAGS="-C target-cpu=native -g" FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1  FFI_BUILD_FROM_SOURCE=1 make clean all bench
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.ffa7be86" -o lotus ./cmd/lotus
go: downloading github.com/filecoin-project/sector-storage v0.0.0-20200618073200-d9de9b7cb4b4
go: downloading github.com/filecoin-project/specs-actors v0.6.2-0.20200617175406-de392ca14121
go: downloading github.com/filecoin-project/storage-fsm v0.0.0-20200617183754-4380106d3e94
+go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build
rm -f lotus-storage-miner
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.ffa7be86" -o lotus-storage-miner ./cmd/lotus-storage-miner
go run github.com/GeertJohan/go.rice/rice append --exec lotus-storage-miner -i ./build
rm -f lotus-seal-worker
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.ffa7be86" -o lotus-seal-worker ./cmd/lotus-seal-worker
go run github.com/GeertJohan/go.rice/rice append --exec lotus-seal-worker -i ./build
rm -f bench
go build -o bench ./cmd/lotus-bench
go run github.com/GeertJohan/go.rice/rice append --exec bench -i ./build
  • 安裝
make install
# 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

2,運行lotus守護進程

  • 下載零知識證明參數
lotus fetch-params 32GiB
  • 後臺運行lotus daemon
nohup lotus daemon >> /storage/lotus.log 2>&1 &

2.1 從別的節點拷貝區塊高度數據

  • /storage/lotuswork/lotus/datastore/chain 目錄路徑
tar -zcvf chain-1264.tar.gz chain/
  • 替換chain目錄,刪除chain目錄,解壓chain-1264.tar.gz chain
# rm -rf chain/
# tar -zxvf chain-1264.tar.gz

3,創建錢包

  1. 查看錢包地址
lotus wallet list
  1. 創建錢包
# lotus wallet new bls
t3222

4,創建礦工

4.1 水龍頭創建

4.2 獲取測試幣

lotus send t3222 10
  • 查看錢包餘額
lotus wallet balance
  • 手動創建礦工
lotus-storage-miner init create-worker-key-t3222 --sector-size 32GiB

5,運行礦工

  • 後臺運行礦工
nohup lotus-storage-miner run >> /storage/miner.log 2>&1 &
  • 查看礦工信息
lotus-storage-miner info
  • 存儲隨機數據
lotus-storage-miner sectors pledge
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章