mine

package
v0.0.0-...-4502c18 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHashNonce

func GetHashNonce(data []byte, nonce uint32) []byte

GetHashNonce takes a set of bytes and nonce, combines them and issues a joint hash.

func StartMine

func StartMine(message []byte, complexity int, threads int) chan uint32

StartMine is the basic mining function for selecting the nonce field. Pass here an array of bytes, the complexity and number of gorutines. In response you will receive a chan that will return a nonce suitable in the future.

Types

type Mine

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

func NewMine

func NewMine(obj Miner) *Mine

func (*Mine) Running

func (m *Mine) Running() bool

func (*Mine) Start

func (m *Mine) Start(threads int) *sync.WaitGroup

func (*Mine) Stop

func (m *Mine) Stop()

type Miner

type Miner interface {
	interfaces.Byter
	GetTimestamp() *int64
	GetNonce() *uint32
	GetId() *[]byte
	GetComplexity() int
}

Jump to

Keyboard shortcuts

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