Documentation ¶
Index ¶
- type Candidate
- func (c *Candidate) CalculateExitProfit(ctx context.Context) (types.ExitProfitRsp, error)
- func (c *Candidate) CheckNetworkConnectable(ctx context.Context, network, targetURL string) (bool, error)
- func (c *Candidate) CheckNetworkConnectivity(ctx context.Context, network, targetURL string) error
- func (c *Candidate) DeactivateNode(ctx context.Context) error
- func (c *Candidate) GetBlocksWithAssetCID(ctx context.Context, assetCID string, randomSeed int64, randomCount int) ([]string, error)
- func (c *Candidate) GetExternalAddress(ctx context.Context) (string, error)
- func (c *Candidate) GetMinioConfig(ctx context.Context) (*types.MinioConfig, error)
- func (c *Candidate) WaitQuiet(ctx context.Context) error
- type NodeValidatedResulter
- type TCPServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct { fx.In *common.CommonAPI *asset.Asset *device.Device *vd.Validation *datasync.DataSync *container.Client Scheduler api.Scheduler Config *config.CandidateCfg TCPSrv *TCPServer }
Candidate represents the c node.
func (*Candidate) CalculateExitProfit ¶ added in v0.1.21
func (*Candidate) CheckNetworkConnectable ¶ added in v0.1.18
func (*Candidate) CheckNetworkConnectivity ¶
checkNetworkConnectivity check tcp or udp network connectivity network is "tcp" or "udp"
func (*Candidate) DeactivateNode ¶ added in v0.1.21
func (*Candidate) GetBlocksWithAssetCID ¶
func (c *Candidate) GetBlocksWithAssetCID(ctx context.Context, assetCID string, randomSeed int64, randomCount int) ([]string, error)
GetBlocksWithAssetCID returns a map of blocks with given asset CID, random seed, and random count.
func (*Candidate) GetExternalAddress ¶
GetExternalAddress retrieves the external address of the caller.
func (*Candidate) GetMinioConfig ¶ added in v0.1.11
type NodeValidatedResulter ¶
type NodeValidatedResulter interface {
NodeValidationResult(ctx context.Context, r io.Reader, sign string) error
}
NodeValidatedResulter is the interface to return the validation result
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
TCPServer handles incoming TCP connections from devices.
func NewTCPServer ¶
func NewTCPServer(cfg *config.CandidateCfg, schedulerAPI api.Scheduler, key *rsa.PrivateKey) *TCPServer
NewTCPServer initializes a new instance of TCPServer.
func (*TCPServer) StartTCPServer ¶
func (t *TCPServer) StartTCPServer()
StartTCPServer starts listening for incoming TCP connections.
Click to show internal directories.
Click to hide internal directories.