config

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultDataDirName = "data"

	DefaultComputeBatchSize = 1 << 20

	MinBitsPerLabel = 1
	MaxBitsPerLabel = 256
	BitsPerLabel    = 8 * postrs.LabelLength

	KiB = 1024
	MiB = 1024 * KiB
	GiB = 1024 * MiB
)
View Source
const (
	// Use the full dataset. AKA "Fast mode".
	PowFastMode = postrs.PowFastMode
	// Allocate memory in large pages.
	PowLargePages = postrs.PowLargePages
	// Use JIT compilation support.
	PowJIT = postrs.PowJIT
	// When combined with FLAG_JIT, the JIT pages are never writable and executable at the same time.
	PowSecure = postrs.PowSecure
	// Use hardware accelerated AES.
	PowHardAES = postrs.PowHardAES
	// Optimize Argon2 for CPUs with the SSSE3 instruction set.
	PowArgon2SSSE3 = postrs.PowArgon2SSSE3
	// Optimize Argon2 for CPUs with the SSSE3 instruction set.
	PowArgon2AVX2 = postrs.PowArgon2AVX2
	// Optimize Argon2 for CPUs without the AVX2 or SSSE3 instruction sets.
	PowArgon2 = postrs.PowArgon2
)

Variables

View Source
var DefaultDataDir string

Functions

func BytesPerLabel added in v0.8.7

func BytesPerLabel() int

func Validate

func Validate(cfg Config, opts InitOpts) error

Types

type Config

type Config postrs.Config

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default config. These are intended for testing.

func MainnetConfig added in v0.8.5

func MainnetConfig() Config

MainnetConfig returns the default config for mainnet.

func (*Config) UnitSize added in v0.8.7

func (c *Config) UnitSize() uint64

type InitOpts

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

	// Index of the first file to init (inclusive)
	FromFileIdx int
	// Index of the last file to init (inclusive). Will init to the end of declared space if not provided.
	ToFileIdx *int
}

func DefaultInitOpts

func DefaultInitOpts() InitOpts

DefaultInitOpts returns the default InitOpts. These are intended for testing.

func MainnetInitOpts added in v0.8.5

func MainnetInitOpts() InitOpts

MainnetInitOpts returns the default InitOpts for mainnet.

func (*InitOpts) MaxFileNumLabels added in v0.8.7

func (o *InitOpts) MaxFileNumLabels() uint64

func (*InitOpts) TotalFiles added in v0.8.7

func (o *InitOpts) TotalFiles(labelsPerUnit uint64) int

func (*InitOpts) TotalLabels added in v0.8.7

func (o *InitOpts) TotalLabels(labelsPerUnit uint64) uint64

type PowFlags added in v0.7.0

type PowFlags = postrs.PowFlags

func DefaultProvingPowFlags added in v0.7.0

func DefaultProvingPowFlags() PowFlags

func DefaultVerifyingPowFlags added in v0.7.0

func DefaultVerifyingPowFlags() PowFlags

func RecommendedPowFlags added in v0.7.0

func RecommendedPowFlags() PowFlags

type ScryptParams added in v0.5.1

type ScryptParams struct {
	N, R, P uint
}

func DefaultLabelParams added in v0.5.1

func DefaultLabelParams() 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