Make client import actually work
This commit is contained in:
parent
55b9f8d550
commit
cec4918cd9
@ -59,6 +59,7 @@ func reqContext(cctx *cli.Context) context.Context {
|
||||
}
|
||||
|
||||
var Commands = []*cli.Command{
|
||||
clientCmd,
|
||||
chainCmd,
|
||||
netCmd,
|
||||
versionCmd,
|
||||
|
@ -40,8 +40,8 @@ func (s *LocalStorage) ClientImport(ctx context.Context, path string) (cid.Cid,
|
||||
Maxlinks: ihelper.DefaultLinksPerBlock,
|
||||
RawLeaves: true,
|
||||
CidBuilder: nil,
|
||||
Dagserv: bufferedDS, // flush?
|
||||
NoCopy: false,
|
||||
Dagserv: bufferedDS,
|
||||
NoCopy: true,
|
||||
}
|
||||
|
||||
db, err := params.New(chunker.DefaultSplitter(file))
|
||||
|
@ -87,6 +87,8 @@ func ClientDAG(lc fx.Lifecycle, r repo.LockedRepo) (ipld.DAGService, error) {
|
||||
blocks := namespace.Wrap(clientds, datastore.NewKey("blocks"))
|
||||
|
||||
fm := filestore.NewFileManager(clientds, filepath.Dir(r.Path()))
|
||||
fm.AllowFiles = true
|
||||
// TODO: fm.AllowUrls (needs more code in client import)
|
||||
|
||||
bs := blockstore.NewBlockstore(blocks)
|
||||
fstore := filestore.NewFilestore(bs, fm)
|
||||
|
@ -151,6 +151,9 @@ func (fsr *fsLockedRepo) stillValid() error {
|
||||
func (fsr *fsLockedRepo) Datastore(ns string) (datastore.Batching, error) {
|
||||
fsr.dsOnce.Do(func() {
|
||||
fsr.ds, fsr.dsErr = badger.NewDatastore(fsr.join(fsDatastore), nil)
|
||||
/*if fsr.dsErr == nil {
|
||||
fsr.ds = datastore.NewLogDatastore(fsr.ds, "fsrepo")
|
||||
}*/
|
||||
})
|
||||
if fsr.dsErr != nil {
|
||||
return nil, fsr.dsErr
|
||||
|
Loading…
Reference in New Issue
Block a user