Documentation ¶
Overview ¶
slurpPkg implements the chifra slurp command.
chifra slurp is the first tool we built in the Ethereum space. It even has its [own website](http://ethslurp.com).
While it's useful, it has two shortcomings. First, it is fully centralized, pulling its data from [http://etherscan.io](http://etherscan.io). Second, is that it does not report every transaction for a given account. This is actually a shortcoming with API providers. 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.
Currently supported API providers: - [TrueBlocks Key](https://key.trueblocks.io) - Etherscan - Covalent - Alchemy
Index ¶
- func ResetOptions(testMode bool)
- func RunSlurp(cmd *cobra.Command, args []string) error
- func ServeSlurp(w http.ResponseWriter, r *http.Request) error
- type SlurpOptions
- func (opts *SlurpOptions) Addresses() []base.Address
- func (opts *SlurpOptions) HandleAppearances(rCtx *output.RenderCtx) error
- func (opts *SlurpOptions) HandleCount(rCtx *output.RenderCtx) error
- func (opts *SlurpOptions) HandleDecache(rCtx *output.RenderCtx) error
- func (opts *SlurpOptions) HandleShow(rCtx *output.RenderCtx) error
- func (opts *SlurpOptions) Provider() (provider.Provider, error)
- func (opts *SlurpOptions) Query() *provider.Query
- func (opts *SlurpOptions) SlurpInternal(rCtx *output.RenderCtx) error
- func (opts *SlurpOptions) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetOptions ¶
func ResetOptions(testMode bool)
func RunSlurp ¶
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 Parts []string `json:"parts,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 (page number) PageId string `json:"pageId,omitempty"` // The page to retrieve (page ID) PerPage uint64 `json:"perPage,omitempty"` // The number of records to request on each page Sleep float64 `json:"sleep,omitempty"` // Seconds to sleep between requests Types []string `json:"types,omitempty"` // Deprecated, use --parts instead 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 SlurpFinishParseInternal ¶
func SlurpFinishParseInternal(w io.Writer, values url.Values) *SlurpOptions
func (*SlurpOptions) HandleAppearances ¶
func (opts *SlurpOptions) HandleAppearances(rCtx *output.RenderCtx) error
func (*SlurpOptions) HandleCount ¶
func (opts *SlurpOptions) HandleCount(rCtx *output.RenderCtx) error
func (*SlurpOptions) HandleDecache ¶
func (opts *SlurpOptions) HandleDecache(rCtx *output.RenderCtx) error
func (*SlurpOptions) HandleShow ¶
func (opts *SlurpOptions) HandleShow(rCtx *output.RenderCtx) error
func (*SlurpOptions) Provider ¶
func (opts *SlurpOptions) Provider() (provider.Provider, error)
Provider returns 3rd party RPC provider based on --source
func (*SlurpOptions) Query ¶
func (opts *SlurpOptions) Query() *provider.Query
func (*SlurpOptions) SlurpInternal ¶
func (opts *SlurpOptions) SlurpInternal(rCtx *output.RenderCtx) 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