tracesPkg

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

README

chifra traces

The chifra traces tool retrieves a transaction's traces. You may specify multiple transaction identifiers per invocation.

The --articulate option fetches the ABI from each encountered smart contract to better describe the reported data.

The --filter option calls your node's trace_filter routine (if available) using a bang-separated string of the same values used by trace_fitler.

Purpose:
  Retrieve traces for the given transaction(s).

Usage:
  chifra traces [flags] <tx_id> [tx_id...]

Arguments:
  transactions - a space-separated list of one or more transaction identifiers (required)

Flags:
  -a, --articulate      articulate the retrieved data if ABIs can be found
  -f, --filter string   call the node's trace_filter routine with bang-separated filter
  -U, --count           display only the number of traces for the transaction (fast)
  -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:
  - The transactions list may be one or more transaction hashes, blockNumber.transactionID pairs, or a blockHash.transactionID pairs.
  - This tool checks for valid input syntax, but does not check that the transaction requested actually exists.
  - If the queried node does not store historical state, the results for most older transactions are undefined.
  - A bang separated filter has the following fields (at least one of which is required) and is separated with a bang (!): fromBlk, toBlk, fromAddr, toAddr, after, count.

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 tracesPkg handles the chifra traces command. It The tool retrieves a transaction's traces. You may specify multiple transaction identifiers per invocation. The --articulate option fetches the ABI from each encountered smart contract to better describe the reported data. The --filter option calls your node's trace_filter routine (if available) using a bang-separated string of the same values used by trace_fitler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunTraces

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

RunTraces handles the traces command for the command line. Returns error only as per cobra.

func ServeTraces

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

ServeTraces handles the traces command for the API. Returns an error.

Types

type TracesOptions

type TracesOptions struct {
	Transactions   []string                 `json:"transactions,omitempty"`   // A space-separated list of one or more transaction identifiers
	TransactionIds []identifiers.Identifier `json:"transactionIds,omitempty"` // Transaction identifiers
	Articulate     bool                     `json:"articulate,omitempty"`     // Articulate the retrieved data if ABIs can be found
	Filter         string                   `json:"filter,omitempty"`         // Call the node's trace_filter routine with bang-separated filter
	Count          bool                     `json:"count,omitempty"`          // Display only the number of traces for the transaction (fast)
	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

}

TracesOptions provides all command options for the chifra traces command.

func GetOptions

func GetOptions() *TracesOptions

func GetTracesOptions

func GetTracesOptions(args []string, g *globals.GlobalOptions) *TracesOptions

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

func (*TracesOptions) HandleCounts

func (opts *TracesOptions) HandleCounts() error

func (*TracesOptions) HandleDecache

func (opts *TracesOptions) HandleDecache() error

func (*TracesOptions) HandleFilter

func (opts *TracesOptions) HandleFilter() error

func (*TracesOptions) HandleShow

func (opts *TracesOptions) HandleShow() error

func (*TracesOptions) String

func (opts *TracesOptions) String() string

String implements the Stringer interface

func (*TracesOptions) TracesInternal

func (opts *TracesOptions) TracesInternal() error

TracesInternal handles the internal workings of the traces command. Returns an error.

Jump to

Keyboard shortcuts

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