cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogLevelFlag = &cli.StringFlag{
		Name:    "log.level",
		Usage:   "The lowest log level that will be output",
		Value:   "info",
		EnvVars: []string{"LOG_LEVEL"},
	}
	LogFormatFlag = &cli.StringFlag{
		Name:    "log.format",
		Usage:   "Format the log output. Supported formats: 'text', 'json'",
		Value:   "text",
		EnvVars: []string{"LOG_FORMAT"},
	}
	LogColorFlag = &cli.BoolFlag{
		Name:    "log.color",
		Usage:   "Color the log output",
		EnvVars: []string{"LOG_COLOR"},
	}
)
View Source
var (
	PerfPerfFlag = &cli.PathFlag{
		Name:      "perf",
		Usage:     "Path to validator perf database to output to",
		TakesFile: true,
		Value:     "perf_db",
		Required:  false,
	}
	PerfEraFlag = &cli.PathFlag{
		Name:      "era",
		Usage:     "Path to era store dir",
		TakesFile: true,
		Required:  true,
	}
	PerfStartEpochFlag = &cli.Uint64Flag{
		Name:  "start-epoch",
		Usage: "Start epoch (inclusive) of validator performance data to update",
		Value: uint64(0),
	}
	PerfEndEpochFlag = &cli.Uint64Flag{
		Name:  "end-epoch",
		Usage: "End epoch (exclusive) of validator performance data to update",
		Value: ^uint64(0),
	}
	PerfWorkersFlag = &cli.IntFlag{
		Name:  "workers",
		Usage: "number of workers to used to process in parallel",
		Value: 8,
	}
)
View Source
var (
	ServerListenAddrFlag = &cli.StringFlag{
		Name:  "listen",
		Usage: "listen address to bind to",
		Value: "0.0.0.0:8080",
	}
	ServerPublicFlag = cli.StringFlag{
		Name:  "public",
		Usage: "public endpoint to use for API queries",
		Value: "127.0.0.1:8080",
	}
	ServerTilesFlag = &cli.PathFlag{
		Name:  "tiles",
		Usage: "path to tiles db to read tile data from",
		Value: "tiles_db",
	}
)
View Source
var (
	TilesPerfFlag = &cli.PathFlag{
		Name:      "perf",
		Usage:     "Path to validator perf database to read from",
		TakesFile: true,
		Value:     "perf_db",
		Required:  false,
	}
	TilesTilesFlag = &cli.PathFlag{
		Name:  "tiles",
		Usage: "path to tiles db to write tile data to",
		Value: "tiles_db",
	}
	TilesStartEpochFlag = &cli.Uint64Flag{
		Name:  "start-epoch",
		Usage: "Start epoch (inclusive) of tiles to update",
		Value: uint64(0),
	}
	TilesEndEpochFlag = &cli.Uint64Flag{
		Name:  "end-epoch",
		Usage: "End epoch (exclusive) of tiles to update",
		Value: ^uint64(0),
	}
)
View Source
var PerfCmd = &cli.Command{
	Name:        "perf",
	Usage:       "Compute validators performance in epoch range.",
	Description: "Compute validators performance in epoch range.",
	Action:      Perf,
	Flags: []cli.Flag{
		LogLevelFlag,
		LogFormatFlag,
		LogColorFlag,
		PerfPerfFlag,
		PerfEraFlag,
		PerfStartEpochFlag,
		PerfEndEpochFlag,
		PerfWorkersFlag,
	},
}
View Source
var ServerCmd = &cli.Command{
	Name:        "server",
	Usage:       "Run http server.",
	Description: "Run http server.",
	Action:      Server,
	Flags: []cli.Flag{
		LogLevelFlag,
		LogFormatFlag,
		LogColorFlag,
		ServerListenAddrFlag,
		ServerTilesFlag,
	},
}
View Source
var TilesCmd = &cli.Command{
	Name:        "tiles",
	Usage:       "Compute tiles for range of epochs.",
	Description: "Compute tiles for range of epochs.",
	Action:      Tiles,
	Flags: []cli.Flag{
		LogLevelFlag,
		LogFormatFlag,
		LogColorFlag,
		TilesPerfFlag,
		TilesTilesFlag,
		TilesStartEpochFlag,
		TilesEndEpochFlag,
	},
}

Functions

func Perf

func Perf(ctx *cli.Context) error

func Server

func Server(ctx *cli.Context) error

func SetupLogger

func SetupLogger(ctx *cli.Context) (log.Logger, error)

func Tiles

func Tiles(ctx *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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