Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.24.29 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidThreshold  = errors.New("invalid threshold configuration")
	ErrInvalidValidators = errors.New("invalid validators configuration")
	ErrInvalidAlgorithm  = errors.New("invalid algorithm configuration")
	ErrInvalidPort       = errors.New("invalid port configuration")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Network settings
	NetworkID  uint32 `json:"networkId"`
	ChainID    string `json:"chainId"`
	ListenPort uint16 `json:"listenPort"` // Default: 9630

	// ML-KEM configuration
	MLKEMEnabled       bool `json:"mlkemEnabled"`
	MLKEMSecurityLevel int  `json:"mlkemSecurityLevel"` // 512, 768, or 1024
	MLDSAEnabled       bool `json:"mldsaEnabled"`
	MLDSASecurityLevel int  `json:"mldsaSecurityLevel"` // 44, 65, or 87

	// Threshold configuration
	DefaultThreshold   int `json:"defaultThreshold"`   // Default: 3
	DefaultTotalShares int `json:"defaultTotalShares"` // Default: 5
	MaxShares          int `json:"maxShares"`          // Maximum shares allowed

	// Validator configuration
	Validators        []string      `json:"validators"`
	ValidatorTimeout  time.Duration `json:"validatorTimeout"`
	HeartbeatInterval time.Duration `json:"heartbeatInterval"`

	// Storage configuration
	DataDir        string `json:"dataDir"`
	MaxKeys        int    `json:"maxKeys"`
	ShareCacheSize int    `json:"shareCacheSize"`

	// Security configuration
	TLSEnabled  bool   `json:"tlsEnabled"`
	TLSCertPath string `json:"tlsCertPath"`
	TLSKeyPath  string `json:"tlsKeyPath"`
	MTLSEnabled bool   `json:"mtlsEnabled"`
	MTLSCAPath  string `json:"mtlsCaPath"`

	// Performance configuration
	MaxParallelOps int `json:"maxParallelOps"`
	BatchSize      int `json:"batchSize"`

	// Block configuration
	BlockInterval  time.Duration `json:"blockInterval"`
	MaxTxsPerBlock int           `json:"maxTxsPerBlock"`

	// Proactive resharing
	ReshareEnabled  bool          `json:"reshareEnabled"`
	ReshareInterval time.Duration `json:"reshareInterval"`
}

Config holds configuration for the K-Chain VM.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a config with default values.

func ParseConfig

func ParseConfig(data []byte) (Config, error)

ParseConfig parses configuration from JSON bytes.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

Jump to

Keyboard shortcuts

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