pow

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 15 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 is returned when the message is smaller than the 8-byte nonce.
	ErrMessageTooSmall = errors.New("message too small")
)
View Source
var (
	// Plugin is the plugin instance of the PoW plugin.
	Plugin = node.NewPlugin(PluginName, node.Enabled, run)
)

Functions

func DoPOW

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

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

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