Filecash
Published in

Filecash

How to Mine Filecash (FIC)

This article will teach you how to get started in mining FIC.

1. System Requirements

Filecash supports operation on the Linux system whereas not on Windows. The instruction takes operation on the Ubuntu18.04 system as example.

1.1 Hardware

Filecash currently supports sectors of 4GiB and 16GiB.

  • For 4GiB miners: Single task cache space is 60 GiB, C2 maximum memory occupation is 115 GiB, and display memory not less than 8300 MB
  • For 16GiB miners: Single task cache space is 160 GiB, C2 maximum memory occupation is 85 GiB, and display memory not less than 5120 MB

1.2 Dependency

Filecash is dependent by:

  • go (1.15)
  • gcc (7.4.0 or higher)
  • git (version 2 or higher)
  • bzr (some go dependency needs this)
  • jq
  • pkg-config
  • opencl-icd-loader
  • opencl driver (like nvidia-opencl on arch) (for GPU acceleration)
  • opencl-headers (build)
  • rustup (proofs build)
  • llvm (proofs build)
  • clang (proofs build)
  • hwloc libhwloc-dev

The Ubuntu installation dependent librarys command is:

sudo apt update
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev hwloc libhwloc-dev gcc git bzr jq pkg-config curl hwloc libhwloc-dev -y
sudo apt upgrade -y

The Go environment installation command is:

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-1.15-go -y
export PATH=$PATH:/usr/lib/go-1.15/bin

2 Install

2.1 Installation (Only Ubuntu18.04 system configurable at the moment.)

Please download the compiled binary program at https://github.com/filecash/lotus/releases, then extract and import the file to the /usr/local/bin directory.

2.2 Compile and install

2.2.1 Clone

git clone https://github.com/filecash/lotus_builder

2.2.2 Compile and Install lotus / lotus-miner / lotus-worker

cd lotus_builder/
bash build.sh -a -y
cd lotus/
make install

2.2.3 Compile lotus-checker / lotus-shed

cd lotus_builder/
bash build.sh -a -y
cd lotus/
make lotus-checker lotus-shed

3 Join Filecash Mainnet

3.1 Launch Node

First start the Filecash daemon. let lotus process run in the background and synchronize node data:

nohup lotus daemon > daemon.log 2>&1 &

3.1.1 Snapshot to restore node data

# 1. Backup private key:
lotus wallet export f1xxxxxxxx > f1xxxxxxxx.key
or
lotus wallet export f3xxxxxxxx > f3xxxxxxxx.key
# 2. Close all Lotus programs
# 3. Rename the Lotus directory:
mv ~/.lotus ~/.lotus-bak
# 4. The wget download snapshot file: (at 2 a.m. every day update snapshot file on the same day)
wget https://snapshot.file.cash/fic-snapshot-latest.car
or
wget http://118.123.241.59/fic-snapshot-latest.car
# 5. Import snapshot file:
lotus daemon --import-snapshot fic-snapshot-latest.car

3.1.2 Modify lotus machine “~ /. Lotus”/ config.toml “The IP address of the Listenaddress

[API]
ListenAddress = "/ip4/<lotus IP>/tcp/1234/http"

3.1.3 Restart lotus node

nohup lotus daemon > daemon.log 2>&1 &

3.2 Create Wallet

Create Wallet

lotus wallet new bls

Purchase FIC (Filecash) from exchanges and withdraw them to the applied wallet address:

owner=`lotus wallet list`

3.3 download supporting documents

# automatic download of supporting documents
export FIL_PROOFS_PARAMETER_CACHE=/mnt/proofs
nohup lotus fetch-params 4GiB > fetch-params-4gb.log 2>&1 &
nohup lotus fetch-params 16GiB > fetch-params-16gb.log 2>&1 &

or

export FIL_PROOFS_PARAMETER_CACHE=/mnt/proofs
cd $FIL_PROOFS_PARAMETER_CACHE
# Manually download 4GB supporting documents
wget -c https://proofs.file.cash/ipfs/QmYRGdsr7L3hXWcAQKrkNMMhUXfsfhfxsrBhoez7zbSf2g -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-23807ff142251ff42f38810834724169c8f81ca563d360f1502363f6f8ad580c.params
wget -c https://proofs.file.cash/ipfs/QmeaxZu6ESeiTHH7EWiuqZZ58dLi55FYQYZNVxvrXf51vi -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-23807ff142251ff42f38810834724169c8f81ca563d360f1502363f6f8ad580c.vk
wget -c https://proofs.file.cash/ipfs/QmbBxv2BG3Y3eSYddTNmTFJX77R14KVSrE3vByfE2wZQG1 -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-3be65b9045f13d2c857d62c18a5dcc9a7a83b0ff84e61a91979ba1ba6d1812c7.params
wget -c https://proofs.file.cash/ipfs/QmUJ8WrPWz6ZJAWT5BJkEJeQBii3A4Lj9pMMsGrx8ZGwqx -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-3be65b9045f13d2c857d62c18a5dcc9a7a83b0ff84e61a91979ba1ba6d1812c7.vk
wget -c https://proofs.file.cash/ipfs/QmQqi3Ha3LbKPf1KgTArC3NUTBLWVBwt56f4fFcX1QRduZ -O v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-0-0-sha256_hasher-fcc4520bb35a7a20aa871fbad43e6aa887de9fbe1131c5cb365c47c83601a5b2.params
wget -c https://proofs.file.cash/ipfs/QmVZnh11qqaeGaZ1YVaHgeEjGfCtBTCGRfapb42r5sjHac -O v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-0-0-sha256_hasher-fcc4520bb35a7a20aa871fbad43e6aa887de9fbe1131c5cb365c47c83601a5b2.vk
# Manually download 16GB supporting documents
wget -c https://proofs.file.cash/ipfs/QmeQoWydjK7YBABNaLsQieVetcXBPP86GQCboHbnNrVC7N -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-4-0-14020a794b2c2191f4e7462ed8cb9b86f2a2d719b1d13e6581d80ad981e6b098.params
wget -c https://proofs.file.cash/ipfs/QmeMEntrC1pHHzD9KwXT7z433Nt2EixuhvnpdUF38WULgT -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-4-0-14020a794b2c2191f4e7462ed8cb9b86f2a2d719b1d13e6581d80ad981e6b098.vk
wget -c https://proofs.file.cash/ipfs/QmZSfBBrDhKyo8gjPN83vgzNvTNsnFkW82EDTq957eT2TW -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-4-0-a01cdbef817cac42c9566e38490f0b4d299e2752af52a78b2a9d38b24286d5b4.params
wget -c https://proofs.file.cash/ipfs/QmYuAfcN4VSAJ9ocuqRYkq2wWsGWoZQczeJBejzQEkU1Vi -O v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-4-0-a01cdbef817cac42c9566e38490f0b4d299e2752af52a78b2a9d38b24286d5b4.vk
wget -c https://proofs.file.cash/ipfs/QmaWpJxJ7YcEN3VqG94YwBna3PLAgknbRS9eAoLGTwpHZM -O v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-4-0-sha256_hasher-07c0adb3191b18918d631375516125e2900a1c437745539389cf154ec430c1c2.params
wget -c https://proofs.file.cash/ipfs/QmUjqsiQaZziKxgR86JA7Q1imuHpqbuRjMmq6k5vbv5WDu -O v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-4-0-sha256_hasher-07c0adb3191b18918d631375516125e2900a1c437745539389cf154ec430c1c2.vk

3.4 Register Miner

3.4.1 If lotus and miner are not on the same machine, you need to copy two files,configure fullnode_ API_ Info does not need to be copied.

Copy ~/.lotus/api \ ~/.lotus/token from lotus machine to ~/.lotus/ directory

3.4.2 Creating miner

# 4G-miner:
lotus-miner --miner-repo=~/.lotusminer-4gb init --owner=$owner --sector-size=4GiB

# 16G-miner:
lotus-miner --miner-repo=~/.lotusminer-16gb init --owner=$owner --sector-size=16GiB

Waiting for confirmation on the chain, the creation log will output”Miner successfully created, you can now start it with ‘lotus-miner run’”

4 Start Mining

4.1 Modifying lotus-miner机器 “~/.lotusminer/config.toml” The IP address of the Listenaddress

# 4G-miner: Modifying "~/.lotusminer-4gb/config.toml" The IP address of the Listenaddress 
[API]
ListenAddress = "/ip4/<4G-miner IP>/tcp/2345/http"
# 16G-miner: Modifying "~/.lotusminer-16gb/config.toml" The IP address of the Listenaddress
[API]
ListenAddress = "/ip4/<16G-miner IP>/tcp/2355/http"

4.2 Start miner:

# 4G-miner: 
nohup lotus-miner --miner-repo=~/.lotusminer-4gb run > miner-4gb.log 2>&1 &

# 16G-miner:
nohup lotus-miner --miner-repo=~/.lotusminer-16gb run > miner-16gb.log 2>&1 &

5 Add final storage path

5.1 Final storage path “/opt/miner_store”

# 4G-miner:
lotus-miner --miner-repo=~/.lotusminer-4gb storage attach --store --weight=10 --init /opt/miner_store4
# 16G-miner:
lotus-miner --miner-repo=~/.lotusminer-16gb storage attach --store --weight=10 --init /opt/miner_store16

5.2 modify “~/.lotusminer/sectorstore.json”

# modify "~/.lotusminer/sectorstore.json"
num=`grep -i "\"CanStore\": false" ~/.lotusminer/sectorstore.json |awk '{print length($0)}'`
if [ -z $num ]; then
sed -i "s/\"CanStore\": true/\"CanStore\": false/g" ~/.lotusminer/sectorstore.json
fi

6 Build a mining cluster

6.1 Modify the IP of ListenAddress in “~/.lotus/config.toml”

[API]
ListenAddress = "/ip4/<lotus IP>/tcp/1234/http"

6.2 Modify the IP of ListenAddress in “~/.lotusminer/config.toml”

# 4G-miner: 修改 "~/.lotusminer-4gb/config.toml" 里面ListenAddress的IP
[API]
ListenAddress = "/ip4/<4G-miner IP>/tcp/2345/http"
# 16G-miner: 修改 "~/.lotusminer-16gb/config.toml" 里面ListenAddress的IP
[API]
ListenAddress = "/ip4/<16G-miner IP>/tcp/2355/http"

6.3 If lotus and miner are not on the same machine, you need to copy two files ,configure fullnode_ API_ Info does not need to be copied.

Copy ~/.lotus/api \ ~/.lotus/token from lotus machine to ~/.lotus/ directory

6.3.1 If 4G-worker and 4G-miner are not on the same machine, you need to copy two files ,configure fullnode_ API_ Info does not need to be copied.

Copy ~/.lotusminer-4gb/api ~ /.lotusminer-4gb/token of 4G-miner machine to ~/.lotusminer-4gb/ directory

6.3.2 If 16G-worker and 16G-miner are not on the same machine, you need to copy two files ,configure fullnode_ API_ Info does not need to be copied.

Copy ~/.lotusminer-16gb/api ~ /.lotusminer-16gb/token of 16G-miner machine to ~/.lotusminer-16gb/ directory

6.4 Start lotus-worker with different functions according to actual needs

# 4G-worker: 参考以下命令,根据实际需求追加不同参数,启用4G-worker
nohup lotus-worker --miner-repo=~/.lotusminer-4gb --worker-repo=~/.lotusworker-4gb run --listen=3456 [...] > miner-4gb.log 2>&1 &

# 16G-worker: 参考以下命令,根据实际需求追加不同参数,启用16G-worker
nohup lotus-worker --miner-repo=~/.lotusminer-16gb --worker-repo=~/.lotusworker-16gb run --listen=3466 [...] > miner-16gb.log 2>&1 &
#: lotus-worker run -h
--listen value host address and port the worker api will listen on (default: "0.0.0.0:3456")
--no-local-storage don't use storageminer repo for sector storage (default: false)
--no-swap don't use swap (default: false)
--addpiece enable addpiece (default: true)
--precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true)
--unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (default: true)
--precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true)
--commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true)
--parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5)
--timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m")
--precommit1max value Allow the maximum number of simultaneous tasks for precommit1, default value: 0 (default: 0)
--precommit2max value Allow the maximum number of simultaneous tasks for precommit2, default value: 0 (default: 0)
--commitmax value Allow the maximum number of simultaneous tasks for commit2, default value: 0 (default: 0)
--group value Worker grouping function, default value: all (default: "all")

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store