Documentation
¶
Index ¶
- Constants
- Variables
- func GetTags(ctx context.Context, config Config, identity *identity.FullIdentity) (*pb.SignedNodeTagSets, error)
- type Chore
- type Config
- type Endpoint
- type NodeInfo
- type PingStats
- type QUICStats
- type Service
- func (service *Service) Local() NodeInfo
- func (service *Service) PingSatellites(ctx context.Context, maxInterval, timeout time.Duration) (err error)
- func (service *Service) RequestPingMeQUIC(ctx context.Context) (stats *QUICStats, err error)
- func (service *Service) UpdateSelf(capacity *pb.NodeCapacity)
- type SignedTags
Constants ¶
const (
// NetworkStatusOk represents node successfully pinged.
NetworkStatusOk = "OK"
// NetworkStatusMisconfigured means satellite could not ping
// back node due to misconfiguration on the node host.
NetworkStatusMisconfigured = "Misconfigured"
// NetworkStatusDisabled means QUIC is disabled by config.
NetworkStatusDisabled = "Disabled"
// NetworkStatusRefreshing means QUIC check is in progress.
NetworkStatusRefreshing = "Refreshing"
)
Variables ¶
var (
// Error is the default error class for contact package.
Error = errs.Class("contact")
)
Functions ¶
Types ¶
type Chore ¶
type Chore struct {
// contains filtered or unexported fields
}
Chore is the contact chore for nodes announcing themselves to their trusted satellites.
architecture: Chore
func NewChore ¶
func NewChore(log *zap.Logger, interval, timeout time.Duration, service *Service) *Chore
NewChore creates a new contact chore.
func (*Chore) Close ¶
func (chore *Chore) Close() error
Close stops all the cycles in the contact chore.
func (*Chore) Pause ¶ added in v0.25.0
func (chore *Chore) Pause(ctx context.Context)
Pause stops all the cycles in the contact chore.
func (*Chore) Run ¶
func (chore *Chore) Run(ctx context.Context) (err error)
Run the contact chore on a regular interval with jitter.
func (*Chore) Trigger ¶ added in v0.34.1
func (chore *Chore) Trigger(ctx context.Context)
Trigger ensures that each cycle is done at least once. If the cycle is currently running it waits for the previous to complete and then runs.
func (*Chore) TriggerWait ¶ added in v0.25.0
func (chore *Chore) TriggerWait(ctx context.Context)
TriggerWait ensures that each cycle is done at least once and waits for completion. If the cycle is currently running it waits for the previous to complete and then runs.
type Config ¶
type Config struct {
ExternalAddress string `user:"true" help:"the public address of the node, useful for nodes behind NAT" default:""`
// Chore config values
Interval time.Duration `help:"how frequently the node contact chore should run" releaseDefault:"1h" devDefault:"30s"`
CheckInTimeout time.Duration `help:"timeout for the check-in request" releaseDefault:"10m" devDefault:"15s" testDefault:"5s"`
Tags SignedTags `help:"protobuf serialized signed node tags in hex (base64) format"`
SelfSignedTags []string `help:"coma separated key=value pairs, which will be self signed and used as tags"`
}
Config contains configurable values for contact service.
type Endpoint ¶
type Endpoint struct {
pb.DRPCContactUnimplementedServer
// contains filtered or unexported fields
}
Endpoint implements the contact service Endpoints.
architecture: Endpoint
func NewEndpoint ¶
func NewEndpoint(log *zap.Logger, trust trust.TrustedSatelliteSource, pingStats *PingStats) *Endpoint
NewEndpoint returns a new contact service endpoint.
type NodeInfo ¶ added in v1.6.1
type NodeInfo struct {
ID storj.NodeID
Address string
Version pb.NodeVersion
Capacity pb.NodeCapacity
Operator pb.NodeOperator
NoiseKeyAttestation *pb.NoiseKeyAttestation
DebounceLimit int
FastOpen bool
}
NodeInfo contains information necessary for introducing storagenode to satellite.
type PingStats ¶
type PingStats struct {
// contains filtered or unexported fields
}
PingStats contains information regarding when the node was last pinged.
func (*PingStats) WasPinged ¶
func (stats *PingStats) WasPinged(when time.Time)
WasPinged notifies the service it has been remotely pinged.
func (*PingStats) WhenLastPinged ¶
func (stats *PingStats) WhenLastPinged() (when time.Time)
WhenLastPinged returns last time someone pinged this node.
type QUICStats ¶ added in v1.67.1
type QUICStats struct {
// contains filtered or unexported fields
}
QUICStats contains information regarding QUIC status of the node.
func NewQUICStats ¶ added in v1.67.1
func NewQUICStats(enabled bool) *QUICStats
NewQUICStats returns a new QUICStats.
func (*QUICStats) SetStatus ¶ added in v1.67.1
func (q *QUICStats) SetStatus(pingSuccess bool)
SetStatus sets the QUIC status during PingMe request.
func (*QUICStats) Status ¶ added in v1.67.1
func (q *QUICStats) Status() string
Status returns the quic status gathered in a PingMe request.
func (*QUICStats) WhenLastPinged ¶ added in v1.67.1
func (q *QUICStats) WhenLastPinged() (when time.Time)
WhenLastPinged returns last time someone pinged this node via QUIC.
type Service ¶ added in v0.22.0
type Service struct {
// contains filtered or unexported fields
}
Service is the contact service between storage nodes and satellites.
func NewService ¶ added in v0.22.0
func NewService(log *zap.Logger, dialer rpc.Dialer, self NodeInfo, trust trust.TrustedSatelliteSource, quicStats *QUICStats, tags *pb.SignedNodeTagSets) *Service
NewService creates a new contact service.
func (*Service) Local ¶ added in v0.22.0
func (service *Service) Local() NodeInfo
Local returns the storagenode info.
func (*Service) PingSatellites ¶ added in v0.34.6
func (service *Service) PingSatellites(ctx context.Context, maxInterval, timeout time.Duration) (err error)
PingSatellites attempts to ping all satellites in trusted list until backoff reaches maxInterval.
func (*Service) RequestPingMeQUIC ¶ added in v1.47.3
func (service *Service) RequestPingMeQUIC(ctx context.Context) (stats *QUICStats, err error)
RequestPingMeQUIC sends pings request to satellite for a pingBack via QUIC.
func (*Service) UpdateSelf ¶ added in v0.22.0
func (service *Service) UpdateSelf(capacity *pb.NodeCapacity)
UpdateSelf updates the local node with the capacity.
type SignedTags ¶ added in v1.83.2
type SignedTags pb.SignedNodeTagSets
SignedTags represents base64 encoded signed tags.
func (*SignedTags) Set ¶ added in v1.83.2
func (u *SignedTags) Set(s string) error
Set implements flag.Value interface.