2020-06-10 20:07:14 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2021-05-20 18:25:53 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/state/verify"
|
2023-05-07 06:28:15 +00:00
|
|
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
|
|
|
"github.com/ledgerwatch/log/v3"
|
2020-06-10 20:07:14 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-02-22 17:39:48 +00:00
|
|
|
withDataDir(verifyTxLookupCmd)
|
2020-06-10 20:07:14 +00:00
|
|
|
rootCmd.AddCommand(verifyTxLookupCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var verifyTxLookupCmd = &cobra.Command{
|
|
|
|
Use: "verifyTxLookup",
|
|
|
|
Short: "Generate tx lookup index",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2023-05-07 06:28:15 +00:00
|
|
|
var logger log.Logger
|
|
|
|
var err error
|
|
|
|
if logger, err = debug.SetupCobra(cmd, "verify_txlookup"); err != nil {
|
|
|
|
logger.Error("Setting up", "error", err)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return verify.ValidateTxLookups(chaindata, logger)
|
2020-06-10 20:07:14 +00:00
|
|
|
},
|
|
|
|
}
|