explorePkg

package
v0.0.0-...-3f8eaf4 Latest Latest
Warning

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

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

README

chifra explore

chifra explore opens Etherscan (and other explorers -- including our own) to the block identifier, transaction identifier, or address you specify. It's a handy (configurable) way to open an explorer from the command line, nothing more.

Purpose:
  Open a local or remote explorer for one or more addresses, blocks, or transactions.

Usage:
  chifra explore [flags] <term> [term...]

Arguments:
  terms - one or more address, name, block, or transaction identifier

Flags:
  -l, --local    open the local TrueBlocks explorer
  -g, --google   search google excluding popular blockchain explorers
  -h, --help     display this help screen

Data models produced by this tool:

  • none

Other Options

All tools accept the following additional flags, although in some cases, they have no meaning.

  -v, --version         display the current version of the tool
      --output string   write the results to file 'fn' and return the filename
      --append          for --output command only append to instead of replace contents of file
      --file string     specify multiple sets of command line options in a file

Note: For the --file string option, you may place a series of valid command lines in a file using any valid flags. In some cases, this may significantly improve performance. A semi-colon at the start of any line makes it a comment.

Note: If you use --output --append option and at the same time the --file option, you may not switch export formats in the command file. For example, a command file with two different commands, one with --fmt csv and the other with --fmt json will produce both invalid CSV and invalid JSON.

Documentation

Overview

Package explorePkg handles the chifra explore command. It opens Etherscan (and other explorers -- including our own) to the block identifier, transaction identifier, or address you specify. It's a handy (configurable) way to open an explorer from the command line, nothing more.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunExplore

func RunExplore(cmd *cobra.Command, args []string) error

RunExplore handles the explore command for the command line. Returns error only as per cobra.

func ServeExplore

func ServeExplore(w http.ResponseWriter, r *http.Request) error

ServeExplore handles the explore command for the API. Returns an error.

Types

type ExploreOptions

type ExploreOptions struct {
	Terms   []string              `json:"terms,omitempty"`   // One or more address, name, block, or transaction identifier
	Local   bool                  `json:"local,omitempty"`   // Open the local TrueBlocks explorer
	Google  bool                  `json:"google,omitempty"`  // Search google excluding popular blockchain explorers
	Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options
	Conn    *rpc.Connection       `json:"conn,omitempty"`    // The connection to the RPC server
	BadFlag error                 `json:"badFlag,omitempty"` // An error flag if needed

}

ExploreOptions provides all command options for the chifra explore command.

func GetExploreOptions

func GetExploreOptions(args []string, g *globals.GlobalOptions) *ExploreOptions

GetExploreOptions returns the options for this tool so other tools may use it.

func GetOptions

func GetOptions() *ExploreOptions

func (*ExploreOptions) ExploreInternal

func (opts *ExploreOptions) ExploreInternal() error

ExploreInternal handles the internal workings of the explore command. Returns an error.

func (*ExploreOptions) HandleExplore

func (opts *ExploreOptions) HandleExplore() error

func (*ExploreOptions) String

func (opts *ExploreOptions) String() string

String implements the Stringer interface

type ExploreType

type ExploreType uint8
const (
	ExploreNone ExploreType = iota
	ExploreAddress
	ExploreName
	ExploreEnsName
	ExploreTx
	ExploreBlock
	ExploreFourByte
)

func (ExploreType) String

func (t ExploreType) String() string

type ExploreUrl

type ExploreUrl struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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