2020-03-26 02:50:56 +00:00
|
|
|
package ffiwrapper
|
|
|
|
|
|
|
|
import (
|
2023-08-18 14:53:59 +00:00
|
|
|
"context"
|
2023-08-18 15:13:57 +00:00
|
|
|
|
2023-08-18 14:53:59 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
2020-03-26 02:50:56 +00:00
|
|
|
logging "github.com/ipfs/go-log/v2"
|
2023-08-18 15:13:57 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
2020-03-26 02:50:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var log = logging.Logger("ffiwrapper")
|
|
|
|
|
2023-08-18 14:53:59 +00:00
|
|
|
type ExternPrecommit2 func(ctx context.Context, sector storiface.SectorRef, cache, sealed string, pc1out storiface.PreCommit1Out) (sealedCID cid.Cid, unsealedCID cid.Cid, err error)
|
|
|
|
|
|
|
|
type ExternalSealer struct {
|
|
|
|
PreCommit2 ExternPrecommit2
|
|
|
|
}
|
|
|
|
|
2020-03-26 19:34:38 +00:00
|
|
|
type Sealer struct {
|
2023-08-18 14:53:59 +00:00
|
|
|
sectors SectorProvider
|
|
|
|
|
|
|
|
// externCalls cointain overrides for calling alternative sealing logic
|
|
|
|
externCalls ExternalSealer
|
|
|
|
|
2020-03-26 02:50:56 +00:00
|
|
|
stopping chan struct{}
|
|
|
|
}
|
|
|
|
|
2020-03-26 19:34:38 +00:00
|
|
|
func (sb *Sealer) Stop() {
|
2020-03-26 02:50:56 +00:00
|
|
|
close(sb.stopping)
|
|
|
|
}
|