listPkg

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

README

chifra list

chifra list takes one or more addresses, queries the index of appearances, and builds TrueBlocks monitors. A TrueBlocks monitor is a file that contains blockNumber.transactionIndex pairs (transaction identifiers) representing the history of the address.

Because TrueBlocks only extracts data from the Ethereum node when it's requested, the first time you list an address it takes about a minute. Subsequent queries are much faster because TrueBlocks caches the results.

Note that chifra list only queries the index, it does not extract the full transactional details. You may use chifra export for that.

Purpose:
  List every appearance of an address anywhere on the chain.

Usage:
  chifra list [flags] <address> [address...]

Arguments:
  addrs - one or more addresses (0x...) to list (required)

Flags:
  -U, --count               display only the count of records for each monitor
  -z, --no_zero             for the --count option only, suppress the display of zero appearance accounts
  -b, --bounds              report first and last block this address appears
  -u, --unripe              list transactions labeled upripe (i.e. less than 28 blocks old)
  -s, --silent              freshen the monitor only (no reporting)
  -c, --first_record uint   the first record to process
  -e, --max_records uint    the maximum number of records to process (default 250)
  -E, --reversed            produce results in reverse chronological order
  -F, --first_block uint    first block to export (inclusive, ignored when freshening)
  -L, --last_block uint     last block to export (inclusive, ignored when freshening)
  -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.
  - No other options are permitted when --silent is selected.

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 listPkg handles the chifra list command. It takes one or more addresses, queries the index of appearances, and builds TrueBlocks monitors. A TrueBlocks monitor is a file that contains blockNumber.transactionIndex pairs (transaction identifiers) representing the history of the address. Because TrueBlocks only extracts data from the Ethereum node when it's requested, the first time you list an address it takes about a minute. Subsequent queries are much faster because TrueBlocks caches the results. Note that chifra list only queries the index, it does not extract the full transactional details. You may use chifra export for that.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunList

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

RunList handles the list command for the command line. Returns error only as per cobra.

func ServeList

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

ServeList handles the list command for the API. Returns an error.

Types

type ListOptions

type ListOptions struct {
	Addrs       []string              `json:"addrs,omitempty"`       // One or more addresses (0x...) to list
	Count       bool                  `json:"count,omitempty"`       // Display only the count of records for each monitor
	NoZero      bool                  `json:"noZero,omitempty"`      // For the --count option only, suppress the display of zero appearance accounts
	Bounds      bool                  `json:"bounds,omitempty"`      // Report first and last block this address appears
	Unripe      bool                  `json:"unripe,omitempty"`      // List transactions labeled upripe (i.e. less than 28 blocks old)
	Silent      bool                  `json:"silent,omitempty"`      // Freshen the monitor only (no reporting)
	FirstRecord uint64                `json:"firstRecord,omitempty"` // The first record to process
	MaxRecords  uint64                `json:"maxRecords,omitempty"`  // The maximum number of records to process
	Reversed    bool                  `json:"reversed,omitempty"`    // Produce results in reverse chronological order
	Publisher   string                `json:"publisher,omitempty"`   // For some query options, the publisher of the index
	FirstBlock  uint64                `json:"firstBlock,omitempty"`  // First block to export (inclusive, ignored when freshening)
	LastBlock   uint64                `json:"lastBlock,omitempty"`   // Last block to export (inclusive, ignored when freshening)
	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
	// EXISTING_CODE
	PublisherAddr base.Address `json:"-"`
}

ListOptions provides all command options for the chifra list command.

func GetListOptions

func GetListOptions(args []string, g *globals.GlobalOptions) *ListOptions

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

func GetOptions

func GetOptions() *ListOptions

func (*ListOptions) GetMax

func (opts *ListOptions) GetMax() uint64

func (*ListOptions) HandleBounds

func (opts *ListOptions) HandleBounds(monitorArray []monitor.Monitor) error

func (*ListOptions) HandleCount

func (opts *ListOptions) HandleCount(monitorArray []monitor.Monitor) error

func (*ListOptions) HandleShow

func (opts *ListOptions) HandleShow(monitorArray []monitor.Monitor) error

func (*ListOptions) IsMax

func (opts *ListOptions) IsMax(cnt uint64) bool

func (*ListOptions) ListInternal

func (opts *ListOptions) ListInternal() error

ListInternal handles the internal workings of the list command. Returns an error.

func (*ListOptions) String

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