Devnet docs

This commit is contained in:
Łukasz Magiera 2019-09-27 16:53:34 +02:00
parent 47bf759122
commit 08a1e211f5
2 changed files with 122 additions and 0 deletions

100
README.md
View File

@ -26,6 +26,106 @@ board](https://github.com/filecoin-project/go-lotus/projects/1).
$ make
```
## Devnet
### Node setup
Download genesis, and parameters
```sh
$ wget https://ipfs.io/ipfs/QmQdj5bTUSaegqxahn5uhXY1Eb11fi3S9mZWmhFs6iTh3T/lotus.car
$ wget https://ipfs.io/ipfs/QmQdj5bTUSaegqxahn5uhXY1Eb11fi3S9mZWmhFs6iTh3T/paramfetch.sh
$ chmod +x paramfetch.sh
$ ./paramfetch.sh
```
Start full node daemon
```sh
$ lotus daemon --genesis=lotus.car
```
Connect to the network:
```sh
$ lotus net connect /ip4/147.75.80.29/tcp/41537/p2p/12D3KooWRXFamRyM924hPfEpogHLpGYx6Hdd6pHukL26iLiWRZBM
```
[wait for the chain to finish syncing]
### Basics
Create new address
```sh
$ lotus wallet new bls
t3...
```
Grab some funds from faucet - go to http://147.75.80.29:777/, paste the address
you just created, and press Send
See wallet balance:
```sh
$ 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)
### Mining
Ensure that at least one BLS address (`t3..`) in your wallet has enough funds to
cover pledge collateral:
```sh
$ lotus state pledge-collateral
1234
$ 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...
```
This command should return successfully after miner is setup on-chain (30-60s)
Start mining:
```sh
$ lotus-storage-miner run
```
Seal random data to start producing PoSts:
```sh
$ lotus-storage-miner store-garbage
```
### Making deals
TODO: see `$ lotus client` commands
### Pond UI
Build:
```
$ make pond
```
Run:
```
$ ./pond run
Listening on http://127.0.0.1:2222
```
Now go to http://127.0.0.1:2222, basic usage should be rather intuitive
Note: don't leave unattended for long periods of time (10h+), the web-ui tends to
eventually consume all the available RAM
### Troubleshooting
* Turn it off
* `rm -rf ~/.lotus ~/.lotusstorage/`
* "Turn it on" - Start at the top
* If that didn't help, open a new issue
## Architecture
Lotus is architected modularly, and aims to keep clean api boundaries between
everything, even if they are in the same process. Notably, the 'lotus full node'

View File

@ -17,6 +17,7 @@ var stateCmd = &cli.Command{
statePowerCmd,
stateSectorsCmd,
stateProvingSetCmd,
statePledgeCollateralCmd,
},
}
@ -172,3 +173,24 @@ var stateReplaySetCmd = &cli.Command{
return nil
},
}
var statePledgeCollateralCmd = &cli.Command{
Name: "pledge-collateral",
Usage: "Get minimum miner pledge collateral",
Action: func(cctx *cli.Context) error {
api, err := GetFullNodeAPI(cctx)
if err != nil {
return err
}
ctx := ReqContext(cctx)
coll, err := api.StatePledgeCollateral(ctx, nil)
if err != nil {
return err
}
fmt.Println(coll.String())
return nil
},
}