Correctly construct sealbstore
This commit is contained in:
parent
9691211df1
commit
e0dc17bc1a
@ -3,6 +3,7 @@ package node
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/filecoin-project/go-lotus/storage/sealedbstore"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
@ -232,6 +233,7 @@ func Online() Option {
|
||||
ApplyIf(func(s *Settings) bool { return s.nodeType == nodeStorageMiner },
|
||||
Override(new(*sectorbuilder.SectorBuilder), sectorbuilder.New),
|
||||
Override(new(*sector.Store), sector.NewStore),
|
||||
Override(new(*sealedbstore.Sealedbstore), sealedbstore.NewSealedbstore),
|
||||
Override(new(*storage.Miner), modules.StorageMiner),
|
||||
|
||||
Override(new(dtypes.StagingDAG), modules.StagingDAG),
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type QueryResponse int
|
||||
|
||||
const (
|
||||
Available QueryResponse = iota
|
||||
Unavailable
|
||||
@ -27,5 +28,3 @@ type RetQueryResponse struct {
|
||||
|
||||
MinPricePerMiB types.BigInt // TODO: check units used for sector size
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package sealedbstore
|
||||
|
||||
import (
|
||||
"github.com/filecoin-project/go-lotus/node/modules/dtypes"
|
||||
"github.com/ipfs/go-datastore/namespace"
|
||||
"sync"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
@ -18,6 +20,8 @@ const (
|
||||
SerializationUnixfs0 SealSerialization = 'u'
|
||||
)
|
||||
|
||||
var dsPrefix = datastore.NewKey("/sealedblocks")
|
||||
|
||||
type SealedRef struct {
|
||||
Serialization SealSerialization
|
||||
|
||||
@ -33,6 +37,13 @@ type Sealedbstore struct {
|
||||
keyLk sync.Mutex
|
||||
}
|
||||
|
||||
func NewSealedbstore(sectst *sector.Store, ds dtypes.MetadataDS) *Sealedbstore {
|
||||
return &Sealedbstore{
|
||||
Store: sectst,
|
||||
keys: namespace.Wrap(ds, dsPrefix),
|
||||
}
|
||||
}
|
||||
|
||||
type UnixfsReader interface {
|
||||
files.File
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user