Add ./ before lotus commands, move list-miners to deal section

This commit is contained in:
Pooja 2019-10-14 23:13:30 +09:00
parent b9b127437a
commit 8833775005

View File

@ -31,17 +31,19 @@ If you have run lotus before and want to remove all previous data: `rm -rf ~/.lo
[You can copy `lotus` and `lotus-storage-miner` to your `$GOPATH/bin` or `$PATH`, or reference all lotus commands below from your local build directory with `./lotus`] [You can copy `lotus` and `lotus-storage-miner` to your `$GOPATH/bin` or `$PATH`, or reference all lotus commands below from your local build directory with `./lotus`]
The following sections describe how to use the lotus CLI. Alternately you can run lotus nodes and miners using the [Pond GUI](#pond). The following sections describe how to use the lotus CLI. All these commands should be run from within the directory containing lotus source files. Alternately you can run lotus nodes and miners using the [Pond GUI](#pond).
### Start Daemon ### Start Daemon
From within the lotus source directory:
```sh ```sh
$ lotus daemon $ ./lotus daemon
``` ```
In another window check that you are connected to the network: In another window check that you are connected to the network:
```sh ```sh
$ lotus net peers | wc -l $ ./lotus net peers | wc -l
2 # number of peers 2 # number of peers
``` ```
@ -49,15 +51,17 @@ $ lotus net peers | wc -l
You can follow sync status with: You can follow sync status with:
```sh ```sh
$ watch lotus sync status $ watch ./lotus sync status
``` ```
[It may take a few minutes for the chain to finish syncing. You will see `Height: 0` until the full chain is synced and validated.]
### Basics ### Basics
Create a new address: Create a new address:
```sh ```sh
$ lotus wallet new bls $ ./lotus wallet new bls
t3... t3...
``` ```
@ -69,39 +73,38 @@ BLS signatures use less space so will have lower fees.)
Check the wallet balance: Check the wallet balance:
```sh ```sh
$ lotus wallet balance [optional address (t3...)] $ ./lotus wallet balance [optional address (t3...)]
``` ```
(NOTE: If you see an error like `actor not found` after executing this command, (NOTE: If you see an error like `actor not found` after executing this command,
it means that either there are no transactions to this address on chain - using it means that either your node isn't fully synced or there are no transactions to this address yet on chain. If the latter, using the faucet should 'fix' this).
faucet should 'fix' this, or your node isn't fully synced).
### Mining ### Mining
Ensure that at least one BLS address (`t3..`) in your wallet has enough funds to Ensure that at least one BLS address (`t3..`) in your wallet has enough funds to
cover pledge collateral: cover pledge collateral:
```sh ```sh
$ lotus state pledge-collateral $ ./lotus state pledge-collateral
1234 1234
$ lotus wallet balance t3... $ ./lotus wallet balance [t3...]
8999 8999
``` ```
(Balance must be higher than the returned pledge collateral for the next step to work) (Balance must be higher than the returned pledge collateral for the next step to work)
Initialize storage miner: Initialize storage miner:
```sh ```sh
$ lotus-storage-miner init --owner=t3... $ ./lotus-storage-miner init --owner=t3...
``` ```
This command should return successfully after miner is setup on-chain (30-60s) This command should return successfully after miner is setup on-chain (30-60s)
Start mining: Start mining:
```sh ```sh
$ lotus-storage-miner run $ ./lotus-storage-miner run
``` ```
To view the miner id used for deals: To view the miner id used for deals:
```sh ```sh
$ lotus-storage-miner info $ ./lotus-storage-miner info
``` ```
e.g. miner id `t0111` e.g. miner id `t0111`
@ -109,25 +112,20 @@ e.g. miner id `t0111`
Seal random data to start producing PoSts: Seal random data to start producing PoSts:
```sh ```sh
$ lotus-storage-miner store-garbage $ ./lotus-storage-miner store-garbage
``` ```
You can check miner power and sector usage with the miner id: You can check miner power and sector usage with the miner id:
```sh ```sh
# Total power of the network # Total power of the network
$ lotus-storage-miner state power $ ./lotus-storage-miner state power
$ lotus-storage-miner state power <miner> $ ./lotus-storage-miner state power <miner>
$ lotus-storage-miner state sectors <miner> $ ./lotus-storage-miner state sectors <miner>
``` ```
If you create multiple miners view them with:
```sh
$ lotus state list-miners
```
### Stage Data ### Stage Data
@ -138,11 +136,11 @@ Import some data:
$ echo "Hi my name is $USER" > hello.txt $ echo "Hi my name is $USER" > hello.txt
# Import the file into lotus & get a Data CID # Import the file into lotus & get a Data CID
$ lotus client import ./hello.txt $ ./lotus client import ./hello.txt
<Data CID> <Data CID>
# List imported files by CID, name, size, status # List imported files by CID, name, size, status
$ lotus client local $ ./lotus client local
``` ```
(CID is short for Content Identifier, a self describing content address used throughout the IPFS ecosystem. It is a cryptographic hash that uniquely maps to the data and verifies it has not changed.) (CID is short for Content Identifier, a self describing content address used throughout the IPFS ecosystem. It is a cryptographic hash that uniquely maps to the data and verifies it has not changed.)
@ -152,14 +150,17 @@ $ lotus client local
(It is possible for a Client to make a deal with a Miner on the same lotus Node.) (It is possible for a Client to make a deal with a Miner on the same lotus Node.)
```sh ```sh
# List all miners in the system. Choose one to make a deal with.
$ ./lotus state list-miners
# List asks proposed by a miner # List asks proposed by a miner
$ lotus client query-ask <miner> $ ./lotus client query-ask <miner>
# Propose a deal with a miner # Propose a deal with a miner
$ lotus client deal <Data CID> <miner> <price> <duration> $ ./lotus client deal <Data CID> <miner> <price> <duration>
``` ```
For example `$ lotus client deal bafkre...qvtjsi t0111 36000 12` proposes a deal to store CID `bafkre...qvtjsi` with miner `t0111` at price `36000` for a duration of `12` blocks. For example `$ ./lotus client deal bafkre...qvtjsi t0111 36000 12` proposes a deal to store CID `bafkre...qvtjsi` with miner `t0111` at price `36000` for a duration of `12` blocks.
### Search & Retrieval ### Search & Retrieval
@ -167,7 +168,7 @@ If you've stored data with a miner in the network, you can search for it by CID:
```sh ```sh
# Search for data by CID # Search for data by CID
$ lotus client find <Data CID> $ ./lotus client find <Data CID>
LOCAL LOCAL
RETRIEVAL <miner>@<miner peerId>-<deal funds>-<size> RETRIEVAL <miner>@<miner peerId>-<deal funds>-<size>
``` ```
@ -175,7 +176,7 @@ RETRIEVAL <miner>@<miner peerId>-<deal funds>-<size>
To retrieve data from a miner: To retrieve data from a miner:
```sh ```sh
$ lotus client retrieve <Data CID> <outfile> $ ./lotus client retrieve <Data CID> <outfile>
``` ```
This will initiate a retrieval deal and write the data to the outfile. (This process may take some time.) This will initiate a retrieval deal and write the data to the outfile. (This process may take some time.)