pool

package
v0.0.0-...-5ed304f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobList

type JobList struct {
	// contains filtered or unexported fields
}

func (*JobList) Append

func (l *JobList) Append(job *types.StratumJob) bool

func (*JobList) Get

func (l *JobList) Get(id string) (*types.StratumJob, bool)

func (*JobList) GetPrior

func (l *JobList) GetPrior(id string) (*types.StratumJob, bool)

func (*JobList) Latest

func (l *JobList) Latest() *types.StratumJob

func (*JobList) Oldest

func (l *JobList) Oldest() *types.StratumJob

func (*JobList) Size

func (l *JobList) Size() int

type JobManager

type JobManager struct {
	// contains filtered or unexported fields
}

func (*JobManager) AddConn

func (m *JobManager) AddConn(c *stratum.Conn)

func (*JobManager) GetJob

func (m *JobManager) GetJob(id string) (*types.StratumJob, bool)

func (*JobManager) GetPriorJob

func (m *JobManager) GetPriorJob(id string) (*types.StratumJob, bool)

func (*JobManager) LatestJob

func (m *JobManager) LatestJob() *types.StratumJob

func (*JobManager) RemoveConn

func (m *JobManager) RemoveConn(id uint64)

type Options

type Options struct {
	Chain                string
	PortDiffIdx          map[int]int
	WindowSize           int
	ExtraNonceSize       int
	JobListSize          int
	JobListAgeLimit      int
	SoloEnabled          bool
	VarDiffEnabled       bool
	StreamEnabled        bool
	ForceErrorOnResponse bool
	Flush                bool
	PollingPeriod        time.Duration
	PingingPeriod        time.Duration
	Metrics              *metrics.Client
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func New

func New(
	node types.MiningNode,
	dbClient *dbcl.Client,
	redisClient *redis.Client,
	logger *log.Logger,
	telegramClient *telegram.Client,
	metricsClient *metrics.Client,
	opt *Options,
) (*Pool, error)

func (*Pool) Port

func (p *Pool) Port(idx int) int

func (*Pool) Serve

func (p *Pool) Serve()

func (*Pool) Stop

func (p *Pool) Stop()

type ProtocolHandler

type ProtocolHandler func(*stratum.Conn, *rpc.Request) error

Jump to

Keyboard shortcuts

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