Documentation ¶
Index ¶
- Variables
- type Chore
- type Config
- type Endpoint
- type KademliaEndpoint
- func (endpoint *KademliaEndpoint) Ping(ctx context.Context, req *pb.PingRequest) (_ *pb.PingResponse, err error)
- func (endpoint *KademliaEndpoint) Query(ctx context.Context, req *pb.QueryRequest) (_ *pb.QueryResponse, err error)
- func (endpoint *KademliaEndpoint) RequestInfo(ctx context.Context, req *pb.InfoRequest) (_ *pb.InfoResponse, err error)
- type PingStats
- type SatelliteIDVerifier
- type Service
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("contact")
Error is the default error class for contact package
Functions ¶
This section is empty.
Types ¶
type Chore ¶
Chore is the contact chore for nodes announcing themselves to their trusted satellites
architecture: Chore
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"` // MaxSleep should remain at default value to decrease traffic congestion to satellite MaxSleep time.Duration `help:"maximum duration to wait before pinging satellites" releaseDefault:"45m" devDefault:"0s" hidden:"true"` }
Config contains configurable values for contact service
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint implements the contact service Endpoints
architecture: Endpoint
func NewEndpoint ¶
NewEndpoint returns a new contact service endpoint
func (*Endpoint) PingNode ¶
func (endpoint *Endpoint) PingNode(ctx context.Context, req *pb.ContactPingRequest) (_ *pb.ContactPingResponse, err error)
PingNode provides an easy way to verify a node is online and accepting requests
type KademliaEndpoint ¶ added in v0.22.0
type KademliaEndpoint struct {
// contains filtered or unexported fields
}
KademliaEndpoint implements the NodesServer Interface for backwards compatibility
func NewKademliaEndpoint ¶ added in v0.22.0
func NewKademliaEndpoint(log *zap.Logger, service *Service, trust SatelliteIDVerifier) *KademliaEndpoint
NewKademliaEndpoint returns a new endpoint
func (*KademliaEndpoint) Ping ¶ added in v0.22.0
func (endpoint *KademliaEndpoint) Ping(ctx context.Context, req *pb.PingRequest) (_ *pb.PingResponse, err error)
Ping provides an easy way to verify a node is online and accepting requests
func (*KademliaEndpoint) Query ¶ added in v0.22.0
func (endpoint *KademliaEndpoint) Query(ctx context.Context, req *pb.QueryRequest) (_ *pb.QueryResponse, err error)
Query is a node to node communication query
func (*KademliaEndpoint) RequestInfo ¶ added in v0.22.0
func (endpoint *KademliaEndpoint) RequestInfo(ctx context.Context, req *pb.InfoRequest) (_ *pb.InfoResponse, err error)
RequestInfo returns the node info
type PingStats ¶
type PingStats struct {
// contains filtered or unexported fields
}
PingStats contains information regarding when the node was last pinged
func (*PingStats) WhenLastPinged ¶
WhenLastPinged returns last time someone pinged this node.
type SatelliteIDVerifier ¶ added in v0.22.0
type SatelliteIDVerifier interface {
VerifySatelliteID(ctx context.Context, id storj.NodeID) error
}
SatelliteIDVerifier checks if the connection is from a trusted satellite
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, self *overlay.NodeDossier) *Service
NewService creates a new contact service
func (*Service) Local ¶ added in v0.22.0
func (service *Service) Local() overlay.NodeDossier
Local returns the storagenode node-dossier
func (*Service) UpdateSelf ¶ added in v0.22.0
func (service *Service) UpdateSelf(capacity *pb.NodeCapacity)
UpdateSelf updates the local node with the capacity