satellite

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: AGPL-3.0 Imports: 49 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Identity identity.Config

	// TODO: switch to using server.Config when Identity has been removed from it
	Server server.Config

	Kademlia  kademlia.Config
	Overlay   overlay.Config
	Discovery discovery.Config

	PointerDB   pointerdb.Config
	BwAgreement bwagreement.Config // TODO: decide whether to keep empty configs for consistency

	Checker  checker.Config
	Repairer repairer.Config
	Audit    audit.Config

	Tally  tally.Config
	Rollup rollup.Config

	Mail    mailservice.Config
	Console consoleweb.Config

	Version version.Config
}

Config is the global config satellite

type DB

type DB interface {
	// CreateTables initializes the database
	CreateTables() error
	// Close closes the database
	Close() error

	// CreateSchema sets the schema
	CreateSchema(schema string) error
	// DropSchema drops the schema
	DropSchema(schema string) error

	// BandwidthAgreement returns database for storing bandwidth agreements
	BandwidthAgreement() bwagreement.DB
	// CertDB returns database for storing uplink's public key & ID
	CertDB() certdb.DB
	// OverlayCache returns database for caching overlay information
	OverlayCache() overlay.DB
	// Accounting returns database for storing information about data use
	Accounting() accounting.DB
	// RepairQueue returns queue for segments that need repairing
	RepairQueue() queue.RepairQueue
	// Irreparable returns database for failed repairs
	Irreparable() irreparable.DB
	// Console returns database for satellite console
	Console() console.DB
	// Orders returns database for orders
	Orders() orders.DB
}

DB is the master database for the satellite

type Peer

type Peer struct {
	// core dependencies
	Log      *zap.Logger
	Identity *identity.FullIdentity
	DB       DB

	Transport transport.Client

	Server *server.Server

	Version *version.Service

	// services and endpoints
	Kademlia struct {
		RoutingTable *kademlia.RoutingTable
		Service      *kademlia.Kademlia
		Endpoint     *kademlia.Endpoint
		Inspector    *kademlia.Inspector
		// contains filtered or unexported fields
	}

	Overlay struct {
		Service   *overlay.Cache
		Inspector *overlay.Inspector
	}

	Discovery struct {
		Service *discovery.Discovery
	}

	Metainfo struct {
		Database  storage.KeyValueStore // TODO: move into pointerDB
		Service   *pointerdb.Service
		Endpoint2 *metainfo.Endpoint
	}

	Inspector struct {
		Endpoint *inspector.Endpoint
	}

	Agreements struct {
		Endpoint *bwagreement.Server
	}

	Orders struct {
		Endpoint *orders.Endpoint
		Service  *orders.Service
	}

	Repair struct {
		Checker   *checker.Checker
		Repairer  *repairer.Service
		Inspector *irreparable.Inspector
	}
	Audit struct {
		Service *audit.Service
	}

	Accounting struct {
		Tally  *tally.Tally
		Rollup *rollup.Rollup
	}

	Mail struct {
		Service *mailservice.Service
	}

	Console struct {
		Listener net.Listener
		Service  *console.Service
		Endpoint *consoleweb.Server
	}
}

Peer is the satellite

func New

func New(log *zap.Logger, full *identity.FullIdentity, db DB, config *Config, versionInfo version.Info) (*Peer, error)

New creates a new satellite

func (*Peer) Addr

func (peer *Peer) Addr() string

Addr returns the public address.

func (*Peer) Close

func (peer *Peer) Close() error

Close closes all the resources.

func (*Peer) ID

func (peer *Peer) ID() storj.NodeID

ID returns the peer ID.

func (*Peer) Local

func (peer *Peer) Local() pb.Node

Local returns the peer local node info.

func (*Peer) PrivateAddr

func (peer *Peer) PrivateAddr() string

PrivateAddr returns the private address.

func (*Peer) Run

func (peer *Peer) Run(ctx context.Context) error

Run runs storage node until it's either closed or it errors.

Jump to

Keyboard shortcuts

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