v2

package
v0.2.1-rc.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 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 ForkV2

type ForkV2 struct {
}

ForkV2 is the genesis version 0 implementation

func (*ForkV2) AddOptions

func (v2 *ForkV2) AddOptions(opts []libp2p.Option) []libp2p.Option

AddOptions implementation

func (*ForkV2) DecidedTopic

func (v2 *ForkV2) DecidedTopic() string

DecidedTopic returns decided topic name for v1

func (*ForkV2) DecodeNetworkMsg

func (v2 *ForkV2) DecodeNetworkMsg(data []byte) (*message.SSVMessage, error)

DecodeNetworkMsg decodes network message

func (*ForkV2) DecorateNode

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

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

func (*ForkV2) EncodeNetworkMsg

func (v2 *ForkV2) EncodeNetworkMsg(msg *message.SSVMessage) ([]byte, error)

EncodeNetworkMsg encodes network message

func (*ForkV2) GetTopicBaseName

func (v2 *ForkV2) GetTopicBaseName(topicName string) string

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

func (*ForkV2) GetTopicFullName

func (v2 *ForkV2) GetTopicFullName(baseName string) string

GetTopicFullName returns the topic full name, including prefix

func (*ForkV2) MsgID

func (v2 *ForkV2) MsgID() forks.MsgIDFunc

MsgID returns msg_id for the given message

func (*ForkV2) ProtocolID

func (v2 *ForkV2) ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)

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

func (*ForkV2) Subnets

func (v2 *ForkV2) Subnets() int

Subnets returns the subnets count for this fork

func (*ForkV2) ValidatorSubnet

func (v2 *ForkV2) ValidatorSubnet(validatorPKHex string) int

ValidatorSubnet returns the subnet for the given validator

func (*ForkV2) ValidatorTopicID

func (v2 *ForkV2) 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