2020-04-14 12:51:20 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/state/verify"
|
2020-06-06 20:49:06 +00:00
|
|
|
|
2020-04-14 12:51:20 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
exportFilePath string
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
withChaindata(verifyExportCmd)
|
|
|
|
must(verifyExportCmd.MarkFlagRequired("chaindata"))
|
|
|
|
|
|
|
|
verifyExportCmd.Flags().StringVarP(&exportFilePath, "file", "f", "", "path to the export file used as input to analysis")
|
|
|
|
must(verifyExportCmd.MarkFlagFilename("file", ""))
|
|
|
|
must(verifyExportCmd.MarkFlagRequired("file"))
|
|
|
|
|
|
|
|
rootCmd.AddCommand(verifyExportCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var verifyExportCmd = &cobra.Command{
|
|
|
|
Use: "verifyExportFile",
|
|
|
|
Short: "Verifies snapshots generated by `geth export` against chaindata",
|
|
|
|
RunE: func(_ *cobra.Command, _ []string) error {
|
|
|
|
return verify.ExportFile(exportFilePath, chaindata)
|
|
|
|
},
|
|
|
|
}
|