initialization

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyInitializing          = errors.New("already initializing")
	ErrCannotResetWhileInitializing = errors.New("cannot reset while initializing")
	ErrStateMetadataFileMissing     = errors.New("metadata file is missing")
)

Functions

func CPUProviderID

func CPUProviderID() int

func SaveMetadata

func SaveMetadata(dir string, v *Metadata) error

func WithCommitment added in v0.2.0

func WithCommitment(commitment []byte) initializeOptionFunc

func WithConfig added in v0.2.0

func WithConfig(cfg Config) initializeOptionFunc

func WithInitOpts added in v0.2.0

func WithInitOpts(initOpts config.InitOpts) initializeOptionFunc

func WithLogger added in v0.2.0

func WithLogger(logger Logger) initializeOptionFunc

Types

type ComputeProvider

type ComputeProvider = gpu.ComputeProvider

func Providers

func Providers() []ComputeProvider

type Config

type Config = config.Config

type ConfigMismatchError

type ConfigMismatchError = shared.ConfigMismatchError

type DiskState

type DiskState struct {
	// contains filtered or unexported fields
}

func NewDiskState

func NewDiskState(datadir string, bitsPerLabel uint) *DiskState

func (*DiskState) NumBytesWritten

func (d *DiskState) NumBytesWritten() (uint64, error)

func (*DiskState) NumLabelsWritten

func (d *DiskState) NumLabelsWritten() (uint64, error)

type InitOpts

type InitOpts = config.InitOpts

type Initializer

type Initializer struct {
	// contains filtered or unexported fields
}

func NewInitializer

func NewInitializer(opts ...initializeOptionFunc) (*Initializer, error)

func (*Initializer) Initialize

func (init *Initializer) Initialize(ctx context.Context) error

Initialize is the process in which the prover commits to store some data, by having its storage filled with pseudo-random data with respect to a specific id. This data is the result of a computationally-expensive operation.

func (*Initializer) Reset

func (init *Initializer) Reset() error

func (*Initializer) SessionNumLabelsWritten

func (init *Initializer) SessionNumLabelsWritten() uint64

func (*Initializer) Status added in v0.2.0

func (init *Initializer) Status() Status

type Logger

type Logger = shared.Logger

type Metadata

type Metadata struct {
	Commitment    []byte
	BitsPerLabel  uint8
	LabelsPerUnit uint64
	NumUnits      uint32
	NumFiles      uint32
}

metadata is the data associated with the PoST init procedure, persisted in the datadir next to the init files.

func LoadMetadata

func LoadMetadata(dir string) (*Metadata, error)

type Proof

type Proof = shared.Proof

type Status added in v0.2.0

type Status int
const (
	StatusNotStarted Status = iota
	StatusStarted
	StatusInitializing
	StatusCompleted
	StatusError
)

Jump to

Keyboard shortcuts

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