statusPkg

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

README

chifra status

The chifra status program allows you to manage the various TrueBlocks caches. You may list all of the caches, some of the cache, or even individual caches either in terse or full detail. The cache of interest is specified with the modes option.

TrueBlocks maintains caches for the index of address appearances, named addresses, abi files, as well as other data including blockchain data, and address monitors.

Purpose:
  Report on the state of the internal binary caches.

Usage:
  chifra status <mode> [mode...] [flags]

Arguments:
  modes - the (optional) name of the binary cache to report on, terse otherwise
	One or more of [ index | blooms | blocks | transactions | traces | logs | statements | results | state | tokens | monitors | names | abis | slurps | staging | unripe | maps | some | all ]

Flags:
  -d, --diagnose            same as the default but with additional diagnostics
  -c, --first_record uint   the first record to process
  -e, --max_records uint    the maximum number of records to process (default 10000)
  -a, --chains              include a list of chain configurations in the output
  -x, --fmt string          export format, one of [none|json*|txt|csv]
  -v, --verbose             enable verbose output
  -h, --help                display this help screen

Notes:
  - The some mode includes index, monitors, names, slurps, and abis.
  - If no mode is supplied, a terse report is generated.

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 statusPkg handles the chifra status command. It The program allows you to manage the various TrueBlocks caches. You may list all of the caches, some of the cache, or even individual caches either in terse or full detail. The cache of interest is specified with the modes option. TrueBlocks maintains caches for the index of address appearances, named addresses, abi files, as well as other data including blockchain data, and address monitors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunStatus

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

RunStatus handles the status command for the command line. Returns error only as per cobra.

func ServeStatus

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

ServeStatus handles the status command for the API. Returns an error.

func ToProgress

func ToProgress(chain string, diagnose bool, meta *rpc.MetaData) string

Types

type CCacheItemArray

type CCacheItemArray []simpleCacheItem

type CChainArray

type CChainArray []types.SimpleChain

type CacheWalker

type CacheWalker struct {
	// contains filtered or unexported fields
}

type StatusOptions

type StatusOptions struct {
	Modes       []string              `json:"modes,omitempty"`       // The (optional) name of the binary cache to report on, terse otherwise
	Diagnose    bool                  `json:"diagnose,omitempty"`    // Same as the default but with additional diagnostics
	FirstRecord uint64                `json:"firstRecord,omitempty"` // The first record to process
	MaxRecords  uint64                `json:"maxRecords,omitempty"`  // The maximum number of records to process
	Chains      bool                  `json:"chains,omitempty"`      // Include a list of chain configurations in the output
	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
	ModeTypes []walk.CacheType `json:"-"`
}

StatusOptions provides all command options for the chifra status command.

func GetOptions

func GetOptions() *StatusOptions

func GetStatusOptions

func GetStatusOptions(args []string, g *globals.GlobalOptions) *StatusOptions

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

func (*StatusOptions) GetSimpleStatus

func (opts *StatusOptions) GetSimpleStatus(diagnose bool) (*simpleStatus, error)

func (*StatusOptions) HandleCaches

func (opts *StatusOptions) HandleCaches() error

func (*StatusOptions) HandleDiagnose

func (opts *StatusOptions) HandleDiagnose() error

func (*StatusOptions) HandleShow

func (opts *StatusOptions) HandleShow() error

func (*StatusOptions) StatusInternal

func (opts *StatusOptions) StatusInternal() error

StatusInternal handles the internal workings of the status command. Returns an error.

func (*StatusOptions) String

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