Documentation ¶
Index ¶
- Constants
- func AddOptions(opts []libp2p.Option) []libp2p.Option
- func BuildMultiAddress(ipAddr, protocol string, port uint, id peer.ID) (ma.Multiaddr, error)
- func CheckAddress(addr string) error
- func DecodeNetworkMsg(data []byte) (*spectypes.SSVMessage, error)
- func DecodeSignedSSVMessage(encoded []byte) ([]byte, spectypes.OperatorID, []byte, error)
- func ECDSAPrivFromInterface(privkey crypto.PrivKey) (*ecdsa.PrivateKey, error)
- func ECDSAPrivToInterface(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error)
- func ECDSAPubFromInterface(pubKey crypto.PubKey) *ecdsa.PublicKey
- func ECDSAPubToInterface(pubkey *ecdsa.PublicKey) (crypto.PubKey, error)
- func EncodeNetworkMsg(msg *spectypes.SSVMessage) ([]byte, error)
- func EncodeSignedSSVMessage(message []byte, operatorID spectypes.OperatorID, signature []byte) []byte
- func GenNetworkKey() (*ecdsa.PrivateKey, error)
- func GetTopicBaseName(topicName string) string
- func GetTopicFullName(baseName string) string
- func IPAddr() (net.IP, error)
- func ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)
- func RSAPrivToInterface(privkey *rsa.PrivateKey) (crypto.PrivKey, error)
- func SubnetTopicID(subnet int) string
- func Subnets() int
- func Topics() []string
- func ValidatorSubnet(validatorPKHex string) int
- func ValidatorTopicID(pkByts []byte) []string
- type MsgIDFunc
Constants ¶
const ( // DefaultIP is hte default ip address to use DefaultIP = "127.0.0.1" // DefaultTCP is the default tcp port used in SSV DefaultTCP = 12001 // DefaultUDP is the default udp port used in SSV DefaultUDP = 13001 )
const (
// UnknownSubnet is used when a validator public key is invalid
UnknownSubnet = "unknown"
)
Variables ¶
This section is empty.
Functions ¶
func AddOptions ¶ added in v1.1.0
func AddOptions(opts []libp2p.Option) []libp2p.Option
AddOptions implementation
func BuildMultiAddress ¶ added in v0.2.0
BuildMultiAddress creates a multiaddr from the given params
func CheckAddress ¶ added in v0.2.0
CheckAddress checks that some address is accessible and returns error accordingly
func DecodeNetworkMsg ¶ added in v1.1.0
func DecodeNetworkMsg(data []byte) (*spectypes.SSVMessage, error)
DecodeNetworkMsg decodes network message
func DecodeSignedSSVMessage ¶ added in v1.2.0
DecodeSignedSSVMessage deserializes signed message bytes messsage, op id and a signature
func ECDSAPrivFromInterface ¶ added in v1.2.0
func ECDSAPrivFromInterface(privkey crypto.PrivKey) (*ecdsa.PrivateKey, error)
ECDSAPrivFromInterface converts crypto.PrivKey back to ecdsa.PrivateKey
func ECDSAPrivToInterface ¶ added in v1.2.0
func ECDSAPrivToInterface(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error)
ECDSAPrivToInterface converts ecdsa.PrivateKey to crypto.PrivKey
func ECDSAPubFromInterface ¶ added in v1.2.0
ECDSAPubFromInterface converts crypto.PubKey to ecdsa.PublicKey
func ECDSAPubToInterface ¶ added in v1.2.0
ECDSAPubToInterface converts ecdsa.PublicKey to crypto.PubKey
func EncodeNetworkMsg ¶ added in v1.1.0
func EncodeNetworkMsg(msg *spectypes.SSVMessage) ([]byte, error)
EncodeNetworkMsg encodes network message
func EncodeSignedSSVMessage ¶ added in v1.2.0
func EncodeSignedSSVMessage(message []byte, operatorID spectypes.OperatorID, signature []byte) []byte
EncodeSignedSSVMessage serializes the message, op id and signature into bytes
func GenNetworkKey ¶ added in v0.2.0
func GenNetworkKey() (*ecdsa.PrivateKey, error)
GenNetworkKey generates a new network key
func GetTopicBaseName ¶ added in v1.1.0
GetTopicBaseName return the base topic name of the topic, w/o ssv prefix
func GetTopicFullName ¶ added in v1.1.0
GetTopicFullName returns the topic full name, including prefix
func ProtocolID ¶ added in v1.1.0
func ProtocolID(prot p2pprotocol.SyncProtocol) (protocol.ID, int)
ProtocolID returns the protocol id of the given protocol, and the amount of peers for distribution
func RSAPrivToInterface ¶ added in v1.2.0
func RSAPrivToInterface(privkey *rsa.PrivateKey) (crypto.PrivKey, error)
RSAPrivToInterface converts ecdsa.PrivateKey to crypto.PrivKey
func SubnetTopicID ¶ added in v1.1.0
SubnetTopicID returns the topic to use for the given subnet
func Topics ¶ added in v1.1.0
func Topics() []string
Topics returns the available topics for this fork.
func ValidatorSubnet ¶ added in v1.1.0
ValidatorSubnet returns the subnet for the given validator
func ValidatorTopicID ¶ added in v1.1.0
ValidatorTopicID returns the topic to use for the given validator