candidate

package
v0.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

Candidate represents the c node.

func (*Candidate) CalculateExitProfit added in v0.1.21

func (c *Candidate) CalculateExitProfit(ctx context.Context) (types.ExitProfitRsp, error)

func (*Candidate) CheckNetworkConnectable added in v0.1.18

func (c *Candidate) CheckNetworkConnectable(ctx context.Context, network, targetURL string) (bool, error)

func (*Candidate) CheckNetworkConnectivity

func (c *Candidate) CheckNetworkConnectivity(ctx context.Context, network, targetURL string) error

checkNetworkConnectivity check tcp or udp network connectivity network is "tcp" or "udp"

func (*Candidate) DeactivateNode added in v0.1.21

func (c *Candidate) DeactivateNode(ctx context.Context) error

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

func (c *Candidate) GetExternalAddress(ctx context.Context) (string, error)

GetExternalAddress retrieves the external address of the caller.

func (*Candidate) GetMinioConfig added in v0.1.11

func (c *Candidate) GetMinioConfig(ctx context.Context) (*types.MinioConfig, error)

func (*Candidate) WaitQuiet

func (c *Candidate) WaitQuiet(ctx context.Context) error

WaitQuiet does nothing and returns nil error.

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.

func (*TCPServer) Stop

func (t *TCPServer) Stop(ctx context.Context) error

Stop stops the TCP server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL