ipfs / ipfs/ipfs-webui

feat: User can choose to import entire tree when importing content

Open
#1,691 5 comments 0 reactions 0 assignees View on GitHub
area/screen/files effort/days exp/intermediate help wanted kind/enhancement P3 status/ready
Dominant language
JavaScript
Stars
1.6k
Forks
534
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
"Import from IPFS" implies it will fetch the content to your local repo. Currently It only fetches the root block, as, for reasons I do not yet understand that is how `ipfs files cp` works. It does not check if you have the full tree locally.

from the go-ipfs help, it looks like the assumption is that you will `ipfs add` something or otherwise ensure the blocks are available locally, and then `ipfs files cp` it to your mfs:

```
In order to add content to MFS from disk, you can use "ipfs add" to obtain the
IPFS Content Identifier and then "ipfs files cp" to copy it into MFS:

$ ipfs add --quieter --pin=false
# ...
# ... outputs the root CID at the end
$ ipfs cp /ipfs/ /your/desired/mfs/path

– go-ipfs help from `ipfs files cp --help`
```

we can do a recursive refs fetch or similar to make "import from IPFS" do what it sounds like it would do.

**To Reproduce**
Steps to reproduce the behavior:
1. *Import from IPFS* path a thing that only exists on 1 provider.
2. shutdown the provider
3. bad news, you dont have the full tree locally, and you can't fetch it from anywhere.

**Expected behavior**
Import from IPFS should add the blocks to my repo *and* `ipfs files cp` them into the MFS. If we want to be smart about it we could stat the root block and if it is larger than would fit in the users repo, then warn them and ask if they want to do a lazy import.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.