receiptsPkg

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

README

chifra receipts

chifra receipts returns the given transaction's receipt. You may specify multiple transaction identifiers per invocation.

The --articulate option fetches the ABI from each encountered smart contract (including those encountered in a trace--if the --trace option is enabled) to better describe the reported data.

Generally speaking, this tool is less useful than others as you may report the same data using chifra transactions and more focused data using chifra logs. It is included here for completeness, as the receipt is a fundamental data structure in Ethereum.

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

Usage:
  chifra receipts [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
  -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.

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 receiptsPkg handles the chifra receipts command. It returns the given transaction's receipt. You may specify multiple transaction identifiers per invocation. The --articulate option fetches the ABI from each encountered smart contract (including those encountered in a trace--if the --trace option is enabled) to better describe the reported data. Generally speaking, this tool is less useful than others as you may report the same data using chifra transactions and more focused data using chifra logs. It is included here for completeness, as the receipt is a fundamental data structure in Ethereum.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunReceipts

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

RunReceipts handles the receipts command for the command line. Returns error only as per cobra.

func ServeReceipts

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

ServeReceipts handles the receipts command for the API. Returns an error.

Types

type ReceiptsOptions

type ReceiptsOptions 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
	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

}

ReceiptsOptions provides all command options for the chifra receipts command.

func GetOptions

func GetOptions() *ReceiptsOptions

func GetReceiptsOptions

func GetReceiptsOptions(args []string, g *globals.GlobalOptions) *ReceiptsOptions

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

func (*ReceiptsOptions) HandleDecache

func (opts *ReceiptsOptions) HandleDecache() error

func (*ReceiptsOptions) HandleShow

func (opts *ReceiptsOptions) HandleShow() error

func (*ReceiptsOptions) ReceiptsInternal

func (opts *ReceiptsOptions) ReceiptsInternal() error

ReceiptsInternal handles the internal workings of the receipts command. Returns an error.

func (*ReceiptsOptions) String

func (opts *ReceiptsOptions) 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