config

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultDataDirName = "data"

	DefaultComputeBatchSize = 1 << 20

	MinBitsPerLabel = 1
	MaxBitsPerLabel = 256
	BitsPerLabel    = 8 * 16

	KiB = 1024
	MiB = 1024 * KiB
	GiB = 1024 * MiB
)
View Source
const BestProviderID = -1

BestProviderID can be used for selecting the most performant provider based on a short benchmarking session.

Variables

View Source
var DefaultDataDir string

Functions

func Validate

func Validate(cfg Config, opts InitOpts) error

Types

type Config

type Config struct {
	MinNumUnits   uint32
	MaxNumUnits   uint32
	LabelsPerUnit uint64

	K1 uint32 // K1 specifies the difficulty for a label to be a candidate for a proof.
	K2 uint32 // K2 is the number of labels below the required difficulty required for a proof.
	K3 uint32 // K3 is the size of the subset of proof indices that is validated.

	K2PowDifficulty uint64
	K3PowDifficulty uint64
}

func DefaultConfig

func DefaultConfig() Config

type InitOpts

type InitOpts struct {
	DataDir           string
	NumUnits          uint32
	MaxFileSize       uint64
	ComputeProviderID int
	Throttle          bool
	Scrypt            ScryptParams
	// ComputeBatchSize must be greater than 0
	ComputeBatchSize uint64
}

func DefaultInitOpts

func DefaultInitOpts() InitOpts

type ScryptParams added in v0.5.1

type ScryptParams struct {
	N, R, P uint32
}

func DefaultLabelParams added in v0.5.1

func DefaultLabelParams() ScryptParams

func DefaultPowParams added in v0.5.1

func DefaultPowParams() ScryptParams

func (*ScryptParams) Validate added in v0.5.1

func (p *ScryptParams) Validate() error

Jump to

Keyboard shortcuts

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