storagenode

package
v1.25.5-rc-multipart Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: AGPL-3.0 Imports: 60 Imported by: 1

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

	Server server.Config
	Debug  debug.Config

	Preflight preflight.Config
	Contact   contact.Config
	Operator  OperatorConfig

	// TODO: flatten storage config and only keep the new one
	Storage   piecestore.OldConfig
	Storage2  piecestore.Config
	Collector collector.Config

	Filestore filestore.Config

	Pieces pieces.Config

	Retain retain.Config

	Nodestats nodestats.Config

	Console consoleserver.Config

	Version checker.Config

	Bandwidth bandwidth.Config

	GracefulExit gracefulexit.Config
}

Config is all the configuration parameters for a Storage Node.

func (*Config) DatabaseConfig added in v1.4.1

func (config *Config) DatabaseConfig() storagenodedb.Config

DatabaseConfig returns the storagenodedb.Config that should be used with this Config.

func (*Config) Verify

func (config *Config) Verify(log *zap.Logger) error

Verify verifies whether configuration is consistent and acceptable.

type DB

type DB interface {
	// MigrateToLatest initializes the database
	MigrateToLatest(ctx context.Context) error
	// Close closes the database
	Close() error

	Pieces() storage.Blobs

	Orders() orders.DB
	V0PieceInfo() pieces.V0PieceInfoDB
	PieceExpirationDB() pieces.PieceExpirationDB
	PieceSpaceUsedDB() pieces.PieceSpaceUsedDB
	Bandwidth() bandwidth.DB
	Reputation() reputation.DB
	StorageUsage() storageusage.DB
	Satellites() satellites.DB
	Notifications() notifications.DB
	Payout() payouts.DB
	Pricing() pricing.DB
	APIKeys() apikeys.DB

	Preflight(ctx context.Context) error
}

DB is the master database for Storage Node.

architecture: Master Database

type OperatorConfig added in v0.22.0

type OperatorConfig struct {
	Email          string         `user:"true" help:"operator email address" default:""`
	Wallet         string         `user:"true" help:"operator wallet address" default:""`
	WalletFeatures WalletFeatures `user:"true" help:"operator wallet features" default:""`
}

OperatorConfig defines properties related to storage node operator metadata.

func (OperatorConfig) Verify added in v0.22.0

func (c OperatorConfig) Verify(log *zap.Logger) error

Verify verifies whether operator config is valid.

type Peer

type Peer struct {
	// core dependencies
	Log         *zap.Logger
	Identity    *identity.FullIdentity
	DB          DB
	UsedSerials *usedserials.Table
	OrdersStore *orders.FileStore

	Servers  *lifecycle.Group
	Services *lifecycle.Group

	Dialer rpc.Dialer

	Server *server.Server

	Version struct {
		Chore   *version2.Chore
		Service *checker.Service
	}

	Debug struct {
		Listener net.Listener
		Server   *debug.Server
	}

	Preflight struct {
		LocalTime *preflight.LocalTime
	}

	Contact struct {
		Service   *contact.Service
		Chore     *contact.Chore
		Endpoint  *contact.Endpoint
		PingStats *contact.PingStats
	}

	Estimation struct {
		Service *estimatedpayouts.Service
	}

	Storage2 struct {
		// TODO: lift things outside of it to organize better
		Trust         *trust.Pool
		Store         *pieces.Store
		TrashChore    *pieces.TrashChore
		BlobsCache    *pieces.BlobsUsageCache
		CacheService  *pieces.CacheService
		RetainService *retain.Service
		PieceDeleter  *pieces.Deleter
		Endpoint      *piecestore.Endpoint
		Inspector     *inspector.Endpoint
		Monitor       *monitor.Service
		Orders        *orders.Service
	}

	Collector *collector.Service

	NodeStats struct {
		Service *nodestats.Service
		Cache   *nodestats.Cache
	}

	// Web server with web UI
	Console struct {
		Listener net.Listener
		Service  *console.Service
		Endpoint *consoleserver.Server
	}

	PieceTransfer struct {
		Service piecetransfer.Service
	}

	GracefulExit struct {
		Service      gracefulexit.Service
		Endpoint     *gracefulexit.Endpoint
		Chore        *gracefulexit.Chore
		BlobsCleaner *gracefulexit.BlobsCleaner
	}

	Notifications struct {
		Service *notifications.Service
	}

	Payout struct {
		Service  *payouts.Service
		Endpoint *payouts.Endpoint
	}

	Bandwidth *bandwidth.Service

	Reputation *reputation.Service

	Multinode struct {
		Storage   *multinode.StorageEndpoint
		Bandwidth *multinode.BandwidthEndpoint
		Node      *multinode.NodeEndpoint
		Payout    *multinode.PayoutEndpoint
	}
}

Peer is the representation of a Storage Node.

architecture: Peer

func New

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

New creates a new Storage Node.

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) PrivateAddr

func (peer *Peer) PrivateAddr() string

PrivateAddr returns the private address.

func (*Peer) Run

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

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

func (*Peer) URL added in v0.15.0

func (peer *Peer) URL() storj.NodeURL

URL returns the storj.NodeURL.

type WalletFeatures added in v1.22.2

type WalletFeatures []string

WalletFeatures payout opt-in wallet features list.

func (*WalletFeatures) Set added in v1.22.2

func (features *WalletFeatures) Set(value string) error

Set implements pflag.Value by parsing a comma separated list of wallet features.

func (WalletFeatures) String added in v1.22.2

func (features WalletFeatures) String() string

String returns the comma separated list of wallet features.

func (WalletFeatures) Type added in v1.22.2

func (features WalletFeatures) Type() string

Type returns the type of the pflag.Value.

Directories

Path Synopsis
Package bandwidth implements bandwidth usage rollup loop.
Package bandwidth implements bandwidth usage rollup loop.
Package collector implements expired piece deletion from storage node.
Package collector implements expired piece deletion from storage node.
Package internalpb contains proto definitions for storagenode internal tools.
Package internalpb contains proto definitions for storagenode internal tools.
Package piecetransfer contains code meant to deal with transferring pieces from one node to another.
Package piecetransfer contains code meant to deal with transferring pieces from one node to another.

Jump to

Keyboard shortcuts

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