config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultDataDirName = "data"

	DefaultMaxFileSize = uint64(4294967296) // 4 GB

	// DefaultComputeBatchSize value must be divisible by 8, to guarantee that writing to disk
	// and file truncating is byte-granular regardless of `BitsPerLabel` value.
	DefaultComputeBatchSize = 1 << 14

	DefaultBitsPerLabel = 8
	DefaultMaxNumUnits  = 10
	DefaultMinNumUnits  = 1

	DefaultLabelsPerUnit = 1 << 11 // 2KB per unit.

	DefaultK1             = 200
	DefaultK2             = 212
	DefaultNonceBatchSize = 32
	DefaultAESBatchSize   = 4
)
View Source
const (
	MaxBitsPerLabel = 256
	MinBitsPerLabel = 1

	MinFileSize = 1024
)
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
	BitsPerLabel  uint8
	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.
	B  uint32 // B is the number of labels used per AES invocation when generating a proof. Lower values speed up verification, higher values proof generation.
	N  uint32 // N is the number of nonces tried at the same time when generating a proof.

}

func DefaultConfig

func DefaultConfig() Config

type InitOpts

type InitOpts struct {
	DataDir           string
	NumUnits          uint32
	MaxFileSize       uint64
	ComputeProviderID int
	Throttle          bool
}

func DefaultInitOpts

func DefaultInitOpts() InitOpts

Jump to

Keyboard shortcuts

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