command

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConsensusFlag  = "consensus"
	NoDiscoverFlag = "no-discover"
	BootnodeFlag   = "bootnode"
	LogLevelFlag   = "log-level"

	ValidatorFlag         = "validators"
	ValidatorRootFlag     = "validators-path"
	ValidatorPrefixFlag   = "validators-prefix"
	MinValidatorCountFlag = "min-validator-count"
	MaxValidatorCountFlag = "max-validator-count"

	IBFTValidatorTypeFlag = "ibft-validator-type"
)

Flags shared across multiple spaces

View Source
const (
	DefaultValidatorRoot   = "./"
	DefaultValidatorPrefix = "test-chain-"
)
View Source
const (
	DefaultGenesisFileName           = "genesis.json"
	DefaultChainName                 = "xgrchain"
	DefaultChainID                   = 100
	DefaultConsensus                 = server.PolyBFTConsensus
	DefaultGenesisGasUsed            = 458752  // 0x70000
	DefaultGenesisGasLimit           = 5242880 // 0x500000
	DefaultGenesisBaseFeeEM          = chain.GenesisBaseFeeEM
	DefaultGenesisBaseFeeChangeDenom = chain.BaseFeeChangeDenom
)
View Source
const (
	JSONOutputFlag  = "json"
	GRPCAddressFlag = "grpc-address"
	JSONRPCFlag     = "jsonrpc"
)
View Source
const (
	GRPCAddressFlagLEGACY = "grpc"
)

GRPCAddressFlagLEGACY Legacy flag that needs to be present to preserve backwards compatibility with running clients

Variables

View Source
var (
	ErrValidatorNumberExceedsMax = errors.New("validator number exceeds max validator number")
	ErrECDSAKeyNotFound          = errors.New("ECDSA key not found in given path")
	ErrBLSKeyNotFound            = errors.New("BLS key not found in given path")
)
View Source
var (
	DefaultStake                = ethgo.Ether(1e6)
	DefaultPremineBalance       = ethgo.Ether(1e6)
	DefaultGenesisBaseFee       = chain.GenesisBaseFee
	DefaultGenesisBaseFeeConfig = fmt.Sprintf(
		"%d:%d:%d",
		DefaultGenesisBaseFee,
		DefaultGenesisBaseFeeEM,
		DefaultGenesisBaseFeeChangeDenom,
	)
)

Functions

func GetValidatorsFromPrefixPath

func GetValidatorsFromPrefixPath(
	root string,
	prefix string,
	validatorType validators.ValidatorType,
) (validators.Validators, error)

GetValidatorsFromPrefixPath extracts the addresses of the validators based on the directory prefix. It scans the directories for validator private keys and compiles a list of addresses

func ValidateMinMaxValidatorsNumber

func ValidateMinMaxValidatorsNumber(minValidatorCount uint64, maxValidatorCount uint64) error

Types

type CommandResult

type CommandResult interface {
	GetOutput() string
}

type OutputFormatter

type OutputFormatter interface {
	// SetError sets the encountered error
	SetError(err error)

	// SetCommandResult sets the result of the command execution
	SetCommandResult(result CommandResult)

	// WriteOutput writes the previously set result / error output
	WriteOutput()

	// WriteCommandResult immediately writes the given command result without waiting for WriteOutput func call.
	WriteCommandResult(result CommandResult)

	// Write extends io.Writer interface
	Write(p []byte) (n int, err error)
}

OutputFormatter is the standardized interface all output formatters should use

func InitializeOutputter

func InitializeOutputter(cmd *cobra.Command) OutputFormatter

type Results

type Results []CommandResult

Results implements CommandResult interface by aggregating multiple commands outputs into one

func (Results) GetOutput

func (r Results) GetOutput() string

Jump to

Keyboard shortcuts

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