p2p

package
v0.0.0-...-bc2601f Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectingTimeout = 20 * time.Second //todo: add to the config

ConnectingTimeout is the timeout we wait when trying to connect a neighborhood

View Source
const NoResultsInterval = 1 * time.Second

NoResultsInterval is the timeout we wait between requesting more peers repeatedly

Variables

View Source
var (
	// ErrBadFormat1 could'nt deserialize the payload
	ErrBadFormat1 = errors.New("bad msg format, could'nt deserialize 1")
	// ErrBadFormat2 could'nt deserialize the protocol message payload
	ErrBadFormat2 = errors.New("bad msg format, could'nt deserialize 2")
	// ErrOutOfSync is returned when messsage timestamp was out of sync
	ErrOutOfSync = errors.New("received out of sync msg")
	// ErrFailDecrypt session cant decrypt
	ErrFailDecrypt = errors.New("can't decrypt message payload with session key")
	// ErrAuthAuthor message sign is wrong
	ErrAuthAuthor = errors.New("failed to verify author")
	// ErrNoProtocol we don't have the protocol message
	ErrNoProtocol = errors.New("received msg to an unsupported protocol")
	// ErrNoSession we don't have this session
	ErrNoSession = errors.New("connection is missing a session")
	// ErrNotFromPeer - we got message singed with a different publickkey and its not gossip
	ErrNotFromPeer = errors.New("this message was signed with the wrong public key")
)

Functions

This section is empty.

Types

type Service

type Service service.Service

Service is a wrapper for service.Service to expose the Service interface to `p2p` clients

func New

func New(ctx context.Context, config config.Config) (Service, error)

New creates a new P2P service a.k.a `swarm` it tries to load node information from the disk.

Directories

Path Synopsis
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
dht
Package dht implements a Distributed Hash Table based on Kademlia protocol.
Package dht implements a Distributed Hash Table based on Kademlia protocol.
pb
net

Jump to

Keyboard shortcuts

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