Skip to content

dag API should let a user ask for the daemon to fetch data matching a selector #8239

@warpfork

Description

@warpfork

Feature description:

The ipfs dag API should let a user ask for the daemon to fetch data matching a selector.

  • The data should become local to the daemon.
  • We may need a way to wait for this.
  • We don't necessarily need all that data streamed back from the same API invocation (!).
  • We don't necessarily care what the transport behavior is that the daemon uses internally. (Maybe it's graphsync, and that's probably a good fit since it already consumes selectors -- but the end user doesn't necessarily care, just wants this to be fast, and work.)

Motivation:

Users might have large data structures that they want to work on, and want to get these locally before starting to work with them, for performance reasons; or, want to get them locally simply so they can confidentally go offline.

Ceramic has a good example story like this:

  • Ceramic's "Streams" are a fairly long chain-like structure -- so fetching them iteratively can be somewhat slow (it will pipeline stall and experience network latency repeatedly as it's going down the chain).
  • Being able to request large amounts of this chain from a peer at once would speed things up significantly.
  • At the same time, Ceramic already has other code that talks to an IPFS API iteratively... but on a much lower latency connection than is involved in a network peer fetch. So this part is fine staying as it is.
    • (They could also use a CAR API endpoint... but don't need to. And sometimes may not actually need to review all of the data they fetch in one time, so the "fetch this" and "show me this" are sometimes different steps.)

Disambiguation:

This is very similar and related to some plans for having APIs that return CAR files (because we figure those APIs should also be able to return a CAR that's matching a selector). It's slightly different, however, because the user story here involves the user being willing to make iterative requests to get the data after it's local -- it doesn't require CARs; and users could keep using their existing iterative conversational API with IPFS without changing anything, while still gettting performance improvements by nudging the daemon to get all the data ready up-front.

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/intermediatePrior experience is likely helpfulhelp wantedSeeking public contribution on this issuekind/featureA new featurestatus/readyReady to be worked

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions