Correctly construct sealbstore

This commit is contained in:
Łukasz Magiera 2019-08-26 11:08:39 +02:00
parent 9691211df1
commit e0dc17bc1a
3 changed files with 22 additions and 10 deletions

View File

@ -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),

View File

@ -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
}

View File

@ -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