-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Deprecate Object API #7936
Comments
This comment has been minimized.
This comment has been minimized.
cc @vmx who asked to follow this discussion to make sure the JS implementation side ends up in the same place. |
A cursory overview of the commands that
Reasons to keep the API around:
We could likely take the useful bits of this API and add them to the DAG API (or to |
We’ve been saying the IMO, these features aren’t actually useful, nor is the This is even more true for this as a remote or library API. You can write a much better interface doing the codec work in the client and reading/writing to the Block API. We’ve been telling people to do this instead of using the If we’re going to be ambitious and take on new work we also need to jettison features we don’t think are worth maintaining and, IMO, these both qualify. I’m not aware of any major users that depend on them and I don’t know of any use cases they serve that you couldn’t find a better solution to using the Block API/CLI which is much simpler and easier to maintain. |
Maybe, but saying "you shouldn't use" something doesn't really hold any power until an alternative arises. Since the originally proposed replacement (i.e. the DAG API) never matured enough to fully replace the Object API it hasn't been deprecated yet.
So sure, maybe just moving the useful commands into
That make sense since anyone using DAG CBOR doesn't have any way of doing mutations of graphs in go-ipfs without manually updating the nodes in the DAG that are changed and all of their parents. However, it seems doubtful to me that this is the best way of doing things. Perhaps I'm wrong and working with bytes is the best way forward. However, I suspect people are going to want to manipulate DAGs with go-ipld-prime and that it is going to need (or already has?) tooling around mutating DAGs. Once we see how people want to manipulate go-ipld-prime DAGs where the bytes are stored in a go-ipfs node we'll likely learn more about what patterns people are looking for. |
People use the object API to do things like manipulate non-MFS UnixFS DAGs (e.g. add files to directories, create sub-directories, etc). There isn't a convenient way to do that with the current API without getting deep into the DagPb weeds. I would make MFS-style operations (e.g. mkdir, rm, etc) work on regular UnixFS DAGs and each operation would return a CID representing the root of the affected DAG. We should then go a step further and move all of the MFS operations to the root IPFS object and have them operate on both IPFS and MFS paths. E.g. const cid1 = ipfs.add({ path: '' })
const cid2 = ipfs.mkdir(`${cid1}/bar`)
const cid4 = ipfs.cp(cid3, `${cid2}/baz`)
// etc You can use the DAG API to do more complex manipulations, but if you're down there you're probably not using UnixFS/DagPb any more so you should be ready for the full IPLD experience. |
Ideally I think we would:
We don’t have to maintain that library, pass a maintenance to teams who don’t want to leave it behind. |
Just my $0.02 as a developer new to IPFS using the HTTP API. While I like |
Thanks for that feedback @TheDiscordian ! That's very concrete and useful. Those observations are interesting. It sounds like a lot of the operations described there semiotically asking about unixfs traits, and so ideally they are things we'd like to serve through an API that's more explicit in that it's doing unixfs things. I know the comment is about things that can be done with the object API today and are useful, but they're also probably very meaningful as feature requests for the APIs that should be replacing it. |
What is
Can you be a little more precise here, because I think I'm missing something. There's |
Nothing,
So I was alerted to the directory size issue as a possible reason for #7916 before I opened the issue in a chat. Being somewhat unclear on what statistic I need, I explored into commands and found Command: Output:
I thought I'd need block size, assuming that's in bytes, that's reporting 1.08MiB, which is over the limit. Unless I should be looking at NumLinks?
Command: Output:
Which doesn't seem to contain information I'd typically be looking for (except CID, and maybe the type). So to answer your question somewhat, I'd have to say "I don't know, but maybe not". As I'm struggling to even find which statistic I need. There certainly is a lot of overlap though, and the only statistics I didn't see repeated were: Extra note: Some option to display SI units or something would be awesome. I can't always tell if I'm looking at bytes, or block counts, or something else. |
This is a cosmetic change to 'ipfs --help' that reorders operations to prioritize 'dag' and 'files' over legacy 'object'. Context: #7936
Part of #7936 This PR makes it very explicit that 'ipfs object' are deprecated by removing examples and pointing at modern replacements under 'ipfs dag' and 'ipfs files' Taglines are longer and include alternatives because we use them on: https://docs.ipfs.io/reference/http/api/
FYSA I opened a PR which makes the deprecation VERY explicit and points users at modern replacements: #8098 |
is there a 1-to-1 migrate guide on how to update existing |
The Object API is a not-well documented portion of the command line API that allows for working with nodes of data serialized to a range of codes. The DAG API was meant to deprecate it, and has existed since 2017.
The text was updated successfully, but these errors were encountered: