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
Types ¶
type 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.
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 (*InitOpts) TotalFiles ¶ added in v0.8.7
func (*InitOpts) TotalLabels ¶ added in v0.8.7
type PowFlags ¶ added in v0.7.0
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
Click to show internal directories.
Click to hide internal directories.