genesis

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnknownSubnet is used when a validator public key is invalid
	UnknownSubnet = "unknown"
)

Variables

This section is empty.

Functions

func New

func New() forks.Fork

New returns an instance of ForkV0

Types

type ForkGenesis

type ForkGenesis struct {
}

ForkGenesis is the genesis version 0 implementation

func (*ForkGenesis) AddOptions

func (g *ForkGenesis) AddOptions(opts []libp2p.Option) []libp2p.Option

AddOptions implementation

func (*ForkGenesis) DecidedTopic

func (genesis *ForkGenesis) DecidedTopic() string

DecidedTopic returns decided topic name for v1

func (*ForkGenesis) DecodeNetworkMsg

func (g *ForkGenesis) DecodeNetworkMsg(data []byte) (*spectypes.SSVMessage, error)

DecodeNetworkMsg decodes network message

func (*ForkGenesis) DecorateNode

func (f *ForkGenesis) DecorateNode(node *enode.LocalNode, args map[string]interface{}) error

DecorateNode will enrich the local node record with more entries, according to current fork

func (*ForkGenesis) EncodeNetworkMsg

func (g *ForkGenesis) EncodeNetworkMsg(msg *spectypes.SSVMessage) ([]byte, error)

EncodeNetworkMsg encodes network message

func (*ForkGenesis) GetTopicBaseName

func (genesis *ForkGenesis) GetTopicBaseName(topicName string) string

GetTopicBaseName return the base topic name of the topic, w/o ssv prefix

func (*ForkGenesis) GetTopicFullName

func (genesis *ForkGenesis) GetTopicFullName(baseName string) string

GetTopicFullName returns the topic full name, including prefix

func (*ForkGenesis) MsgID

func (genesis *ForkGenesis) MsgID() forks.MsgIDFunc

MsgID returns msg_id for the given message

func (*ForkGenesis) ProtocolID

func (f *ForkGenesis) ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)

ProtocolID returns the protocol id of the given protocol, and the amount of peers for distribution

func (*ForkGenesis) Subnets

func (genesis *ForkGenesis) Subnets() int

Subnets returns the subnets count for this fork

func (*ForkGenesis) ValidatorSubnet

func (genesis *ForkGenesis) ValidatorSubnet(validatorPKHex string) int

ValidatorSubnet returns the subnet for the given validator

func (*ForkGenesis) ValidatorTopicID

func (genesis *ForkGenesis) ValidatorTopicID(pkByts []byte) []string

ValidatorTopicID returns the topic to use for the given validator

Jump to

Keyboard shortcuts

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