2020-10-13 12:56:16 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2021-05-20 18:25:53 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/state/verify"
|
2021-07-29 10:23:23 +00:00
|
|
|
"github.com/ledgerwatch/log/v3"
|
2020-10-13 12:56:16 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2021-04-19 07:25:26 +00:00
|
|
|
withDatadir(verifyHeadersSnapshotCmd)
|
2020-10-13 12:56:16 +00:00
|
|
|
rootCmd.AddCommand(verifyHeadersSnapshotCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var verifyHeadersSnapshotCmd = &cobra.Command{
|
|
|
|
Use: "verifyHeadersSnapshot",
|
|
|
|
Short: "Verify headers snapshot",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
if chaindata == "" && len(args) > 0 {
|
|
|
|
chaindata = args[0]
|
|
|
|
}
|
2021-07-28 02:47:38 +00:00
|
|
|
logger := log.New()
|
|
|
|
return verify.HeadersSnapshot(logger, chaindata)
|
2020-10-13 12:56:16 +00:00
|
|
|
},
|
|
|
|
}
|