pow

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0, BSD-2-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// CfgPOWDifficulty defines the config flag of the PoW difficulty.
	CfgPOWDifficulty = "pow.difficulty"
	// CfgPOWNumThreads defines the config flag of the number of threads used to do the PoW.
	CfgPOWNumThreads = "pow.numThreads"
	// CfgPOWTimeout defines the config flag for the PoW timeout.
	CfgPOWTimeout = "pow.timeout"
)
View Source
const PluginName = "PoW"

PluginName is the name of the PoW plugin.

Variables

View Source
var ErrMessageTooSmall = errors.New("message too small")

ErrMessageTooSmall is returned when the message is smaller than the 8-byte nonce.

Functions

func DoPOW

func DoPOW(msg []byte) (uint64, error)

DoPOW performs the PoW on the provided msg and returns the nonce.

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func Worker

func Worker() *pow.Worker

Worker returns the PoW worker instance of the PoW plugin.

Types

This section is empty.

Jump to

Keyboard shortcuts

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