config

package
v0.0.0-...-c15aa5a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: GPL-3.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLayers           = 3
	DefaultMinNodesPerLayer = 2
)

Variables

View Source
var DefaultParameters = katconfig.Parameters{
	SendRatePerMinute: defaultSendRatePerMinute,
	Mu:                defaultMu,
	MuMaxDelay:        uint64(math.Min(rand.ExpQuantile(defaultMu, defaultMuMaxPercentile), absoluteMaxDelay)),
	LambdaP:           defaultLambdaP,
	LambdaPMaxDelay:   uint64(rand.ExpQuantile(defaultLambdaP, defaultLambdaPMaxPercentile)),
	LambdaL:           defaultLambdaL,
	LambdaLMaxDelay:   uint64(rand.ExpQuantile(defaultLambdaL, defaultLambdaLMaxPercentile)),
	LambdaD:           defaultLambdaD,
	LambdaDMaxDelay:   uint64(rand.ExpQuantile(defaultLambdaD, defaultLambdaDMaxPercentile)),
	LambdaM:           defaultLambdaM,
	LambdaMMaxDelay:   uint64(rand.ExpQuantile(defaultLambdaM, defaultLambdaMMaxPercentile)),
}

TODO: do we need to cap the default value of LambdaP/LambdaL/LambdaD/LambdaM max delay?

Functions

func WriteConfigFile

func WriteConfigFile(f string, config *Config) error

WriteConfigFile saves the config to the provided file

Types

type Config

type Config struct {
	TendermintConfigPath string
	DBPath               string
	Layers               int
	MinNodesPerLayer     int
	Parameters           katconfig.Parameters
}

func DefaultConfig

func DefaultConfig() (cfg *Config)

func Load

func Load(b []byte) (*Config, error)

Load parses and validates the provided buffer b as a config file body and returns the Config.

func LoadFile

func LoadFile(f string) (*Config, error)

LoadFile loads, parses, and validates the provided file and returns the Config.

func (*Config) FixupAndValidate

func (c *Config) FixupAndValidate() (err error)

FixupAndValidate applies defaults to config entries and validates the supplied configuration. Most people should call one of the Load variants instead.

Jump to

Keyboard shortcuts

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