dht

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	Routing() []pb.Node
	Cache() []pb.Node
	// TODO: should this be a NodeID?
	Midpoint() string
	Nodes() []*pb.Node
}

Bucket is a set of methods to act on kademlia k buckets

type DHT

type DHT interface {
	FindNear(ctx context.Context, start storj.NodeID, limit int) ([]*pb.Node, error)
	Bootstrap(ctx context.Context) error
	Ping(ctx context.Context, node pb.Node) (pb.Node, error)
	FindNode(ctx context.Context, ID storj.NodeID) (pb.Node, error)
	Seen() []*pb.Node
}

DHT is the interface for the DHT in the Storj network

type RoutingTable

type RoutingTable interface {
	// local params
	Local() overlay.NodeDossier
	K() int
	CacheSize() int
	GetBucketIds(context.Context) (storage.Keys, error)
	FindNear(ctx context.Context, id storj.NodeID, limit int) ([]*pb.Node, error)
	ConnectionSuccess(ctx context.Context, node *pb.Node) error
	ConnectionFailed(ctx context.Context, node *pb.Node) error
	// these are for refreshing
	SetBucketTimestamp(ctx context.Context, id []byte, now time.Time) error
	GetBucketTimestamp(ctx context.Context, id []byte) (time.Time, error)

	Close() error
}

RoutingTable contains information on nodes we have locally

Jump to

Keyboard shortcuts

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