duino

package module
v0.0.0-...-3a66eeb Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 7 Imported by: 0

README

duino

A simple duinocoin pool API wrapper for golang.

Benchmarks

Benchmarked using this code

AMD Ryzen 5 5600G (12) @ 3.900GHz

DoJob(AVR): 74 (81.33µs)
DoJobMulti(AVR): 74 (812.57µs)
DoJob(ESP32): 52020 (18.509911ms)
DoJobMulti(ESP32): 52020 (5.42038ms)
DoJob(LOW): 2520154 (1.620081394s)
DoJobMulti(LOW): 2520154 (284.422773ms)
DoJob(MEDIUM): 14103739 (8.843125167s)
DoJobMulti(MEDIUM): 14103739 (1.384273916s)
DoJob(HIGH): 59515575 (42.686280546s)
DoJobMulti(HIGH): 59515575 (6.353000107s)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJob

func DoJob(job Job) (int, error)

Calculates a job with a single thread. This function will return -1 in case a valid answer is not found.

func DoJobMulti

func DoJobMulti(job Job, threads int) (result int, err error)

Calculates a job with multiple threads. This function will return -1 in case a valid answer is not found.

Types

type Conn

type Conn struct {
	net.Conn
}

func NewConn

func NewConn(pool string) (Conn, error)

func WrapConn

func WrapConn(tcpconn net.Conn) (Conn, error)

func (*Conn) GetJob

func (conn *Conn) GetJob(username, difficulty string) (Job, error)

func (*Conn) ReadVersion

func (conn *Conn) ReadVersion() error

func (*Conn) SubmitJob

func (conn *Conn) SubmitJob(res int, hashrate float32, minerName, rigIdentifier string) (JobResult, error)

type Job

type Job struct {
	// The hash "base", basically a string that is appended before every hash
	Base string
	// The expected result's hash
	Expected string
	// The difficulty of the job
	Difficulty int
}

type JobResult

type JobResult struct {
	// If the job result was successful or not
	Success bool
	// The reason for the job result not being successful
	Reason string
}

Jump to

Keyboard shortcuts

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