Documentation
¶
Overview ¶
monitorsPkg implements the chifra monitors command.
chifra monitors has allows you to display information about the current set of monitors. This is not to be confused with the monitoring function available from the khedra tool. Please see that [Khedra Book for more information](https://khedra.trueblocks.io/).
### Crud commands
chifra list creates a new monitor. See that tool's help file for more information.
The chifra monitors --delete command deletes (or --undelete if already deleted) an address but does not remove it from your hard drive. The monitor is marked as being deleted, making it invisible to other tools.
Use the --remove command to permanently remove a monitor from your computer. This is an irreversible operation and requires the monitor to have been previously deleted.
The --decache option will remove not only the monitor but all of the cached data associated with the monitor (for example, transactions or traces). This is an irreversible operation (except for the fact that the cache can be easily re-created with chifra list <address>). The monitor need not have been previously deleted.
Index ¶
- func GetMonitorMap(chain string) (map[base.Address]*monitor.Monitor, []*monitor.Monitor)
- func ResetOptions(testMode bool)
- func RunMonitors(cmd *cobra.Command, args []string) error
- func ServeMonitors(w http.ResponseWriter, r *http.Request) error
- type MonitorsOptions
- func (opts *MonitorsOptions) FreshenMonitorsForWatch(addrs []base.Address) (bool, error)
- func (opts *MonitorsOptions) HandleClean(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) HandleCount(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) HandleCrud(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) HandleDecache(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) HandleList(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) HandleShow(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) MonitorsInternal(rCtx *output.RenderCtx) error
- func (opts *MonitorsOptions) String() string
- type Scraper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMonitorMap ¶
func ResetOptions ¶
func ResetOptions(testMode bool)
func RunMonitors ¶
RunMonitors handles the monitors command for the command line. Returns error only as per cobra.
func ServeMonitors ¶
func ServeMonitors(w http.ResponseWriter, r *http.Request) error
ServeMonitors handles the monitors command for the API. Returns an error.
Types ¶
type MonitorsOptions ¶
type MonitorsOptions struct {
Addrs []string `json:"addrs,omitempty"` // One or more addresses (0x...) to process
Delete bool `json:"delete,omitempty"` // Delete a monitor, but do not remove it
Undelete bool `json:"undelete,omitempty"` // Undelete a previously deleted monitor
Remove bool `json:"remove,omitempty"` // Remove a previously deleted monitor
Clean bool `json:"clean,omitempty"` // Clean (i.e. remove duplicate appearances) from monitors, optionally clear stage
List bool `json:"list,omitempty"` // List monitors in the cache (--verbose for more detail)
Count bool `json:"count,omitempty"` // Show the number of active monitors (included deleted but not removed monitors)
Staged bool `json:"staged,omitempty"` // For --clean, --list, and --count options only, include staged monitors
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
}
MonitorsOptions provides all command options for the chifra monitors command.
func GetMonitorsOptions ¶
func GetMonitorsOptions(args []string, g *globals.GlobalOptions) *MonitorsOptions
GetMonitorsOptions returns the options for this tool so other tools may use it.
func GetOptions ¶
func GetOptions() *MonitorsOptions
func MonitorsFinishParseInternal ¶
func MonitorsFinishParseInternal(w io.Writer, values url.Values) *MonitorsOptions
func (*MonitorsOptions) FreshenMonitorsForWatch ¶
func (opts *MonitorsOptions) FreshenMonitorsForWatch(addrs []base.Address) (bool, error)
func (*MonitorsOptions) HandleClean ¶
func (opts *MonitorsOptions) HandleClean(rCtx *output.RenderCtx) error
HandleClean handles the chifra monitors --clean command.
func (*MonitorsOptions) HandleCount ¶
func (opts *MonitorsOptions) HandleCount(rCtx *output.RenderCtx) error
HandleCount handles the chifra abis --count command.
func (*MonitorsOptions) HandleCrud ¶
func (opts *MonitorsOptions) HandleCrud(rCtx *output.RenderCtx) error
HandleCrud handles the chifra monitors delete, undelete, remove and decache commands.
[State] | Delete | Undelete | Remove | ------------|--------|-------------------| Not Deleted | Delete | Error | Error | Deleted | Error | Undelete | Remove | ------------|--------|-------------------|
func (*MonitorsOptions) HandleDecache ¶
func (opts *MonitorsOptions) HandleDecache(rCtx *output.RenderCtx) error
func (*MonitorsOptions) HandleList ¶
func (opts *MonitorsOptions) HandleList(rCtx *output.RenderCtx) error
HandleList handles the chifra monitors --list command.
func (*MonitorsOptions) HandleShow ¶
func (opts *MonitorsOptions) HandleShow(rCtx *output.RenderCtx) error
func (*MonitorsOptions) MonitorsInternal ¶
func (opts *MonitorsOptions) MonitorsInternal(rCtx *output.RenderCtx) error
MonitorsInternal handles the internal workings of the monitors command. Returns an error.
func (*MonitorsOptions) String ¶
func (opts *MonitorsOptions) String() string
String implements the Stringer interface