commons

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: GPL-3.0 Imports: 13 Imported by: 1

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 added in v0.2.0

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

BuildMultiAddress creates a multiaddr from the given params

func CheckAddress added in v0.2.0

func CheckAddress(addr string) error

CheckAddress checks that some address is accessible and returns error accordingly

func ConvertFromInterfacePrivKey added in v0.3.0

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

ConvertFromInterfacePrivKey converts crypto.PrivKey back to ecdsa.PrivateKey

func ConvertFromInterfacePubKey added in v0.3.0

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

ConvertFromInterfacePubKey converts crypto.PubKey to ecdsa.PublicKey

func ConvertToInterfacePrivkey added in v0.3.0

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

ConvertToInterfacePrivkey converts ecdsa.PrivateKey to crypto.PrivKey

func ConvertToInterfacePubkey added in v0.3.0

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

ConvertToInterfacePubkey converts ecdsa.PublicKey to crypto.PubKey

func GenNetworkKey added in v0.2.0

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

GenNetworkKey generates a new network key

func IPAddr added in v0.2.0

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