Documentation ¶
Overview ¶
Package testplanet implements the full network wiring for testing
Index ¶
- Variables
- func MustPregeneratedIdentity(index int) *identity.FullIdentity
- func MustPregeneratedSignedIdentity(index int) *identity.FullIdentity
- func NewPregeneratedSigner() *identity.FullCertificateAuthority
- func PregeneratedIdentity(index int) (*identity.FullIdentity, error)
- func PregeneratedSignedIdentity(index int) (*identity.FullIdentity, error)
- func Run(t *testing.T, config Config, ...)
- type Config
- type Identities
- type Peer
- type Planet
- func (planet *Planet) Identities() *Identities
- func (planet *Planet) NewIdentity() (*identity.FullIdentity, error)
- func (planet *Planet) NewListener() (net.Listener, error)
- func (planet *Planet) NewVersionConfig() version.Config
- func (planet *Planet) NewVersionInfo() version.Info
- func (planet *Planet) Reconnect(ctx context.Context)
- func (planet *Planet) Shutdown() error
- func (planet *Planet) Size() int
- func (planet *Planet) Start(ctx context.Context)
- func (planet *Planet) StopPeer(peer Peer) error
- func (planet *Planet) WriteWhitelist() (string, error)
- type Reconfigure
- type Uplink
- func (uplink *Uplink) Addr() string
- func (uplink *Uplink) Delete(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) error
- func (uplink *Uplink) DialMetainfo(ctx context.Context, destination Peer, apikey string) (metainfo.Client, error)
- func (uplink *Uplink) DialPiecestore(ctx context.Context, destination Peer) (*piecestore.Client, error)
- func (uplink *Uplink) Download(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) ([]byte, error)
- func (uplink *Uplink) DownloadStream(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) (*stream.Download, error)
- func (uplink *Uplink) GetConfig(satellite *satellite.Peer) uplink.Config
- func (uplink *Uplink) ID() storj.NodeID
- func (uplink *Uplink) Local() pb.Node
- func (uplink *Uplink) Shutdown() error
- func (uplink *Uplink) Upload(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path, ...) error
- func (uplink *Uplink) UploadWithConfig(ctx context.Context, satellite *satellite.Peer, redundancy *uplink.RSConfig, ...) error
Constants ¶
This section is empty.
Variables ¶
var DisablePeerCAWhitelist = Reconfigure{ Bootstrap: func(index int, config *bootstrap.Config) { config.Server.UsePeerCAWhitelist = false }, Satellite: func(log *zap.Logger, index int, config *satellite.Config) { config.Server.UsePeerCAWhitelist = false }, StorageNode: func(index int, config *storagenode.Config) { config.Server.UsePeerCAWhitelist = false }, }
DisablePeerCAWhitelist returns a `Reconfigure` that sets `UsePeerCAWhitelist` for all node types that use kademlia.
Functions ¶
func MustPregeneratedIdentity ¶
func MustPregeneratedIdentity(index int) *identity.FullIdentity
MustPregeneratedIdentity returns a pregenerated identity or panics
func MustPregeneratedSignedIdentity ¶
func MustPregeneratedSignedIdentity(index int) *identity.FullIdentity
MustPregeneratedSignedIdentity returns a pregenerated identity or panics
func NewPregeneratedSigner ¶
func NewPregeneratedSigner() *identity.FullCertificateAuthority
NewPregeneratedSigner returns the signer for all pregenerated, signed identities
func PregeneratedIdentity ¶
func PregeneratedIdentity(index int) (*identity.FullIdentity, error)
PregeneratedIdentity returns a pregenerated identity from a list
func PregeneratedSignedIdentity ¶
func PregeneratedSignedIdentity(index int) (*identity.FullIdentity, error)
PregeneratedSignedIdentity returns a signed pregenerated identity from a list
Types ¶
type Config ¶
type Config struct { SatelliteCount int StorageNodeCount int UplinkCount int Identities *Identities Reconfigure Reconfigure }
Config describes planet configuration
type Identities ¶
type Identities struct {
// contains filtered or unexported fields
}
Identities is a pregenerated full identity table.
func NewIdentities ¶
func NewIdentities(list ...*identity.FullIdentity) *Identities
NewIdentities creates a new table from provided identities.
func NewPregeneratedIdentities ¶
func NewPregeneratedIdentities() *Identities
NewPregeneratedIdentities retruns a new table from provided identities.
func NewPregeneratedSignedIdentities ¶
func NewPregeneratedSignedIdentities() *Identities
NewPregeneratedSignedIdentities retruns a new table from provided signed identities.
func (*Identities) Clone ¶
func (identities *Identities) Clone() *Identities
Clone creates a shallow clone of the table.
func (*Identities) NewIdentity ¶
func (identities *Identities) NewIdentity() (*identity.FullIdentity, error)
NewIdentity gets a new identity from the list.
type Peer ¶
type Peer interface { ID() storj.NodeID Addr() string Local() pb.Node Run(context.Context) error Close() error }
Peer represents one of StorageNode or Satellite
type Planet ¶
type Planet struct { Bootstrap *bootstrap.Peer VersionControl *versioncontrol.Peer Satellites []*satellite.Peer StorageNodes []*storagenode.Peer Uplinks []*Uplink // contains filtered or unexported fields }
Planet is a full storj system setup.
func NewWithLogger ¶
func NewWithLogger(log *zap.Logger, satelliteCount, storageNodeCount, uplinkCount int) (*Planet, error)
NewWithLogger creates a new full system with the given number of nodes.
func (*Planet) Identities ¶
func (planet *Planet) Identities() *Identities
Identities returns the identity provider for this planet.
func (*Planet) NewIdentity ¶
func (planet *Planet) NewIdentity() (*identity.FullIdentity, error)
NewIdentity creates a new identity for a node
func (*Planet) NewListener ¶
NewListener creates a new listener
func (*Planet) NewVersionConfig ¶
NewVersionConfig returns the Version Config for this planet with tuned metrics.
func (*Planet) NewVersionInfo ¶
NewVersionInfo returns the Version Info for this planet with tuned metrics.
func (*Planet) WriteWhitelist ¶
WriteWhitelist writes the pregenerated signer's CA cert to a "CA whitelist", PEM-encoded.
type Reconfigure ¶
type Reconfigure struct { NewBootstrapDB func(index int) (bootstrap.DB, error) Bootstrap func(index int, config *bootstrap.Config) NewSatelliteDB func(log *zap.Logger, index int) (satellite.DB, error) Satellite func(log *zap.Logger, index int, config *satellite.Config) NewStorageNodeDB func(index int) (storagenode.DB, error) StorageNode func(index int, config *storagenode.Config) }
Reconfigure allows to change node configurations
type Uplink ¶
type Uplink struct { Log *zap.Logger Info pb.Node Identity *identity.FullIdentity Transport transport.Client StorageNodeCount int APIKey map[storj.NodeID]string }
Uplink is a general purpose
func (*Uplink) Delete ¶
func (uplink *Uplink) Delete(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) error
Delete data to specific satellite
func (*Uplink) DialMetainfo ¶
func (uplink *Uplink) DialMetainfo(ctx context.Context, destination Peer, apikey string) (metainfo.Client, error)
DialMetainfo dials destination with apikey and returns metainfo Client
func (*Uplink) DialPiecestore ¶
func (uplink *Uplink) DialPiecestore(ctx context.Context, destination Peer) (*piecestore.Client, error)
DialPiecestore dials destination storagenode and returns a piecestore client.
func (*Uplink) Download ¶
func (uplink *Uplink) Download(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) ([]byte, error)
Download data from specific satellite
func (*Uplink) DownloadStream ¶
func (uplink *Uplink) DownloadStream(ctx context.Context, satellite *satellite.Peer, bucket string, path storj.Path) (*stream.Download, error)
DownloadStream returns stream for downloading data.