sudo apt update sudo apt install -y mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl sudo apt upgrade -y
install Go from https://golang.org/doc/install
install Rust from https://www.rust-lang.org/tools/install
export BELLMAN_CPU_UTILIZATION=0.875 export FIL_PROOFS_MAXIMIZE_CACHING=1 export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1 export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
sudo fallocate -l 256G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
swapon --show
append the following line to /etc/fstab (ensure pri is set larger than the current highest level priority) and then reboot
sudo reboot
swapon --show
sudo rm -rf ~/lotus ~/.lotus ~/.lotusminer /usr/local/bin/lotus*
(optional) remove proof parameters (these files are very large and will take a long time to redownload)
sudo rm -rf /var/tmp/filecoin-proof-parameters
cd ~ && git clone https://github.com/filecoin-project/lotus.git && cd lotus git reset --hard && git fetch --all && git checkout ntwk-calibration
set environment variables to build from source (without these lotus will still run but sealing will take considerably longer)
export RUSTFLAGS="-C target-cpu=native -g" export RUST_LOG=info export FFI_BUILD_FROM_SOURCE=1
make all && sudo make install
see https://filscan.io/ for graphs, maps, and the current status of the network and miners
ulimit -n ulimit -n 10000000
lotus daemon > ~/lotus.log 2>&1 &
wait for the chain to sync (this can take minutes, hours or even days depending on the height of the chain)
lotus sync wait
lotus net peers | wc -l
update Libp2p ListenAddresses and Libp2p AnnounceAddresses in ~/.lotus/config.toml to the following:
lotus daemon stop nohup lotus daemon > ~/lotus.log 2>&1 &
T3_ADDRESS=$(lotus wallet new bls) && echo $T3_ADDRESS
assign funds to the t3 address using https://faucet.calibration.fildev.network
see https://filecoin.io/blog/welcome-to-space-race/#participating-in-space-race for conditions on using the faucet
initialize the miner (this will download and verify the ~108GB v28 proof parameters to /var/tmp/filecoin-proof-parameters)
lotus-miner init --no-local-storage --owner=$T3_ADDRESS --sector-size=32GiB
update Libp2p ListenAddresses and Libp2p AnnounceAddresses in ~/.lotusminer/config.toml to the following:
start lotus-miner in the background, wait until it is ready (this can take a few minutes), and print the wallet balance
nohup lotus-miner run > ~/lotus-miner.log 2>&1 & watch -n 5 lotus-miner info lotus wallet balance $T3_ADDRESS
PUBLIC_IP=$(curl ifconfig.me) && echo $PUBLIC_IP ping $PUBLIC_IP telnet $PUBLIC_IP 24001 telnet $PUBLIC_IP 24002 lotus net reachability
use https://www.yougetsignal.com/tools/open-ports/ to check ports 24001 and 24002 are open
LISTEN_ADDRESS=$(lotus-miner net listen) && echo $LISTEN_ADDRESS lotus-miner actor set-addrs $LISTEN_ADDRESS
set MaxSealingSectors in ~/.lotusminer/config.toml to the number of concurrent seal workers you want to run
set storage locations for sealing storage (e.g., a fast SSD) and long term storage (e.g., a slow HDD)
lotus-miner storage attach --init --seal <PATH_FOR_SEALING_STORAGE> lotus-miner storage attach --init --store <PATH_FOR_LONG_TERM_STORAGE> lotus-miner storage list
check that the funds for sending the set-addrs message have been deducted from your wallet (this may take about 30 seconds)
watch -n 5 lotus wallet balance $T3_ADDRESS
pledge storage by packing random data to demonstrate capability of storing data without having to wait for deals
lotus-miner sectors pledge
lotus-miner sealing jobs
lotus-miner sealing workers
wait for the sector to be created and show "0: PreCommit1 sSet: NO active: NO tktH: 0 seedH: 0 deals: [0]" (this will take a few minutes)
watch -n 5 lotus-miner sectors list
wait for the sector to be sealed and show "0: Proving sSet: YES active: YES tktH: xxxx seedH: yyyy deals: [0]" (this will take several hours)
lotus-miner sectors status --log 0
after sealing is complete, mark the pledged sector for upgrade so it can start accepting deals (including those from the bot)
lotus-miner sectors mark-for-upgrade 0
if more than 24 hours has passed consider calling mark-for-upgrade again, doing so will have no adverse effects
sudo apt install htop htop
in a separate terminal watch the lotusminer log for entries of the form "INFO storage_proofs_porep::stacked::vanilla::proof > generating layer"
watch tail -n 24 ~/lotus-miner.log
watch -n 5 lotus-miner sectors status --log --on-chain-info 0
the following log entries are what I observed my machine (Ryzen 9 3900X @ 3.8GHz, RTX 2080 Super, 128GB DDR4 RAM @ 3000MHz)
0. 2020-08-20 22:40:47 +0000 UTC: [event;sealing.SectorStartCC] {"User":{"ID":0,"SectorType":3,"Pieces":[{"Piece":{"Size":34359738368,"PieceCID":{"/":"ba..."}},"DealInfo":null}]}}
4. 2020-08-21 06:31:48 +0000 UTC: [event;sealing.SectorPreCommit1] {"User":{"PreCommit1Out":"ey...","TicketValue":"H3...","TicketEpoch":2234}}
5. 2020-08-21 07:04:18 +0000 UTC: [event;sealing.SectorPreCommit2] {"User":{"Sealed":{"/":"ba..."},"Unsealed":{"/":"ba..."}}}
6. 2020-08-21 07:04:18 +0000 UTC: [event;sealing.SectorPreCommitted] {"User":{"Message":{"/":"ba..."},"PreCommitDeposit":"1761729940027002722","PreCommitInfo":{"SealProof":3,"SectorNumber":0,"SealedCID":{"/":"ba..."},"SealRandEpoch":2234,"DealIDs":[],"Expiration":1557523,"ReplaceCapacity":false,"ReplaceSectorDeadline":0,"ReplaceSectorPartition":0,"ReplaceSectorNumber":0}}}
8. 2020-08-21 08:22:30 +0000 UTC: [event;sealing.SectorSeedReady] {"User":{"SeedValue":"di...","SeedEpoch":3915}}
9. 2020-08-21 10:06:56 +0000 UTC: [event;sealing.SectorCommitted] {"User":{"Message":{"/":"ba..."},"Proof":"md..."}}
lotus-miner proving info lotus-miner proving deadlines lotus-miner proving faults
1. hot storage: store two copies of the data with one sealed copy being used for generating storage proofs and the other original copy for fast retrieval
2. cold storage: only store the sealed copy and require it to be unsealed first (a computational and time intensive task)
T0_ADDRESS=$(lotus-miner info | head -n 1 | cut -c 8-) && echo $T0_ADDRESS lotus state miner-info $T0_ADDRESS
create a new t1 address, add funds to it from the t3 address, and wait for the transaction to complete (this will take about a minute)
T1_ADDRESS=$(lotus wallet new) && echo $T1_ADDRESS lotus send $T1_ADDRESS 20 watch -n 5 lotus wallet balance $T1_ADDRESS
echo -e "Filecoin is a decentralized storage market - think of it like Airbnb for cloud storage - where anybody with extra hard drive space can sell it on the network.\n- Juan Benet" > ~/test_file_original.txt lotus client import ~/test_file_original.txt DATA_CID=
lotus client find $DATA_CID
lotus client query-ask
watch -n 5 lotus-miner sectors list
lotus-miner sectors seal <SECTOR_ID>
lotus client retrieve $DATA_CID ~/test_file_retrieved.txt
watch -n 5 lotus-miner retrieval-deals list
cat ~/test_file_retrieved.txt
lotus-miner info lotus-miner actor withdraw
ExpectedSealDuration (defaults to 12h0m0s) should be set according to how quickly you can seal a sector
only deals starting after this delay will be accepted, at which point you must start providing proofs
WaitDealsDelay (defaults to 1h0m0s) is the delay between accepting the first deal and starting the sealing process
Filter is a shell command that decides which deals to accept (on returning exit code 0) or reject (any other exit code)
only accept deals from specific addresses (during Space Race, consider setting these to the addresses of the bots to avoid malicious actors sending spam deals):
tail -f ~/lotus.log watch tail -n 24 ~/lotus-miner.log grep -n error ~/lotus-miner.log
lotus wallet import ~/<TX_ADDRESS>.keyinfo lotus wallet export <TX_ADDRESS> > ~/<TX_ADDRESS>.keyinfo
lotus daemon --import-chain --halt-after-import ~/filecoin_chain.car lotus chain export ~/filecoin_chain.car