2020-04-20 10:35:33 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2022-01-19 03:49:07 +00:00
|
|
|
"github.com/ledgerwatch/erigon-lib/common"
|
2021-05-20 18:25:53 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/state/verify"
|
2020-04-20 10:35:33 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-02-22 17:39:48 +00:00
|
|
|
withDataDir(checkIndexCMD)
|
2020-04-20 10:35:33 +00:00
|
|
|
withIndexBucket(checkIndexCMD)
|
|
|
|
withCSBucket(checkIndexCMD)
|
|
|
|
rootCmd.AddCommand(checkIndexCMD)
|
|
|
|
}
|
|
|
|
|
|
|
|
var checkIndexCMD = &cobra.Command{
|
|
|
|
Use: "checkIndex",
|
|
|
|
Short: "Index checker",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2022-01-19 03:49:07 +00:00
|
|
|
ctx, _ := common.RootContext()
|
2021-04-26 12:39:34 +00:00
|
|
|
return verify.CheckIndex(ctx, chaindata, changeSetBucket, indexBucket)
|
2020-04-20 10:35:33 +00:00
|
|
|
},
|
|
|
|
}
|