commons

package
v0.0.0-...-c859c3e Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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
)

Variables

This section is empty.

Functions

func BuildMultiAddress

func BuildMultiAddress(ipAddr, protocol string, port uint, id peer.ID) (ma.Multiaddr, error)

BuildMultiAddress creates a multiaddr from the given params

func CheckAddress

func CheckAddress(addr string) error

CheckAddress checks that some address is accessible and returns error accordingly

func ConvertFromInterfacePrivKey

func ConvertFromInterfacePrivKey(privkey crypto.PrivKey) (*ecdsa.PrivateKey, error)

ConvertFromInterfacePrivKey converts crypto.PrivKey back to ecdsa.PrivateKey

func ConvertFromInterfacePubKey

func ConvertFromInterfacePubKey(pubKey crypto.PubKey) *ecdsa.PublicKey

ConvertFromInterfacePubKey converts crypto.PubKey to ecdsa.PublicKey

func ConvertToInterfacePrivkey

func ConvertToInterfacePrivkey(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error)

ConvertToInterfacePrivkey converts ecdsa.PrivateKey to crypto.PrivKey

func ConvertToInterfacePubkey

func ConvertToInterfacePubkey(pubkey *ecdsa.PublicKey) (crypto.PubKey, error)

ConvertToInterfacePubkey converts ecdsa.PublicKey to crypto.PubKey

func GenNetworkKey

func GenNetworkKey() (*ecdsa.PrivateKey, error)

GenNetworkKey generates a new network key

func IPAddr

func IPAddr() (net.IP, error)

IPAddr returns the external IP address

Types

This section is empty.

Jump to

Keyboard shortcuts

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