config

package
v0.0.0-...-02f1fe4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDefault

func GenerateDefault(path string) error

GenerateDefault generates a default configuration file.

func StateChangeTypeFromString

func StateChangeTypeFromString(s string) test.StateChangeType

StateChangeTypeFromString convert a string to test.StateChangeType.

func StateChangeValueFromString

func StateChangeValueFromString(
	t test.StateChangeType, v string) interface{}

StateChangeValueFromString converts a string to a value for state change request.

Types

type Change

type Change struct {
	Round uint64
	Type  string
	Value string
}

Change represent future configuration changes.

func (Change) RegisterChange

func (c Change) RegisterChange(gov *test.Governance) error

RegisterChange reigster this change to a test.Governance instance.

type Config

type Config struct {
	Title      string
	Node       Node
	Networking Networking
	Scheduler  Scheduler
}

Config represents the configuration for simulation.

func Read

func Read(path string) (*Config, error)

Read reads the config from a file.

type Consensus

type Consensus struct {
	GenesisCRS       string `toml:"genesis_crs"`
	LambdaBA         int    `toml:"lambda_ba"`
	LambdaDKG        int    `toml:"lambda_dkg"`
	RoundLength      int
	NotarySetSize    uint32
	DKGSetSize       uint32 `toml:"dkg_set_size"`
	MinBlockInterval int
}

Consensus settings.

type LatencyModel

type LatencyModel struct {
	Mean  float64
	Sigma float64
}

LatencyModel for ths simulation.

type Legacy

type Legacy struct {
	ProposeIntervalMean  float64
	ProposeIntervalSigma float64
}

Legacy config.

type Networking

type Networking struct {
	Type       test.NetworkType
	PeerServer string
	Direct     LatencyModel
	Gossip     LatencyModel
}

Networking config.

type Node

type Node struct {
	Consensus Consensus
	Legacy    Legacy
	Num       uint32
	MaxBlock  uint64
	Changes   []Change
}

Node config for the simulation.

type Scheduler

type Scheduler struct {
	WorkerNum int
}

Scheduler Settings.

Jump to

Keyboard shortcuts

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