client: Unbreak retrieval

This commit is contained in:
Łukasz Magiera
2020-07-07 14:35:02 +02:00
parent d370e0ae2d
commit 55f089d997
3 changed files with 18 additions and 9 deletions
+7 -2
View File
@@ -2,7 +2,7 @@ package modules
import (
"context"
"github.com/filecoin-project/lotus/lib/bufbstore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/libp2p/go-libp2p-core/host"
"go.uber.org/fx"
@@ -50,7 +50,12 @@ func ClientImportMgr(mds dtypes.ClientMultiDstore, ds dtypes.MetadataDS) dtypes.
}
func ClientBlockstore(imgr dtypes.ClientImportMgr) dtypes.ClientBlockstore {
return blockstore.NewIdStore(imgr.Blockstore)
// TODO: This isn't.. the best
// - If it's easy to pass per-retrieval blockstores with markets we don't need this
// - If it's not easy, we need to store this in a separate datastore on disk
defaultWrite := blockstore.NewBlockstore(datastore.NewMapDatastore())
return blockstore.NewIdStore(bufbstore.NewTieredBstore(imgr.Blockstore, defaultWrite))
}
// RegisterClientValidator is an initialization hook that registers the client