2020-06-10 23:07:14 +03:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2021-05-21 01:25:53 +07:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/state/verify"
|
2023-05-07 07:28:15 +01:00
|
|
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
|
|
|
"github.com/ledgerwatch/log/v3"
|
2020-06-10 23:07:14 +03:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-02-22 18:39:48 +01:00
|
|
|
withDataDir(verifyTxLookupCmd)
|
2020-06-10 23:07:14 +03: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 07:28:15 +01: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 23:07:14 +03:00
|
|
|
},
|
|
|
|
}
|