storage

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0, MIT Imports: 30 Imported by: 4

Documentation

Index

Constants

View Source
const Inactive = 0
View Source
const NonceIncrement = math.MaxUint64
View Source
const SectorStorePrefix = "/sectors"
View Source
const StartConfidence = 4 // TODO: config

Variables

This section is empty.

Functions

This section is empty.

Types

type Miner

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

func NewMiner

func NewMiner(api storageMinerApi, addr address.Address, h host.Host, ds datastore.Batching, sb *sectorbuilder.SectorBuilder, tktFn TicketFn) (*Miner, error)

func (*Miner) AllocatePiece

func (m *Miner) AllocatePiece(size uint64) (sectorID uint64, offset uint64, err error)

func (*Miner) GetSectorInfo

func (m *Miner) GetSectorInfo(sid uint64) (SectorInfo, error)

func (*Miner) ListSectors

func (m *Miner) ListSectors() ([]SectorInfo, error)

func (*Miner) PledgeSector

func (m *Miner) PledgeSector() error

func (*Miner) Run

func (m *Miner) Run(ctx context.Context) error

func (*Miner) SealPiece

func (m *Miner) SealPiece(ctx context.Context, size uint64, r io.Reader, sectorID uint64, dealID uint64) error

func (*Miner) Stop

func (m *Miner) Stop(ctx context.Context) error

func (*Miner) UpdateSectorState

func (m *Miner) UpdateSectorState(ctx context.Context, sector uint64, snonce uint64, state api.SectorState) error

type Piece

type Piece struct {
	DealID uint64

	Size  uint64
	CommP []byte
}

func (*Piece) MarshalCBOR

func (t *Piece) MarshalCBOR(w io.Writer) error

func (*Piece) UnmarshalCBOR

func (t *Piece) UnmarshalCBOR(r io.Reader) error

type SealSeed

type SealSeed struct {
	BlockHeight uint64
	TicketBytes []byte
}

func (*SealSeed) MarshalCBOR

func (t *SealSeed) MarshalCBOR(w io.Writer) error

func (*SealSeed) SB

func (*SealSeed) UnmarshalCBOR

func (t *SealSeed) UnmarshalCBOR(r io.Reader) error

type SealTicket

type SealTicket struct {
	BlockHeight uint64
	TicketBytes []byte
}

func (*SealTicket) MarshalCBOR

func (t *SealTicket) MarshalCBOR(w io.Writer) error

func (*SealTicket) SB

func (*SealTicket) UnmarshalCBOR

func (t *SealTicket) UnmarshalCBOR(r io.Reader) error

type SectorBuilderEpp

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

func NewElectionPoStProver

func NewElectionPoStProver(sb *sectorbuilder.SectorBuilder) *SectorBuilderEpp

func (*SectorBuilderEpp) ComputeProof

func (epp *SectorBuilderEpp) ComputeProof(ctx context.Context, ssi sectorbuilder.SortedPublicSectorInfo, rand []byte, winners []sectorbuilder.EPostCandidate) ([]byte, error)

func (*SectorBuilderEpp) GenerateCandidates

type SectorInfo

type SectorInfo struct {
	State    api.SectorState
	SectorID uint64
	Nonce    uint64

	Pieces []Piece

	// PreCommit
	CommD  []byte
	CommR  []byte
	Proof  []byte
	Ticket SealTicket

	PreCommitMessage *cid.Cid

	// PreCommitted
	Seed SealSeed

	// Committing
	CommitMessage *cid.Cid

	// Faults
	FaultReportMsg *cid.Cid

	// Debug
	LastErr string
}

func (*SectorInfo) MarshalCBOR

func (t *SectorInfo) MarshalCBOR(w io.Writer) error

func (*SectorInfo) UnmarshalCBOR

func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error

type TicketFn

type TicketFn func(context.Context) (*sectorbuilder.SealTicket, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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