Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs files cp does not ensure recursive content #4

Closed
hacdias opened this issue Oct 6, 2019 · 5 comments · Fixed by #5
Closed

ipfs files cp does not ensure recursive content #4

hacdias opened this issue Oct 6, 2019 · 5 comments · Fixed by #5

Comments

@hacdias
Copy link
Member

hacdias commented Oct 6, 2019

While working on cohosting.sh and ipfs-cohost, I noticed ipfs files cp does not ensure recursive content. It just links the hash to a certain place in MFS and only fetches it if the user actually goes there.

Even though having a directory on MFS prevents it from being garbage collected, it does not get recursively fetched when copying for the first time.

/cc @lidel @autonome

@hacdias
Copy link
Member Author

hacdias commented Oct 6, 2019

An alternative way, for now, could be to first pin to make sure we have all the contents in the repo. Is there any command similar to pin that fetches recursively something to the repo but does not pin?

@lidel
Copy link
Member

lidel commented Oct 7, 2019

@hacdias We should avoid using low level pins here. I believe ipfs refs --recursive <CID> is what you want. It lists all children of the root CID, which has a side-effect of preloading all content to the local repo :)

@hacdias
Copy link
Member Author

hacdias commented Oct 7, 2019

A way to solve this, for now, is to call ipfs get $cid and ignore the results or ipfs refs -r $cid before copying to MFS. That way we can get everything block.

@hacdias
Copy link
Member Author

hacdias commented Oct 7, 2019

Oh, sorry. Replied and what you said hasn't been loaded before. I'll PR.

@lidel
Copy link
Member

lidel commented Oct 8, 2019

I created #6 to discuss idea of "Lazy cohosting" that takes advantage of how ipfs files cp works.

@hacdias hacdias closed this as completed in #5 Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants