2019-12-06 15:26:03 +00:00
# Storage Mining
2019-12-01 08:21:20 +00:00
2019-12-18 21:46:09 +00:00
Here are instructions to learn how to perform storage mining. For hardware specifications please read [this ](https://docs.lotu.sh/en+hardware-mining ).
2019-12-06 15:26:03 +00:00
2019-12-18 21:46:09 +00:00
It is useful to [join the Testnet ](https://docs.lotu.sh/en+join-testnet ) prior to attempting storage mining for the first time.
2019-12-06 15:26:03 +00:00
2019-12-23 05:39:26 +00:00
## Note: Using the Lotus Storage Miner from China
2019-12-18 22:48:52 +00:00
2019-12-23 05:39:26 +00:00
If you are trying to use `lotus-storage-miner` from China. You should set this **environment variable** on your machine.
2019-12-18 22:48:52 +00:00
```sh
2019-12-23 05:39:26 +00:00
IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
2019-12-18 22:48:52 +00:00
```
2019-12-09 12:53:40 +00:00
2019-12-06 15:26:03 +00:00
## Get started
2020-02-12 23:36:56 +00:00
Please ensure that at least one **BLS address** (starts with `t3` ) in your wallet exists with the following command:
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus wallet list
2019-12-01 08:21:20 +00:00
```
2020-02-12 23:36:56 +00:00
If you do not have a bls address, create a new bls wallet:
```sh
lotus wallet new bls
```
2019-12-09 12:53:40 +00:00
With your wallet address:
- Visit the [faucet ](https://lotus-faucet.kittyhawk.wtf/miner.html )
2019-12-10 10:01:26 +00:00
- Click "Create Miner"
2019-12-09 12:53:40 +00:00
- DO NOT REFRESH THE PAGE. THIS OPERATION CAN TAKE SOME TIME.
2019-12-01 08:21:20 +00:00
2019-12-09 12:53:40 +00:00
The task will be complete when you see:
2019-12-01 08:21:20 +00:00
2019-12-06 15:26:03 +00:00
```sh
2019-12-09 12:53:40 +00:00
New storage miners address is: < YOUR_NEW_MINING_ADDRESS >
2019-12-06 15:26:03 +00:00
```
2019-12-02 00:08:53 +00:00
2019-12-06 15:26:03 +00:00
## Initialize the storage miner
2019-12-01 08:21:20 +00:00
2019-12-09 12:53:40 +00:00
In a CLI window, use the following command to start your miner:
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus-storage-miner init --actor=ACTOR_VALUE_RECEIVED --owner=OWNER_VALUE_RECEIVED
2019-12-01 08:21:20 +00:00
```
2019-12-06 15:26:03 +00:00
Example
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus-storage-miner init --actor=t01424 --owner=t3spmep2xxsl33o4gxk7yjxcobyohzgj3vejzerug25iinbznpzob6a6kexcbeix73th6vjtzfq7boakfdtd6a
2019-12-01 08:21:20 +00:00
```
2019-12-09 12:53:40 +00:00
You will have to wait some time for this operation to complete.
2019-12-06 15:26:03 +00:00
## Mining
To mine:
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus-storage-miner run
2019-12-01 08:21:20 +00:00
```
2019-12-18 21:46:09 +00:00
If you are downloading **Filecoin Proof Parameters** , the download can take some time.
2019-12-10 10:01:26 +00:00
2019-12-06 15:26:03 +00:00
Get information about your miner:
```sh
lotus-storage-miner info
# example: miner id `t0111`
```
2019-12-01 08:21:20 +00:00
2019-12-04 15:39:41 +00:00
**Seal** random data to start producing **PoSts** :
2019-12-01 08:21:20 +00:00
```sh
2019-12-08 14:27:28 +00:00
lotus-storage-miner pledge-sector
2019-12-01 08:21:20 +00:00
```
2019-12-18 21:46:09 +00:00
- Warning: On Linux configurations, this command will write data to `$TMPDIR` which is not usually the largest partition. You should point the value to a larger partition if possible.
2019-12-11 12:29:48 +00:00
2019-12-06 15:26:03 +00:00
Get **miner power** and **sector usage** :
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus-storage-miner state power
# returns total power
2019-12-01 08:21:20 +00:00
2019-12-06 15:26:03 +00:00
lotus-storage-miner state power < miner >
2019-12-01 08:21:20 +00:00
2019-12-06 15:26:03 +00:00
lotus-storage-miner state sectors < miner >
2019-12-01 08:21:20 +00:00
```
2019-12-04 15:39:41 +00:00
2019-12-06 15:26:03 +00:00
## Change nickname
Update `~/.lotus/config.toml` with:
2019-12-04 15:39:41 +00:00
2019-12-04 17:53:36 +00:00
```sh
2019-12-04 15:39:41 +00:00
[Metrics]
2019-12-09 12:53:40 +00:00
Nickname="fun"
2019-12-04 15:39:41 +00:00
```