config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.Mutex

	*p2p.TestP2P

	ID                           uint64
	Port                         int
	ProxiesPortStart             int
	Host                         string
	Spec                         *beacon.Spec
	ExternalIP                   net.IP
	BeaconGenesisTime            beacon.Timestamp
	GenesisValidatorsRoot        tree.Root
	ValidatorKeys                map[beacon.ValidatorIndex]*ValidatorKey
	ValidatorKeysList            []*ValidatorKey
	AlwaysErrorValidatorResponse bool

	SlotAction          slot_actions.SlotAction
	SlotActionFrequency uint64
}

func (*Config) Apply

func (cfg *Config) Apply(opts ...Option) error

type Option

type Option struct {
	// contains filtered or unexported fields
}

func WithAlwaysErrorValidatorResponse

func WithAlwaysErrorValidatorResponse() Option

func WithBeaconGenesisTime

func WithBeaconGenesisTime(t beacon.Timestamp) Option

func WithBeaconPortStart

func WithBeaconPortStart(port int) Option

func WithExternalIP

func WithExternalIP(ip net.IP) Option

func WithGenesisValidatorsRoot

func WithGenesisValidatorsRoot(t tree.Root) Option

func WithHost

func WithHost(host string) Option

func WithID

func WithID(id uint64) Option

func WithLogLevel

func WithLogLevel(level string) Option

func WithMaxDevP2PSessionReuses

func WithMaxDevP2PSessionReuses(reuse int) Option

func WithPort

func WithPort(port int) Option

func WithProxiesPortStart

func WithProxiesPortStart(portStart int) Option

func WithSlotAction

func WithSlotAction(action slot_actions.SlotAction) Option

func WithSlotActionFrequency

func WithSlotActionFrequency(freq uint64) Option

func WithSpec

func WithSpec(spec *beacon.Spec) Option

func WithValidatorKeys

func WithValidatorKeys(vk map[beacon.ValidatorIndex]*ValidatorKey) Option

func WithValidatorKeysList

func WithValidatorKeysList(vk []*ValidatorKey) Option

func WithValidatorKeysListFromFile

func WithValidatorKeysListFromFile(path string) Option

func WithValidatorKeysListFromFolder

func WithValidatorKeysListFromFolder(path string) Option

func (Option) MarshalText

func (o Option) MarshalText() ([]byte, error)

type ValidatorKey

type ValidatorKey struct {
	// ValidatorSecretKey is the serialized secret key for validator duties
	ValidatorSecretKey [32]byte
	// ValidatorPubkey is the serialized pubkey derived from ValidatorSecretKey
	ValidatorPubkey [48]byte
}

func KeyListFromFile

func KeyListFromFile(path string) ([]*ValidatorKey, error)

func KeyListFromFolder

func KeyListFromFolder(pathStr string) ([]*ValidatorKey, error)

func (*ValidatorKey) FillPubKey

func (vk *ValidatorKey) FillPubKey() error

func (*ValidatorKey) FromHex

func (vk *ValidatorKey) FromHex(secretKeyHex string) error

Jump to

Keyboard shortcuts

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