2019-11-25 13:46:36 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2020-04-14 12:49:25 +00:00
|
|
|
var (
|
|
|
|
snapshotPath string
|
|
|
|
)
|
|
|
|
|
2019-11-25 13:46:36 +00:00
|
|
|
func init() {
|
2020-04-14 12:49:25 +00:00
|
|
|
verifySnapshotCmd.Flags().StringVar(&snapshotPath, "snapshot", "snapshot", "Path to the snapshot to verify")
|
|
|
|
if err := verifySnapshotCmd.MarkFlagFilename("snapshot", ""); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := verifySnapshotCmd.MarkFlagRequired("snapshot"); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-25 13:46:36 +00:00
|
|
|
rootCmd.AddCommand(verifySnapshotCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var verifySnapshotCmd = &cobra.Command{
|
|
|
|
Use: "verifySnapshot",
|
|
|
|
Short: "Verifies snapshots made by the 'stateless' action",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2020-04-14 12:49:25 +00:00
|
|
|
stateless.VerifySnapshot(snapshotPath)
|
2019-11-25 13:46:36 +00:00
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|