Merge pull request #2878 from filecoin-project/feat/better-localnet-docs

Feat/better localnet docs
This commit is contained in:
Łukasz Magiera 2020-08-06 22:52:59 +02:00 committed by GitHub
commit f8a6e4dce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -215,6 +215,10 @@ var walletImport = &cli.Command{
Usage: "specify input format for key",
Value: "hex-lotus",
},
&cli.BoolFlag{
Name: "as-default",
Usage: "import the given key as your new default key",
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx)
@ -287,6 +291,12 @@ var walletImport = &cli.Command{
return err
}
if cctx.Bool("as-default") {
if err := api.WalletSetDefault(ctx, addr); err != nil {
return fmt.Errorf("failed to set default key: %w", err)
}
}
fmt.Printf("imported key %s successfully!\n", addr)
return nil
},

View File

@ -22,13 +22,13 @@ Create the genesis block and start up the first node:
```sh
./lotus-seed genesis new localnet.json
./lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
./lotus daemon --lotus-make-genesis=dev.gen --genesis-template=localnet.json --bootstrap=false
./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false
```
Then, in another console, import the genesis miner key:
```sh
./lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
./lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
```
Set up the genesis miner: