app

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []*cli.Command{
	{
		Name:  "debug",
		Usage: "Debug utilities",
		Subcommands: []*cli.Command{
			{
				Name:   "consensus-key",
				Action: DebugConsensusKeyRun,
				Flags:  Flags,
			},
			{
				Name:   "denom",
				Action: DebugDenomRun,
				Flags:  Flags,
			},
			{
				Name:   "validator",
				Action: DebugValidatorRun,
				Flags:  Flags,
			},
		},
	},
}
View Source
var Flags = []cli.Flag{
	&cli.StringFlag{
		Name:  "chain-id",
		Usage: "to ensure all nodes matches the specific network (dismiss to auto-detected)",
	},
	&cli.StringFlag{
		Name:  "http-addr",
		Usage: "http server address",
		Value: ":8080",
	},
	&cli.StringFlag{
		Name:  "log-level",
		Usage: "log level (debug, info, warn, error)",
		Value: "info",
	},
	&cli.StringFlag{
		Name:  "namespace",
		Usage: "namespace for Prometheus metrics",
		Value: "cosmos_validator_watcher",
	},
	&cli.BoolFlag{
		Name:  "no-color",
		Usage: "disable colored output",
	},
	&cli.StringSliceFlag{
		Name:  "node",
		Usage: "rpc node endpoint to connect to (specify multiple for high availability)",
		Value: cli.NewStringSlice("http://localhost:26657"),
	},
	&cli.BoolFlag{
		Name:  "no-gov",
		Usage: "disable calls to gov module (useful for consumer chains)",
	},
	&cli.BoolFlag{
		Name:  "no-staking",
		Usage: "disable calls to staking module (useful for consumer chains)",
	},
	&cli.StringFlag{
		Name:  "denom",
		Usage: "denom used in metrics label (eg. atom or uatom)",
	},
	&cli.UintFlag{
		Name:  "denom-exponent",
		Usage: "denom exponent (eg. 6 for atom, 1 for uatom)",
	},
	&cli.DurationFlag{
		Name:  "start-timeout",
		Usage: "timeout to wait on startup for one node to be ready",
		Value: 10 * time.Second,
	},
	&cli.DurationFlag{
		Name:  "stop-timeout",
		Usage: "timeout to wait on stop",
		Value: 10 * time.Second,
	},
	&cli.StringSliceFlag{
		Name:  "validator",
		Usage: "validator address(es) to track (use :my-label to add a custom label in metrics & ouput)",
	},
	&cli.StringFlag{
		Name:  "webhook-url",
		Usage: "endpoint where to send upgrade webhooks (experimental)",
	},
	&cli.StringFlag{
		Name:  "x-gov",
		Usage: "version of the gov module to use (v1|v1beta1)",
		Value: "v1",
	},
}

Functions

func DebugConsensusKeyRun added in v0.9.0

func DebugConsensusKeyRun(cCtx *cli.Context) error

func DebugDenomRun added in v0.9.0

func DebugDenomRun(cCtx *cli.Context) error

func DebugValidatorRun added in v0.9.0

func DebugValidatorRun(cCtx *cli.Context) error

func RunFunc

func RunFunc(cCtx *cli.Context) error

Types

type HTTPMuxOption added in v0.6.0

type HTTPMuxOption func(*http.ServeMux)

func WithLiveProbe added in v0.6.0

func WithLiveProbe(probe Probe) HTTPMuxOption

func WithMetrics added in v0.6.0

func WithMetrics(registry *prometheus.Registry) HTTPMuxOption

func WithReadyProbe added in v0.6.0

func WithReadyProbe(probe Probe) HTTPMuxOption

type HTTPServer

type HTTPServer struct {
	*http.Server
}

func NewHTTPServer

func NewHTTPServer(addr string, options ...HTTPMuxOption) *HTTPServer

func (*HTTPServer) Run

func (s *HTTPServer) Run() error

func (*HTTPServer) Shutdown

func (s *HTTPServer) Shutdown(ctx context.Context) error

type Probe

type Probe func() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL