Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateConfig(privateKey ed25519.PrivateKey) (cfg config.NodeConfig)
- type NodeInfo
- type PeerList
- type Server
- func (s *Server) Address() (net.IP, error)
- func (s *Server) Gateway() (net.IPNet, error)
- func (s *Server) NodeID() (ed25519.PublicKey, error)
- func (s *Server) Start() error
- func (s *Server) Stop() error
- func (s *Server) Subnet() (net.IPNet, error)
- func (s *Server) SubnetFor(b []byte) (net.IP, error)
- func (s *Server) Tun() string
Constants ¶
const ( YggListenTCP = 9943 YggListenTLS = 9944 YggListenLinkLocal = 9945 YggIface = "ygg0" )
List of port used by yggdrasil
Variables ¶
var PeerListFallback = PeerList{ { Endpoint: "tls://45.147.198.155:6010", Up: true, }, { Endpoint: "tcp://51.15.204.214:12345", Up: true, }, { Endpoint: "tcp://45.138.172.192:5001", Up: true, }, }
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) (cfg 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 `json:"-"` Up bool `json:"up"` BoxPubKey string `json:"key"` LastSeen int `json:"last_seen"` ProtoMinor int `json:"proto_minor"` }
NodeInfo is the know information about an yggdrasil public node
type PeerList ¶
type PeerList []NodeInfo
PeerList is yggdrasil peers list
func FetchPeerList ¶
FetchPeerList download the list of public yggdrasil peer from https://publicpeers.neilalexander.dev/publicnodes.json
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