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
[BOUNTY] Implement UnixFSv1.5 in go-ipfs #6920
Comments
|
For context, here is the js-ipfs unixfsv1.5 implementation done by @achingbrain: ipfs/js-ipfs#2621, and the blog post describing the shipped work: https://blog.ipfs.io/2020-02-13-js-ipfs-0-41/#unixfs-v1-5 If you want to start working on this, ping @Stebalien for a quick walkthrough of where to start and what already exists to build on top! |
Implementation NotesImplementing this feature will touch several sub-components of go-ipfs:
The new go-ipfs-files // Node is a common interface for files, directories and other special files
type Node interface {
io.Closer
// Mode returns the file's Mode
Mode() os.FileMode
// ModTime returns the files last modification time.
//
// If the last modification time is unknown/unspecified, ok is false and
// the mtime is the Unix epoch (default timestamp).
ModTime() (mtime time.Time, ok bool)
// Size returns size of this file (if this file is a directory, total size of
// all files stored in the tree should be returned). Some implementations may
// choose not to implement this
Size() (int64, error)
} |
|
@Stebalien Hi, @momack2 said to ping you for a walkthrough if one would like to start working on this, but I think it is safe to assume that your last comment is that walkthrough, and I will just go ahead. Thanks! |
|
And there are two new mfs commands:
|
|
Hey @kalmi! How are things going? Did you get your questions answered / are you unblocked? |
|
Hi! Thanks. I'm not blocked, I had some personal issues last week, sorry for the silence. I plan to spend most of the upcoming long weekend on this. So far I have got Status (WIP, "done" is very loosely defined at this point, this list is bound to be incomplete):
|
|
I'd drop the last two for now. Everything else looks good to me. Note: If you're trying to find where different types/functions are being used, I recommend grep.app. E.g., .NewMultiFileReader. |
|
Hey @kalmi! Any status update? Are you blocked? |
|
@momack2 I am making progress, albeit unfortunately it is slower than I originally expected due to external factors. Now I am at the point where I believe the I am making sure that all changes to the libraries are backward compatible. The Node interface change specified by Stebalien is not, but I guess that's reasonable and acceptable. When I have everything working, I will start making PRs in the proper merge order. Do you have a reasonable timeframe in mind for this that I should be aware of? |
|
Hey @kalmi! It'd be great to include this feature in the next release, go-ipfs 0.6. I think the feature cut for that release is ~2 weeks from Wednesday. Do you think that's a reasonable goal? Note, the sooner to put up draft PRs for review (and the more modular/well tested they are) the easier it will be to land this quickly. =] |
Could you open an issue on ipfs/js-ipfs please and we'll see if we can get to the bottom of the problem you had? |
|
@kalmi Any status updates? |
|
Thanks @kstuart the implementation notes in this issue are hopefully clear enough to guide you in your implementation. I'd recommend putting up work in progress PRs early and poking folks (e.g. me) for feedback even at the earlier stages instead of waiting to put up a mostly completed PR. This should make things easier to review and make sure that we're on the same page. I'd also recommend breaking the different steps/sections up into different commits and/or PRs so that they are easier to review + merge. |
|
Draft PRs submitted, as I wrote this on the hoof I'll not be adding any further functionality for now but focusing on exploratory testing and authoring tests, probably not till the weekend though. For anyone wanting to try out the new features you'll need all the related PRs, you should then be able to use the functionality detailed in #7754, testing on Windows would be welcome. For webfile, as I'm not aware of an existing |
We had to change the js implementation around passing file mode/mtime to the HTTP API - because in the browser you have to use FormData objects to construct requests from multiple Blobs in order to prevent buffering file data into memory. Each Blob you add becomes a multipart part - but you cannot specify per-part headers with the FormData API. So what we ended up doing was encoding the mode/mtime as a querystring and appending it to the field name because it was essentially the only field we could modify that didn't take user input (like the filename for example), so your request ends up looking something like: If go-IPFS could implement the same thing it would mean this feature will work across both implementations and in browsers. |
|
@achingbrain, for multipart I've implemented the querystring on field name, the name itself doesn't include an index as the way parts are constructed doesn't lend itself easily to doing so, in this context though I wouldn't expect that to be an issue, e.g. For the
Does the js implementation have a position on this? |
|
No, looking for those headers in the response sounds perfectly reasonable. The
|
|
Given that we already return |
|
This isn't for what we return though, it's what we will look for in HTTP responses when we are importing from a URL - expecting third parties to prefix headers with |
|
@kstuart I've put a repo together that'll allow you to run the interface tests js-IPFS runs but with minimal setup: https://github.com/achingbrain/ipfs-interface-tests There's a readme with instructions but in brief once you've got everything running you'll just need to remove the skips for all the tests that mention mode, mtime or metadata in test/interface.spec.js Please let me know if you have problems running it or need any help. |
|
@achingbrain That's great, and very insightful. Should I be concerned about the preloadNode issue? |
If you pull from the repo this should be fixed now, sorry about that |
|
@achingbrain looks like there are still some issues running the tests, specifically when running the browser tests Could you please investigate, the package browser-hrtime might provide a solution. |
|
Any idea what the current status of this is? I'd really like the feature and it seems soooooooo close. I'm not interested in the bounty but would really like to see it get over the finish line and if there's any way I could give it that final push I'd be happy to help out. |
|
@zacharywhitley so far this year it has been challenging finding the time to focus on this, I'll be looking to move the PRs out of draft within the next 6/8 weeks, if not sooner. |
|
@kstuart I'm really curious about your progress here! I would very much like to use this additional stat information in places where i'm (going to) list content from folders stored on IPFS. Just for my information. This additional stat info you're providing is also there when using the HTTP API, right? Not just internal to the unixfs layer? I'm asking because i intent to add IPFS browse support in KODI as a VFS plugin where it in the backend would use the HTTP API (it's near certain that i will be doing this). Likewise i want to add a KIO SLAVE (it's for KDE's file browsing capabilities) to support IPFS natively in KDE applications too, it too would fetch file data via the HTTP API. It's unlikely i'll be doing the KDE side of things anytime soon though, that really is just a wishlist item for me personally that keeps getting pushed back. |
|
@markg85 yes, if stored with mode and/or time that information is returned from the HTTP API. As per screenshot it returns the same fields as js-ipfs, except for I need to review |
|
Really looking forward to this. Quick question that I could probably answer by looking at the branch but you can make things easy on my if you don't mind my masking. Is this going to include an update to fuse to pass the info on to mounts? That's what I really want it for. I'm looking to replace SDKMan with IPFS so installing a new JDK is as simple as pinning the directory for that version and updating a couple of env vars. |
|
Nice! |
|
@zacharywhitley it's not in scope for this ticket, don't know what the plan is there. @markg85 all I can say is I'm currently working on it, barring any major issues it shouldn't be much longer. |
|
Thanks. That's fine. I was planning on writing a separate fuse implementation that also supported MFS so as long as it's there. |
|
@zacharywhitley More recently, I've been asked to make a standalone version of this, and have been porting those features over to it. If you need help with yours, feel free to ping me. |
|
Oh wow. That's fantastic and thank you for the offer of help. I will definitely keep in touch. You're from Philly? I went to Drexel University and used to work up in King of Prussia. I've always thought that IPFS mount was an unfortunate rough spot for IPFS that didn't get the love it deserved. It's called IPFS and you go to use it as a filesystem and it's a little disappointing. I guess this is more an MFS thing but I always thought it would be nice if it also supported snapshots. I'm thinking of it creating a hidden directory every time the root changes to move the old root to something like .snapshot-20210826-3489. It's immutable. I should be able to go to an old version. |
I am, I'm at the borders of Tacony and Holmesburg. :^)
Strongly agree. It was the only reason I downloaded it in the first place, only to be greeted with a "not supported yet" message.
Yeah this would be really cool. It's something I like a lot in systems like ZFS, and shouldn't be too difficult to come up with a scheme for in IPFS.
For what it's worth I at least ported over the read-only portions of this for now. They're here. |


Stebalien commentedFeb 21, 2020
•
edited
This issue has a bounty!
Successfully closing this issue by producing a production-ready, mergeable PR can earn you not only the undying love of the IPFS community — it can net you a financial reward. See the current list of bounty issues and their values here.
The need in brief
Add UnisFSv1.5 metadata support per the spec https://github.com/ipfs/specs/blob/master/UNIXFS.md#data-format, which includes: specifying metadata, respecting existing metadata, and displaying metadata.
This aims to support large data import use cases (ex package managers), who need to retain file metadata, particularly last modified time (
mtime), in order to selectively sync only data that has changed. Up until now if you wanted to host a large data set on IPFS, like a package manager's repository, it would be difficult to update - but with filemtimeyou can only reimport the changed files, making things much more efficient.Deliverable
ipfs addon one IPFS node toipfs geton another.Requirements
ipfs addmust not change except when the user has requested that metadata be preserved via the appropriate flags (see the implementation details below). Specifically, the final hash produced byipfs addmust not change.Guidelines
The text was updated successfully, but these errors were encountered: