代码拉取完成,页面将自动刷新
同步操作将从 karry_ii/filecoin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#########################################################################
# File Name: start_miner.sh
# Author: tears
# mail: tears@tears.com
# Created Time: 2020年03月13日 星期五 20时08分07秒
#########################################################################
#!/bin/bash
lotus_path="/home/tears/filecoin/official/lotus"
sector_size="2KiB" # Default sector size
# Colorefull print
function green_print()
{
local text=$@
echo ""
echo -e "\033[1m\033[32m[$text]\033[0m" # 绿色加粗, 并复原
# echo ""
}
function blue_print()
{
local text=$@
# echo ""
echo -e "\033[1m\033[36m[$text]\033[0m" # 蓝色加粗, 并复原
# echo ""
}
function blue_print2()
{
local text=$@
# echo ""
echo -e "\033[36m[$text]\033[0m" # 蓝色, 并复原
# echo ""
}
green_print "Importing the genesis miner key..."
sleep 2s
${lotus_path}/lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
blue_print "Importing the genesis miner key finished!"
echo -e "\n"
# This step just needed in testnet/3 and later
green_print "Setting default wallet..."
sleep 2s
wallet_addr=$(${lotus_path}/lotus wallet list | grep 't3' | awk '{print $1}')
blue_print2 "Wallet address is: ${wallet_addr}"
${lotus_path}/lotus wallet set-default ${wallet_addr}
blue_print "Setting default wallet finished!"
echo -e "\n"
# Optional
# export IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
export RUST_LOG=Trace
green_print "Initializing storage miner..."
sleep 5s
${lotus_path}/lotus-miner init --genesis-miner --actor=t01000 --sector-size=${sector_size} --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
blue_print "Initializing storage miner finished!"
echo -e "\n"
green_print "Starting storage miner..."
sleep 5s
t=$(date +%Y_%m_%d_%H_%M)
screen -L -S miner -t miner_$t ${lotus_path}/lotus-miner run --nosync
blue_print "Starting storage miner finished!"
echo -e "\n"
green_print "Showing wallet balance..."
sleep 2s
wallet_balance=$(${lotus_path}/lotus wallet balance)
blue_print2 "Wallet balance is : ${wallet_balance}"
blue_print "Showing wallet balance finished!"
echo -e ""
green_print "Showing storage miner info..."
sleep 2s
${lotus_path}/lotus-miner info
blue_print "Showing storage miner info finished!"
echo -e ""
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。