-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add guppy explore command #233
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
base: main
Are you sure you want to change the base?
Conversation
|
Ah: the capabilities are in storacha/go-libstoracha#76, which I only just merged. This is good, but might have some issues at larger data sizes. I wasn't really intending anyone to pick up that issue yet; it still needs some thought and has some context behind it that hasn't been written out yet. In general, safer to check in on issues before you start working on them; I wouldn't want you to spend a bunch of effort on something we end up having to throw out because of something you weren't aware of. |
|
Thanks for the feedback! I appreciate the advice on checking in first. |
|
@Goddhi Yep, that's it exactly: every access in that walk is (potentially) a network call, which will be slow. But actually: an So:
What's great about this is that each command results in fetching ~1 node—except for large directories that are HAMTs, but it's still a lot less than enumerating the entire space contents in one go. Also would be nice:
|
|
Hi @Peeja, I implemented the guppy unixfs ls command as requested, including the --long flag and incremental streaming for directories. regarding the output format, I matched the standard Unix ls -l columns (Mode, Size, Time, Name). I noted your example output included a CID column. Currently, pkg/dagfs relies on the standard fs.FileInfo interface, which doesn't expose the underlying CID. To include the CID column, we would need to update some files under pkg/dagfs to pass the CID via the Sys() method. I decided to keep this PR focused on the CLI command implementation. I can implement the dagfs update to expose CIDs in a follow-up PR if you think that adds enough value. command usage |
implements the guppy explore command, allowing users to interactively traverse and list the contents of a UnixFS DAG stored on the network.
i added consumer/get capability because while implementing the explore feature, I encountered issues where the Indexer (indexer.storacha.network) would return "no locations found" for known valid CIDs.
Upon investigation (and referencing issue #226 ), it became clear that the Indexer now enforces an authorization check requiring the consumer/get capability. it seems the previous space/content/retrieve capability is no longer sufficient for these indexer queries.
To try to resolve this, I added the pkg/capabilities/consumer package to model this new capability.
Usage:
Closes #222