Skip to content

Commit

Permalink
Rename to import-snapshot, require more than finality for state export
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Jakub Sztandera committed Sep 2, 2020
1 parent 2c1a640 commit 568bcb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,10 @@ var chainExportCmd = &cli.Command{
return fmt.Errorf("must specify filename to export chain to")
}

rsrs := cctx.Int64("recent-stateroots")
rsrs := abi.ChainEpoch(cctx.Int64("recent-stateroots"))
if cctx.IsSet("recent-stateroots") && rsrs < build.Finality {
return fmt.Errorf("\"recent-stateroots\" has to be greater than %d", build.Finality)
}

fi, err := os.Create(cctx.Args().First())
if err != nil {
Expand All @@ -894,7 +897,7 @@ var chainExportCmd = &cli.Command{
return err
}

stream, err := api.ChainExport(ctx, abi.ChainEpoch(rsrs), ts.Key())
stream, err := api.ChainExport(ctx, rsrs, ts.Key())
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ var DaemonCmd = &cli.Command{
},
&cli.StringFlag{
Name: "import-chain",
Usage: "on first run, load chain from given file",
Usage: "on first run, load chain from given file and validate",
},
&cli.StringFlag{
Name: "snapshot",
Name: "import-snapshot",
Usage: "import chain state from a given chain export file",
},
&cli.BoolFlag{
Expand Down

0 comments on commit 568bcb1

Please sign in to comment.