Skip to content

Commit

Permalink
docsgen, fix snapshot flag name
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Sep 2, 2020
1 parent e4ae7ab commit 2c1a640
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var DaemonCmd = &cli.Command{
Usage: "on first run, load chain from given file",
},
&cli.StringFlag{
Name: "checkpoint",
Name: "snapshot",
Usage: "import chain state from a given chain export file",
},
&cli.BoolFlag{
Expand Down Expand Up @@ -195,23 +195,23 @@ var DaemonCmd = &cli.Command{
}

chainfile := cctx.String("import-chain")
snapshot := cctx.String("checkpoint")
snapshot := cctx.String("snapshot")
if chainfile != "" || snapshot != "" {
if chainfile != "" && snapshot != "" {
return fmt.Errorf("cannot specify both 'snapshot' and 'import-chain'")
}
var ischeckpoint bool
var issnapshot bool
if chainfile == "" {
chainfile = snapshot
ischeckpoint = true
issnapshot = true
}

chainfile, err := homedir.Expand(chainfile)
if err != nil {
return err
}

if err := ImportChain(r, chainfile, ischeckpoint); err != nil {
if err := ImportChain(r, chainfile, issnapshot); err != nil {
return err
}
if cctx.Bool("halt-after-import") {
Expand Down
4 changes: 4 additions & 0 deletions documentation/en/api-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,17 @@ blockchain, but that do not require any form of state computation.

### ChainExport
ChainExport returns a stream of bytes with CAR dump of chain data.
The exported chain data includes the header chain from the given tipset
back to genesis, the entire genesis state, and the most recent 'nroots'
state trees.


Perms: read

Inputs:
```json
[
10101,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
Expand Down

0 comments on commit 2c1a640

Please sign in to comment.