Wire up sector builder commands through the api
This commit is contained in:
@@ -7,6 +7,10 @@ import (
|
||||
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
|
||||
)
|
||||
|
||||
type SectorSealingStatus = sectorbuilder.SectorSealingStatus
|
||||
|
||||
type StagedSectorMetadata = sectorbuilder.StagedSectorMetadata
|
||||
|
||||
const CommLen = sectorbuilder.CommitmentBytesLen
|
||||
|
||||
type SectorBuilder struct {
|
||||
@@ -52,16 +56,22 @@ func (sb *SectorBuilder) SealAllStagedSectors() error {
|
||||
return sectorbuilder.SealAllStagedSectors(sb.handle)
|
||||
}
|
||||
|
||||
func (sb *SectorBuilder) SealStatus(sector uint64) (sectorbuilder.SectorSealingStatus, error) {
|
||||
func (sb *SectorBuilder) SealStatus(sector uint64) (SectorSealingStatus, error) {
|
||||
return sectorbuilder.GetSectorSealingStatusByID(sb.handle, sector)
|
||||
}
|
||||
|
||||
func (sb *SectorBuilder) GetAllStagedSectors() ([]StagedSectorMetadata, error) {
|
||||
return sectorbuilder.GetAllStagedSectors(sb.handle)
|
||||
}
|
||||
|
||||
func (sb *SectorBuilder) GeneratePoSt(sortedCommRs [][CommLen]byte, challengeSeed [CommLen]byte) ([][]byte, []uint64, error) {
|
||||
// Wait, this is a blocking method with no way of interrupting it?
|
||||
// does it checkpoint itself?
|
||||
return sectorbuilder.GeneratePoSt(sb.handle, sortedCommRs, challengeSeed)
|
||||
}
|
||||
|
||||
var UserBytesForSectorSize = sectorbuilder.GetMaxUserBytesPerStagedSector
|
||||
|
||||
func VerifySeal(sectorSize uint64, commR, commD, commRStar [CommLen]byte, proverID address.Address, sectorID uint64, proof []byte) (bool, error) {
|
||||
panic("TODO")
|
||||
// return sectorbuilder.VerifySeal(sectorSize, commR, commD, commRStar, providerID, sectorID, proof)
|
||||
|
||||
Reference in New Issue
Block a user