sentient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//HashSize is the length of a sentient hash
	HashSize = 32
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(connectionstring, pooluser string, version string) (sc clients.Client)

NewClient creates a new SentientdClient given a '[stratum+tcp://]host:port' connectionstring

func NewSenHash

func NewSenHash() hash.Hash

NewSenHash creates a new instance of SenHash with blake512 as the underlying hasher.

Types

type Miner

type Miner struct {
	ClDevices       map[int]*cl.Device
	HashRateReports chan *mining.HashRateReport

	//Intensity defines the GlobalItemSize in a human friendly way, the GlobalItemSize = 2^Intensity
	Intensity      int
	GlobalItemSize int
	Client         clients.Client
	// contains filtered or unexported fields
}

Miner actually mines

func (*Miner) Mine

func (m *Miner) Mine()

Mine spawns a seperate miner for each device defined in the CLDevices and feeds it with work

type SenHash

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

SenHash is an abstraction to make blake-512 hasher return a 256-bit prefix. This is really a pretty lazy solution driven by lack of proper time and resources to fully switch the entire codebase to using 512-bit hashes and entropy.

func (SenHash) BlockSize

func (h SenHash) BlockSize() int

BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.

func (SenHash) Reset

func (h SenHash) Reset()

Reset resets the Hash to its initial state.

func (SenHash) Size

func (h SenHash) Size() int

Size returns the number of bytes Sum will return.

func (SenHash) Sum

func (h SenHash) Sum(b []byte) []byte

Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.

func (SenHash) Write

func (h SenHash) Write(p []byte) (n int, err error)

Write adds data to the underlying hasher. Part of the io.Writer interface

type SentientdClient

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

SentientdClient is a simple client to a sentientd

func (*SentientdClient) GetHeaderForWork

func (sc *SentientdClient) GetHeaderForWork() (target []byte, header []byte, deprecationChannel chan bool, job interface{}, err error)

GetHeaderForWork fetches new work from the sentient daemon

func (*SentientdClient) SetDeprecatedJobCall

func (sc *SentientdClient) SetDeprecatedJobCall(call clients.DeprecatedJobCall)

SetDeprecatedJobCall does nothing

func (*SentientdClient) Start

func (sc *SentientdClient) Start()

Start does nothing

func (*SentientdClient) SubmitHeader

func (sc *SentientdClient) SubmitHeader(header []byte, job interface{}) (err error)

SubmitHeader reports a solved header to the sentient daemon

type StratumClient

type StratumClient struct {
	User    string
	Version string

	clients.BaseClient
	// contains filtered or unexported fields
}

StratumClient is a sentient client using the stratum protocol

func (*StratumClient) GetHeaderForWork

func (sc *StratumClient) GetHeaderForWork() (target []byte, header []byte, deprecationChannel chan bool, job interface{}, err error)

GetHeaderForWork fetches new work over the stratum protocol

func (*StratumClient) Start

func (sc *StratumClient) Start()

Start connects to the stratumserver and processes the notifications

func (*StratumClient) SubmitHeader

func (sc *StratumClient) SubmitHeader(header []byte, job interface{}) (err error)

SubmitHeader reports a solution to the stratum server

type Target

type Target [HashSize]byte

Target declares what a solution should be smaller than to be accepted

Jump to

Keyboard shortcuts

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