overlay

package module
v0.0.0-...-62d63d6 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

README

Dist-ribut-us Overlay Nodes

Handles overlay nodes. Overlay nodes are the public facing poriton of Dist-ribut-us.

See documentation.

Documentation

Overview

Package overlay handles overlay nodes; the public facing portions of the system. An overlay node will publicly announce it's IP address. Overlay nodes are used to connect to the network, participate in the DHT and in leap-frog (onion routing).

Index

Constants

View Source
const (
	NoCompression = byte(iota)
	GZipped
)

Compression tags

View Source
const ErrMsgIDZero = errors.String("Message ID cannot be 0")

ErrMsgIDZero is returned if there is an attempt to send a message with ID of 0 - this is probably a sign that something isn't correctly setting the ID

View Source
const ErrNoForest = errors.String("Overlay does not have forest")

ErrNoForest is returned when attempting to perform Overlay operations that require a storage forest before one is initilized

View Source
const ErrUnknonNode = errors.String("Unknown node by address")

ErrUnknonNode will occure if a message is received from an unknown address. This shouldn't happen because the packets need to know the node to be decrypted.

Variables

View Source
var ErrBadSignPub = errors.String("Public Signature Key does not match")

ErrBadSignPub is returned if a node id does not match

Functions

This section is empty.

Types

type Server

type Server struct {
	NodeTTL uint32 // default TTL in seconds
	// contains filtered or unexported fields
}

Server represents an overlay server.

func NewServer

func NewServer(router *ipcrouter.Router, netPort rnet.Port) (*Server, error)

NewServer initilizes part of the Overlay Server.

func (*Server) Close

func (s *Server) Close()

Close stop all processes for the overlay server

func (*Server) CommandHandler

func (s *Server) CommandHandler(c ipcrouter.Command)

CommandHandler for ipc commands to Overlay service

func (*Server) Forest

func (s *Server) Forest(key *crypto.Symmetric, dir string) (err error)

Forest opens the merkle forest for the overlay server.

func (*Server) GetStaticKey

func (s *Server) GetStaticKey() (bool, error)

GetStaticKey returns the current config value of statickey

func (*Server) LoadKey

func (s *Server) LoadKey() error

LoadKey will load the signing key from the forest, if one exists, otherwise it will create a random key and save it.

func (*Server) NetQueryHandler

func (s *Server) NetQueryHandler(q ipcrouter.NetQuery)

NetQueryHandler for Overlay service

func (*Server) NetSend

func (s *Server) NetSend(msg ipcrouter.NetSendRequest)

NetSend service via Overlay

func (*Server) Port

func (s *Server) Port() rnet.Port

Port returns the ipc router port for Overlay

func (*Server) QueryHandler

func (s *Server) QueryHandler(q ipcrouter.Query)

QueryHandler for ipc queries to Overlay service

func (*Server) RandomKey

func (s *Server) RandomKey()

RandomKey sets the servers signing key to a random key value

func (*Server) Receive

func (s *Server) Receive(pkt []byte, addr *rnet.Addr)

Receive fulfills PacketHandler allowing the server to handle network packets

func (*Server) Run

func (s *Server) Run()

Run the overlay server

func (*Server) ServiceID

func (*Server) ServiceID() uint32

ServiceID for Overlay service

func (*Server) SetKey

func (s *Server) SetKey() error

SetKey will set the key on the server. If a forest has been initilized, it will check if the server is configured to use a static key and use that if so. Otherwise it will set a random key.

func (*Server) SetStaticKey

func (s *Server) SetStaticKey(val bool) error

SetStaticKey sets the static key config value. If set to true, the current key value is saved.

func (*Server) SetupNetwork

func (s *Server) SetupNetwork()

SetupNetwork tries to connect to the network.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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