fork

package
v0.1.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForkCmd = &cobra.Command{
	Use:   "fork blockhash url",
	Short: "Take a forked block and walk up the chain to do analysis.",
	Long:  "",
	RunE: func(cmd *cobra.Command, args []string) error {
		log.Info().Str("rpc", rpcURL).Str("blockHash", blockHash.String()).Msg("Starting Analysis")
		c, err := ethclient.Dial(rpcURL)
		if err != nil {
			log.Error().Err(err).Str("rpc", rpcURL).Msg("Could not rpc dial connection")
			return err
		}
		return walkTheBlocks(blockHash, c)
	},
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) != 2 {
			return fmt.Errorf("two arguments required a block hash and an RPC URL")
		}
		blockHash = ethcommon.HexToHash(args[0])
		rpcURL = args[1]
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL