initialization

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotInitializing              = errors.New("not initializing")
	ErrAlreadyInitializing          = errors.New("already initializing")
	ErrCannotResetWhileInitializing = errors.New("cannot reset while initializing")
	ErrStopped                      = errors.New("gpu-post: stopped")
	ErrStateMetadataFileMissing     = errors.New("metadata file is missing")
)

Functions

func CPUProviderID

func CPUProviderID() int

func SaveMetadata

func SaveMetadata(dir string, v *Metadata) error

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(cfg Config, opts config.InitOpts, commitment []byte) (*Initializer, error)

func (*Initializer) Completed

func (init *Initializer) Completed() (bool, error)

func (*Initializer) Initialize

func (init *Initializer) Initialize() 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) SessionNumLabelsWrittenChan

func (init *Initializer) SessionNumLabelsWrittenChan() <-chan uint64

func (*Initializer) SetLogger

func (init *Initializer) SetLogger(logger Logger)

func (*Initializer) Started

func (init *Initializer) Started() (bool, error)

func (*Initializer) Stop

func (init *Initializer) Stop() error

func (*Initializer) VerifyStarted

func (init *Initializer) VerifyStarted() error

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

Jump to

Keyboard shortcuts

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