Documentation ¶
Index ¶
- Constants
- func New() forks.Fork
- type ForkGenesis
- func (g *ForkGenesis) AddOptions(opts []libp2p.Option) []libp2p.Option
- func (genesis *ForkGenesis) DecidedTopic() string
- func (g *ForkGenesis) DecodeNetworkMsg(data []byte) (*spectypes.SSVMessage, error)
- func (f *ForkGenesis) DecorateNode(node *enode.LocalNode, args map[string]interface{}) error
- func (g *ForkGenesis) EncodeNetworkMsg(msg *spectypes.SSVMessage) ([]byte, error)
- func (genesis *ForkGenesis) GetTopicBaseName(topicName string) string
- func (genesis *ForkGenesis) GetTopicFullName(baseName string) string
- func (genesis *ForkGenesis) MsgID() forks.MsgIDFunc
- func (f *ForkGenesis) ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)
- func (genesis *ForkGenesis) Subnets() int
- func (genesis *ForkGenesis) ValidatorSubnet(validatorPKHex string) int
- func (genesis *ForkGenesis) ValidatorTopicID(pkByts []byte) []string
Constants ¶
const (
// UnknownSubnet is used when a validator public key is invalid
UnknownSubnet = "unknown"
)
Variables ¶
This section is empty.
Functions ¶
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