yggdrasil

package
v0.4.5-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YggListenTCP       = 9943
	YggListenTLS       = 9944
	YggListenLinkLocal = 9945

	YggIface = "ygg0"
)

List of port used by yggdrasil

Variables

View Source
var PeerListFallback = PeerList{
	// contains filtered or unexported fields
}

PeerListFallback is an hardcoded list of public yggdrasil node it is used to have some available peer to connect to when we failed to read the online public peer info

Functions

func GenerateConfig

func GenerateConfig(privateKey ed25519.PrivateKey) config.NodeConfig

GenerateConfig creates a new yggdrasil configuration and generate the box and signing key from the ed25519 Private key of the node this creates a mapping between a yggdrasil identity and the TFGrid identity

Types

type NodeInfo

type NodeInfo struct {
	Endpoint  string
	Up        bool
	Address   string
	BoxPubKey string
	LastSeen  int
}

NodeInfo is the know information about an yggdrasil public node

type PeerList

type PeerList struct {
	// contains filtered or unexported fields
}

PeerList is a list of yggsdrasil peer retrieved from https://publicpeers.neilalexander.dev/publicnodes.json

func FetchPeerList

func FetchPeerList() (PeerList, error)

FetchPeerList download the list of public yggdrasil peer from https://publicpeers.neilalexander.dev/publicnodes.json

func (PeerList) Peers

func (p PeerList) Peers() []NodeInfo

Peers return all the peers information from the PeerList p

func (PeerList) Ups

func (p PeerList) Ups() []NodeInfo

Ups return all the peers that are marked up from the PeerList p

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represent a yggdrasil server

func NewServer

func NewServer(zinit *zinit.Client, cfg *config.NodeConfig) *Server

NewServer create a new yggdrasil Server

func (*Server) Address

func (s *Server) Address() (net.IP, error)

Address return the address in the 200::/7 subnet allocated by yggdrasil

func (*Server) Gateway

func (s *Server) Gateway() (net.IPNet, error)

Gateway return the first IP of the 300::/64 subnet allocated by yggdrasil

func (*Server) NodeID

func (s *Server) NodeID() (*crypto.NodeID, error)

NodeID returns the yggdrasil node ID of s

func (*Server) Start

func (s *Server) Start() error

Start creates an yggdrasil zinit service and starts it

func (*Server) Stop

func (s *Server) Stop() error

Stop stop the yggdrasil zinit service

func (*Server) Subnet

func (s *Server) Subnet() (net.IPNet, error)

Subnet return the 300::/64 subnet allocated by yggdrasil

func (*Server) SubnetFor

func (s *Server) SubnetFor(b []byte) (net.IP, error)

SubnetFor return an IP address out of the node allocated subnet by hasing b and using it to generate the last 64 bits of the IPV6 address

func (*Server) Tun

func (s *Server) Tun() string

Tun return the name of the TUN interface created by yggdrasil

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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