ffiwrapper

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0, MIT Imports: 33 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PC2CheckRounds = 3
View Source
var ProofProver = proofProver{}
View Source
var ProofVerifier = proofVerifier{}

Functions

func GenerateUnsealedCID

func GenerateUnsealedCID(proofType abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error)

func GetRequiredPadding

func GetRequiredPadding(oldLength abi.PaddedPieceSize, newPieceLength abi.PaddedPieceSize) ([]abi.PaddedPieceSize, abi.PaddedPieceSize)

Types

type Sealer

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

func New

func New(sectors SectorProvider) (*Sealer, error)

func (*Sealer) AcquireSectorKeyOrRegenerate

func (sb *Sealer) AcquireSectorKeyOrRegenerate(ctx context.Context, sector storiface.SectorRef, randomness abi.SealRandomness) (storiface.SectorPaths, func(), error)

func (*Sealer) AddPiece

func (sb *Sealer) AddPiece(ctx context.Context, sector storiface.SectorRef, existingPieceSizes []abi.UnpaddedPieceSize, pieceSize abi.UnpaddedPieceSize, pieceData storiface.Data) (abi.PieceInfo, error)

func (*Sealer) DataCid

func (sb *Sealer) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storiface.Data) (abi.PieceInfo, error)

func (*Sealer) DownloadSectorData added in v1.17.2

func (sb *Sealer) DownloadSectorData(ctx context.Context, sector storiface.SectorRef, finalized bool, src map[storiface.SectorFileType]storiface.SectorLocation) error

func (*Sealer) FinalizeReplicaUpdate

func (sb *Sealer) FinalizeReplicaUpdate(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) FinalizeSector

func (sb *Sealer) FinalizeSector(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) FinalizeSectorInto added in v1.17.2

func (sb *Sealer) FinalizeSectorInto(ctx context.Context, sector storiface.SectorRef, dest string) error

FinalizeSectorInto is like FinalizeSector, but writes finalized sector cache into a new path

func (*Sealer) GenerateSectorKeyFromData

func (sb *Sealer) GenerateSectorKeyFromData(ctx context.Context, sector storiface.SectorRef, commD cid.Cid) error

func (*Sealer) GenerateWindowPoSt

func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, postProofType abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error)

func (*Sealer) GenerateWindowPoStWithVanilla

func (sb *Sealer) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error)

func (*Sealer) GenerateWinningPoSt

func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error)

func (*Sealer) GenerateWinningPoStWithVanilla

func (sb *Sealer) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, vanillas [][]byte) ([]proof.PoStProof, error)

func (*Sealer) NewSector

func (sb *Sealer) NewSector(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) ProveReplicaUpdate1

func (sb *Sealer) ProveReplicaUpdate1(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storiface.ReplicaVanillaProofs, error)

func (*Sealer) ProveReplicaUpdate2

func (sb *Sealer) ProveReplicaUpdate2(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storiface.ReplicaVanillaProofs) (storiface.ReplicaUpdateProof, error)

func (*Sealer) ReadPiece

func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)

func (*Sealer) RegenerateSectorKey

func (sb *Sealer) RegenerateSectorKey(ctx context.Context, sector storiface.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) error

func (*Sealer) ReleaseReplicaUpgrade

func (sb *Sealer) ReleaseReplicaUpgrade(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) ReleaseSealed

func (sb *Sealer) ReleaseSealed(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) ReleaseSectorKey

func (sb *Sealer) ReleaseSectorKey(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) ReleaseUnsealed

func (sb *Sealer) ReleaseUnsealed(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) error

func (*Sealer) Remove

func (sb *Sealer) Remove(ctx context.Context, sector storiface.SectorRef) error

func (*Sealer) ReplicaUpdate

func (sb *Sealer) ReplicaUpdate(ctx context.Context, sector storiface.SectorRef, pieces []abi.PieceInfo) (storiface.ReplicaUpdateOut, error)

func (*Sealer) SealCommit1

func (*Sealer) SealCommit2

func (sb *Sealer) SealCommit2(ctx context.Context, sector storiface.SectorRef, phase1Out storiface.Commit1Out) (storiface.Proof, error)

func (*Sealer) SealPreCommit1

func (sb *Sealer) SealPreCommit1(ctx context.Context, sector storiface.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (out storiface.PreCommit1Out, err error)

func (*Sealer) SealPreCommit2

func (sb *Sealer) SealPreCommit2(ctx context.Context, sector storiface.SectorRef, phase1Out storiface.PreCommit1Out) (storiface.SectorCids, error)

func (*Sealer) Stop

func (sb *Sealer) Stop()

func (*Sealer) UnsealPiece

func (sb *Sealer) UnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd cid.Cid) error

type SectorProvider

type SectorProvider interface {
	// * returns storiface.ErrSectorNotFound if a requested existing sector doesn't exist
	// * returns an error when allocate is set, and existing isn't, and the sector exists
	AcquireSector(ctx context.Context, id storiface.SectorRef, existing storiface.SectorFileType, allocate storiface.SectorFileType, ptype storiface.PathType) (storiface.SectorPaths, func(), error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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