statusPkg

package
v0.0.0-...-2a3d9f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

README

chifra status

The chifra status tool reports on the state (and size) of the various TrueBlocks local binary caches. TrueBlocks produces nine difference caches: abis, blocks, monitors, names, objs, recons, slurps, traces, transactions. In general practice, these caches may take up a few GB of hard drive space, however, for very popular smart contract the size of the caches may grow rather large. Keep an eye on it.

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
  -k, --healthcheck         an alias for the diagnose endpoint
  -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.

Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.

Documentation

Overview

statusPkg implements the chifra status command.

The chifra status tool reports on the state (and size) of the various TrueBlocks local binary caches. TrueBlocks produces nine difference caches: abis, blocks, monitors, names, objs, recons, slurps, traces, transactions. In general practice, these caches may take up a few GB of hard drive space, however, for very popular smart contract the size of the caches may grow rather large. Keep an eye on it.

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.

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 *types.MetaData) string

Types

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
	Healthcheck bool                  `json:"healthcheck,omitempty"` // An alias for the diagnose endpoint
	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 StatusFinishParseInternal

func StatusFinishParseInternal(w io.Writer, values url.Values) *StatusOptions

func (*StatusOptions) GetStatus

func (opts *StatusOptions) GetStatus(diagnose bool) (*types.Status, error)

func (*StatusOptions) HandleDiagnose

func (opts *StatusOptions) HandleDiagnose(rCtx *output.RenderCtx) error

func (*StatusOptions) HandleModes

func (opts *StatusOptions) HandleModes(rCtx *output.RenderCtx) error

func (*StatusOptions) HandleShow

func (opts *StatusOptions) HandleShow(rCtx *output.RenderCtx) error

func (*StatusOptions) StatusInternal

func (opts *StatusOptions) StatusInternal(rCtx *output.RenderCtx) 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