Documentation ¶
Index ¶
- Variables
- type Config
- type Conn
- 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 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 Config ¶ added in v0.22.0
type Config struct {
ExternalAddress string `user:"true" help:"the public address of the node, useful for nodes behind NAT" default:""`
}
Config contains configurable values for contact service
type Conn ¶ added in v0.22.0
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint implements the contact service Endpoints.
func NewEndpoint ¶
NewEndpoint returns a new contact service endpoint.
func (*Endpoint) CheckIn ¶
func (endpoint *Endpoint) CheckIn(ctx context.Context, req *pb.CheckInRequest) (_ *pb.CheckInResponse, err error)
CheckIn is periodically called by storage nodes to keep the satellite informed of its existence, address, and operator information. In return, this satellite keeps the node informed of its reachability. When a node checks-in with the satellite, the satellite pings the node back to confirm they can successfully connect.
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) *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 Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the contact service between storage nodes and satellites. It is responsible for updating general node information like address, capacity, and uptime. It is also responsible for updating peer identity information for verifying signatures from that node.
architecture: Service
func NewService ¶
func NewService(log *zap.Logger, self *overlay.NodeDossier, overlay *overlay.Service, peerIDs overlay.PeerIdentities, dialer rpc.Dialer) *Service
NewService creates a new contact service.
func (*Service) FetchInfo ¶ added in v0.22.0
func (service *Service) FetchInfo(ctx context.Context, target pb.Node) (_ *pb.InfoResponse, err error)
FetchInfo connects to a node and returns its node info.
func (*Service) Local ¶ added in v0.22.0
func (service *Service) Local() overlay.NodeDossier
Local returns the satellite node dossier