From 88337750057dc1b3180baa02bc0fe413bbc8e0dd Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Mon, 14 Oct 2019 23:13:30 +0900 Subject: [PATCH 1/8] Add ./ before lotus commands, move list-miners to deal section --- README.md | 59 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5e3566ed2..643157099 100644 --- a/README.md +++ b/README.md @@ -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`] -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 +From within the lotus source directory: + ```sh -$ lotus daemon +$ ./lotus daemon ``` In another window check that you are connected to the network: ```sh -$ lotus net peers | wc -l +$ ./lotus net peers | wc -l 2 # number of peers ``` @@ -49,15 +51,17 @@ $ lotus net peers | wc -l You can follow sync status with: ```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 Create a new address: ```sh -$ lotus wallet new bls +$ ./lotus wallet new bls t3... ``` @@ -69,39 +73,38 @@ BLS signatures use less space so will have lower fees.) Check the wallet balance: ```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, -it means that either there are no transactions to this address on chain - using -faucet should 'fix' this, or your node isn't fully synced). +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). ### Mining Ensure that at least one BLS address (`t3..`) in your wallet has enough funds to cover pledge collateral: ```sh -$ lotus state pledge-collateral +$ ./lotus state pledge-collateral 1234 -$ lotus wallet balance t3... +$ ./lotus wallet balance [t3...] 8999 ``` (Balance must be higher than the returned pledge collateral for the next step to work) Initialize storage miner: ```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) Start mining: ```sh -$ lotus-storage-miner run +$ ./lotus-storage-miner run ``` To view the miner id used for deals: ```sh -$ lotus-storage-miner info +$ ./lotus-storage-miner info ``` e.g. miner id `t0111` @@ -109,25 +112,20 @@ e.g. miner id `t0111` Seal random data to start producing PoSts: ```sh -$ lotus-storage-miner store-garbage +$ ./lotus-storage-miner store-garbage ``` You can check miner power and sector usage with the miner id: ```sh # Total power of the network -$ lotus-storage-miner state power +$ ./lotus-storage-miner state power -$ lotus-storage-miner state power +$ ./lotus-storage-miner state power -$ lotus-storage-miner state sectors +$ ./lotus-storage-miner state sectors ``` -If you create multiple miners view them with: - -```sh -$ lotus state list-miners -``` ### Stage Data @@ -138,11 +136,11 @@ Import some data: $ echo "Hi my name is $USER" > hello.txt # Import the file into lotus & get a Data CID -$ lotus client import ./hello.txt +$ ./lotus client import ./hello.txt # 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.) @@ -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.) ```sh +# List all miners in the system. Choose one to make a deal with. +$ ./lotus state list-miners + # List asks proposed by a miner -$ lotus client query-ask +$ ./lotus client query-ask # Propose a deal with a miner -$ lotus client deal +$ ./lotus client deal ``` -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 @@ -167,7 +168,7 @@ If you've stored data with a miner in the network, you can search for it by CID: ```sh # Search for data by CID -$ lotus client find +$ ./lotus client find LOCAL RETRIEVAL @-- ``` @@ -175,7 +176,7 @@ RETRIEVAL @-- To retrieve data from a miner: ```sh -$ lotus client retrieve +$ ./lotus client retrieve ``` This will initiate a retrieval deal and write the data to the outfile. (This process may take some time.) From f1760e08129b0ac7f110b9b6a630bbd3896daa55 Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 09:07:41 +0900 Subject: [PATCH 2/8] Update command docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 643157099..697a70f87 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ you just created, and press Send. (You can also generate a public key address using secp256k1 with `lotus wallet new secp256k1`. BLS signatures use less space so will have lower fees.) -Check the wallet balance: +Check the wallet balance (balance is listed in attoFIL, where 1 attoFIL = 10^-18 FIL): ```sh $ ./lotus wallet balance [optional address (t3...)] ``` @@ -156,11 +156,11 @@ $ ./lotus state list-miners # List asks proposed by a miner $ ./lotus client query-ask -# Propose a deal with a miner +# Propose a deal with a miner. Price is in attoFIL/byte/block. Duration is # of blocks. $ ./lotus client deal ``` -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. If successful, the `client deal` command will return a deal CID. ### Search & Retrieval From 3908b47dc013cd3d265189723f6f5544a68dfb47 Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 09:12:54 +0900 Subject: [PATCH 3/8] Add installation instructions --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 697a70f87..6a46a6a3c 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ Lotus is an experimental implementation of the Filecoin Distributed Storage Netw All work is tracked via issues. An attempt at keeping an up-to-date view on remaining work is in the [lotus testnet github project board](https://github.com/filecoin-project/lotus/projects/1). -## Building +## Build & install -*Dependencies:* +We currently only provide the option to build lotus from source. Binary installation options are coming soon! +In order to run lotus, please do the following: +1. Make sure you have these dependencies installed: - go (1.13 or higher) - gcc (7.4.0 or higher) - git @@ -18,11 +20,20 @@ All work is tracked via issues. An attempt at keeping an up-to-date view on rema - jq - pkg-config -*Building:* + +2. Clone this repo & `cd` into it +``` +$ git clone https://github.com/filecoin-project/lotus.git +$ cd lotus/ +``` + +3. Build the source code ``` $ make ``` +Now, you should be able to perform the commands listed below. + ## Devnet ### Node setup From 16aa92a751424409ddc6becaf9ba157f4020db5f Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 09:27:32 +0900 Subject: [PATCH 4/8] Fix merge conflict --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6a46a6a3c..b74a464aa 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ If you have run lotus before and want to remove all previous data: `rm -rf ~/.lo 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). +### Genesis & Bootstrap + +The current lotus build will automatically join the lotus Devnet using the genesis and bootstrap files in the `build/` directory. No configuration is needed. + ### Start Daemon From within the lotus source directory: @@ -79,8 +83,8 @@ t3... Grab some funds from faucet - go to http://147.75.80.29:777/, paste the address you just created, and press Send. -(You can also generate a public key address using secp256k1 with `lotus wallet new secp256k1`. -BLS signatures use less space so will have lower fees.) +(You can also generate a public key address using secp256k1 with +`lotus wallet new secp256k1`. BLS signatures use less space so will have lower fees.) Check the wallet balance (balance is listed in attoFIL, where 1 attoFIL = 10^-18 FIL): ```sh @@ -137,7 +141,6 @@ $ ./lotus-storage-miner state power $ ./lotus-storage-miner state sectors ``` - ### Stage Data Import some data: @@ -228,6 +231,7 @@ Now go to http://127.0.0.1:2222. * Turn it off and on - Start at the top * `rm -rf ~/.lotus ~/.lotusstorage/` * Verify you have the correct versions of dependencies +* If stuck on a bad fork, try `lotus chain sethead --genesis` * If that didn't help, open a new issue, ask in the [Community Forum](https://discuss.filecoin.io) or reach out via [Community chat](https://github.com/filecoin-project/community#chat). From c050151e44075490fe0ba21781cd0bb9c5c04e9f Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:40:20 +0900 Subject: [PATCH 5/8] Remove ./, update build instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 497f11778..65a4ac976 100644 --- a/README.md +++ b/README.md @@ -285,4 +285,4 @@ Lotus has tracing built into many of its internals. To view the traces, first do For more details, see [this document](./docs/tracing.md). ## License -Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE) +Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE) \ No newline at end of file From 06e93a58c7e5d79207c813be78bfed5bcf966273 Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:43:28 +0900 Subject: [PATCH 6/8] Remove ./, update build instructions --- README.md | 63 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 65a4ac976..2b1cdb9db 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Lotus is an experimental implementation of the Filecoin Distributed Storage Netw All work is tracked via issues. An attempt at keeping an up-to-date view on remaining work is in the [lotus testnet github project board](https://github.com/filecoin-project/lotus/projects/1). -## Build & install +## Building We currently only provide the option to build lotus from source. Binary installation options are coming soon! @@ -27,9 +27,10 @@ $ git clone https://github.com/filecoin-project/lotus.git $ cd lotus/ ``` -3. Build the source code +3. Build and install the source code ``` $ make +$ sudo make install ``` Now, you should be able to perform the commands listed below. @@ -40,9 +41,7 @@ Now, you should be able to perform the commands listed below. If you have run lotus before and want to remove all previous data: `rm -rf ~/.lotus ~/.lotusstorage` -[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. 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). +The following sections describe how to use the lotus CLI. All these commands should be run from within the `lotus/` directory. Alternately you can run lotus nodes and miners using the [Pond GUI](#pond). ### Genesis & Bootstrap @@ -54,15 +53,15 @@ The current lotus build will automatically join the lotus Devnet using the genes ### Start Daemon -From within the lotus source directory: +From within the `lotus/` directory: ```sh -$ ./lotus daemon +$ lotus daemon ``` In another window check that you are connected to the network: ```sh -$ ./lotus net peers | wc -l +$ lotus net peers | wc -l 2 # number of peers ``` @@ -70,7 +69,7 @@ $ ./lotus net peers | wc -l You can follow sync status with: ```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.] @@ -80,11 +79,11 @@ $ watch ./lotus sync status Create a new address: ```sh -$ ./lotus wallet new bls +$ lotus wallet new bls t3... ``` -Grab some funds from faucet - go to http://147.75.80.29:777/, paste the address +Grab some funds from faucet - go to http://lotus-faucet.kittyhawk.wtf:777/, paste the address you just created, and press Send. (You can also generate a public key address using secp256k1 with @@ -92,7 +91,7 @@ you just created, and press Send. Check the wallet balance (balance is listed in attoFIL, where 1 attoFIL = 10^-18 FIL): ```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, 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). @@ -102,28 +101,28 @@ it means that either your node isn't fully synced or there are no transactions t Ensure that at least one BLS address (`t3..`) in your wallet has enough funds to cover pledge collateral: ```sh -$ ./lotus state pledge-collateral +$ lotus state pledge-collateral 1234 -$ ./lotus wallet balance [t3...] +$ lotus wallet balance [t3...] 8999 ``` (Balance must be higher than the returned pledge collateral for the next step to work) Initialize storage miner: ```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) Start mining: ```sh -$ ./lotus-storage-miner run +$ lotus-storage-miner run ``` To view the miner id used for deals: ```sh -$ ./lotus-storage-miner info +$ lotus-storage-miner info ``` e.g. miner id `t0111` @@ -131,18 +130,18 @@ e.g. miner id `t0111` Seal random data to start producing PoSts: ```sh -$ ./lotus-storage-miner store-garbage +$ lotus-storage-miner store-garbage ``` You can check miner power and sector usage with the miner id: ```sh # Total power of the network -$ ./lotus-storage-miner state power +$ lotus-storage-miner state power -$ ./lotus-storage-miner state power +$ lotus-storage-miner state power -$ ./lotus-storage-miner state sectors +$ lotus-storage-miner state sectors ``` ### Stage Data @@ -154,11 +153,11 @@ Import some data: $ echo "Hi my name is $USER" > hello.txt # Import the file into lotus & get a Data CID -$ ./lotus client import ./hello.txt +$ lotus client import hello.txt # 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.) @@ -169,16 +168,16 @@ $ ./lotus client local ```sh # List all miners in the system. Choose one to make a deal with. -$ ./lotus state list-miners +$ lotus state list-miners # List asks proposed by a miner -$ ./lotus client query-ask +$ lotus client query-ask # Propose a deal with a miner. Price is in attoFIL/byte/block. Duration is # of blocks. -$ ./lotus client deal +$ lotus client deal ``` -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. If successful, the `client deal` command will return a deal CID. +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. If successful, the `client deal` command will return a deal CID. ### Search & Retrieval @@ -186,7 +185,7 @@ If you've stored data with a miner in the network, you can search for it by CID: ```sh # Search for data by CID -$ ./lotus client find +$ lotus client find LOCAL RETRIEVAL @-- ``` @@ -194,7 +193,7 @@ RETRIEVAL @-- To retrieve data from a miner: ```sh -$ ./lotus client retrieve +$ lotus client retrieve ``` This will initiate a retrieval deal and write the data to the outfile. (This process may take some time.) @@ -215,7 +214,7 @@ $ make pond Run: ``` -$ ./pond run +$ pond run Listening on http://127.0.0.1:2222 ``` @@ -276,13 +275,13 @@ The storage miner logic. This package also interfaces with the full node through ## Pond Pond is a graphical testbed for lotus. It can be used to spin up nodes, connect them in a given topology, start them mining, and observe how they function over time. -To try it out, run `make pond`, then run `./pond run`. +To try it out, run `make pond`, then run `pond run`. Once it is running, visit localhost:2222 in your browser. ## Tracing Lotus has tracing built into many of its internals. To view the traces, first download jaeger](https://www.jaegertracing.io/download/) (Choose the 'all-in-one' binary). Then run it somewhere, start up the lotus daemon, and open up localhost:16686 in your browser. -For more details, see [this document](./docs/tracing.md). +For more details, see [this document](docs/tracing.md). ## License Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE) \ No newline at end of file From 4a425fd1b5269e8a1c7b13eda080fbfd1c87b99e Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:51:15 +0900 Subject: [PATCH 7/8] Remove recs to run from lotus directory --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b1cdb9db..2a408616a 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Now, you should be able to perform the commands listed below. If you have run lotus before and want to remove all previous data: `rm -rf ~/.lotus ~/.lotusstorage` -The following sections describe how to use the lotus CLI. All these commands should be run from within the `lotus/` directory. Alternately you can run lotus nodes and miners using the [Pond GUI](#pond). +The following sections describe how to use the lotus CLI. Alternately you can run lotus nodes and miners using the [Pond GUI](#pond). ### Genesis & Bootstrap @@ -53,8 +53,6 @@ The current lotus build will automatically join the lotus Devnet using the genes ### Start Daemon -From within the `lotus/` directory: - ```sh $ lotus daemon ``` From 8a6791d5365c921b91c35b61eb9f47eefa1a50e2 Mon Sep 17 00:00:00 2001 From: Pooja <5668171+pooja@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:54:40 +0900 Subject: [PATCH 8/8] Add back ./ for pond commands --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2a408616a..71ed015e1 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Import some data: $ echo "Hi my name is $USER" > hello.txt # Import the file into lotus & get a Data CID -$ lotus client import hello.txt +$ lotus client import ./hello.txt # List imported files by CID, name, size, status @@ -212,7 +212,7 @@ $ make pond Run: ``` -$ pond run +$ ./pond run Listening on http://127.0.0.1:2222 ``` @@ -273,13 +273,13 @@ The storage miner logic. This package also interfaces with the full node through ## Pond Pond is a graphical testbed for lotus. It can be used to spin up nodes, connect them in a given topology, start them mining, and observe how they function over time. -To try it out, run `make pond`, then run `pond run`. +To try it out, run `make pond`, then run `./pond run`. Once it is running, visit localhost:2222 in your browser. ## Tracing Lotus has tracing built into many of its internals. To view the traces, first download jaeger](https://www.jaegertracing.io/download/) (Choose the 'all-in-one' binary). Then run it somewhere, start up the lotus daemon, and open up localhost:16686 in your browser. -For more details, see [this document](docs/tracing.md). +For more details, see [this document](./docs/tracing.md). ## License Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE) \ No newline at end of file