slurpPkg

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: 21 Imported by: 0

README

chifra slurp

chifra slurp is the first tool we built in the Ethereum space. It even has its own website.

While it's useful, it has two shortcomings. First, it is fully centralized, pulling its data from http://etherscan.io. Second, is that it does not report every transaction for a given account. This is actually a shortcoming with Etherscan. It's too complicated to explain here, but see our blog.

While chifra slurp has its shortcomings, it does provides some nice features. You may use it to pull any transaction initiated by an EOA for example or to explore mining rewards. Visit the above referenced website for more information.

Purpose:
  Fetch data from Etherscan for any address.

Usage:
  chifra slurp [flags] <address> [address...] [block...]

Arguments:
  addrs - one or more addresses to slurp from Etherscan (required)
  blocks - an optional range of blocks to slurp

Flags:
  -t, --types strings   which types of transactions to request
                        One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals | all ]
  -p, --appearances     show only the blocknumber.tx_id appearances of the exported transactions
  -a, --articulate      articulate the retrieved data if ABIs can be found
  -S, --source string   the source of the slurped data
                        One of [ etherscan | key ] (default "etherscan")
  -U, --count           for --appearances mode only, display only the count of records
  -s, --sleep float     seconds to sleep between requests (default 0.25)
  -H, --ether           specify value in ether
  -w, --raw             report JSON data from the source with minimal processing
  -o, --cache           force the results of the query into the cache
  -D, --decache         removes related items from the cache
  -x, --fmt string      export format, one of [none|json*|txt|csv]
  -v, --verbose         enable verbose output
  -h, --help            display this help screen

Notes:
  - An address must be either an ENS name or start with '0x' and be forty-two characters long.
  - Portions of this software are Powered by Etherscan.io APIs.
  - The withdrawals option is only available on certain chains. It is ignored otherwise.
  - If the value of --source is key, --types is ignored and only appearances or counts are returned.

Data models produced by this tool:

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 slurpPkg handles the chifra slurp command. It is the first tool we built in the Ethereum space. It even has its has its shortcomings, it does provides some nice features. You may use it to pull any transaction initiated by an EOA for example or to explore mining rewards. Visit the above referenced website for more information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunSlurp

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

RunSlurp handles the slurp command for the command line. Returns error only as per cobra.

func ServeSlurp

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

ServeSlurp handles the slurp command for the API. Returns an error.

Types

type SlurpOptions

type SlurpOptions struct {
	Addrs       []string                 `json:"addrs,omitempty"`       // One or more addresses to slurp from Etherscan
	Blocks      []string                 `json:"blocks,omitempty"`      // An optional range of blocks to slurp
	BlockIds    []identifiers.Identifier `json:"blockIds,omitempty"`    // Block identifiers
	Types       []string                 `json:"types,omitempty"`       // Which types of transactions to request
	Appearances bool                     `json:"appearances,omitempty"` // Show only the blocknumber.tx_id appearances of the exported transactions
	Articulate  bool                     `json:"articulate,omitempty"`  // Articulate the retrieved data if ABIs can be found
	Source      string                   `json:"source,omitempty"`      // The source of the slurped data
	Count       bool                     `json:"count,omitempty"`       // For --appearances mode only, display only the count of records
	Page        uint64                   `json:"page,omitempty"`        // The page to retrieve
	PerPage     uint64                   `json:"perPage,omitempty"`     // The number of records to request on each page
	Sleep       float64                  `json:"sleep,omitempty"`       // Seconds to sleep between requests
	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

}

SlurpOptions provides all command options for the chifra slurp command.

func GetOptions

func GetOptions() *SlurpOptions

func GetSlurpOptions

func GetSlurpOptions(args []string, g *globals.GlobalOptions) *SlurpOptions

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

func (*SlurpOptions) FirstPage

func (opts *SlurpOptions) FirstPage() int

func (*SlurpOptions) HandleAppearances

func (opts *SlurpOptions) HandleAppearances() error

func (*SlurpOptions) HandleAppearancesKey

func (opts *SlurpOptions) HandleAppearancesKey() error

func (*SlurpOptions) HandleCount

func (opts *SlurpOptions) HandleCount() error

func (*SlurpOptions) HandleCountKey

func (opts *SlurpOptions) HandleCountKey() error

func (*SlurpOptions) HandleDecache

func (opts *SlurpOptions) HandleDecache() error

func (*SlurpOptions) HandleShow

func (opts *SlurpOptions) HandleShow() error

func (*SlurpOptions) SlurpInternal

func (opts *SlurpOptions) SlurpInternal() error

SlurpInternal handles the internal workings of the slurp command. Returns an error.

func (*SlurpOptions) String

func (opts *SlurpOptions) String() string

String implements the Stringer interface

Jump to

Keyboard shortcuts

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