v1

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 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

View Source
var SubnetsCount uint64 = 128

SubnetsCount returns the subnet count for v1

Functions

func New

func New() forks.Fork

New returns an instance of ForkV0

Types

type ForkV1

type ForkV1 struct {
}

ForkV1 is the genesis version 0 implementation

func (*ForkV1) AddOptions

func (v1 *ForkV1) AddOptions(opts []libp2p.Option) []libp2p.Option

AddOptions implementation

func (*ForkV1) DecidedTopic

func (v1 *ForkV1) DecidedTopic() string

DecidedTopic returns decided topic name for v1

func (*ForkV1) DecodeNetworkMsg

func (v1 *ForkV1) DecodeNetworkMsg(data []byte) (*message.SSVMessage, error)

DecodeNetworkMsg decodes network message

func (*ForkV1) DecorateNode

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

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

func (*ForkV1) EncodeNetworkMsg

func (v1 *ForkV1) EncodeNetworkMsg(msg *message.SSVMessage) ([]byte, error)

EncodeNetworkMsg encodes network message

func (*ForkV1) GetTopicBaseName

func (v1 *ForkV1) GetTopicBaseName(topicName string) string

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

func (*ForkV1) GetTopicFullName

func (v1 *ForkV1) GetTopicFullName(baseName string) string

GetTopicFullName returns the topic full name, including prefix

func (*ForkV1) MsgID

func (v1 *ForkV1) MsgID() forks.MsgIDFunc

MsgID returns msg_id for the given message

func (*ForkV1) ProtocolID

func (v1 *ForkV1) ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)

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

func (*ForkV1) Subnets

func (v1 *ForkV1) Subnets() int64

Subnets returns the subnets count for this fork

func (*ForkV1) ValidatorTopicID

func (v1 *ForkV1) 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