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

Gateway uses minimal IPFS Core API #2876

Closed
wants to merge 3 commits into from
Closed

Gateway uses minimal IPFS Core API #2876

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 19, 2016

This is a follow-up to ipfs/specs#85, which discusses an IPFS Core API. The immediate goal is to slim down the surface area between the gateway, and go-ipfs internals, so that the gateway can easily be extracted into its own package.

A possible direction forward:

  • The package go-ipfs-core-api/interface provides interfaces, data structures, and errors. Tools like ipget or pinbot can choose between implementations backed by the API server (:5001), or by a proper embedded IpfsNode.
  • The package go-ipfs-core-api implements go-ipfs-core-api/interface backed by a proper IpfsNode. It depends on a lot of go-ipfs internals, like core, merkledag, unixfs/io.
  • The existing package go-ipfs-api implements go-ipfs-core-api/interface backed by the API Server.
  • go-ipfs/core/commands uses go-ipfs-core-api -- most of the logic there should live in the core-api.
  • The gateway, FUSE, and whatever else there is also use either go-ipfs-core-api or go-ipfs-api.

@Kubuxu
Copy link
Member

Kubuxu commented Jun 20, 2016

So my plan for core-api is to one-to-one map it to RPC API and totally separate it from go-ipfs (and js-ipfs). That is why the API itself should be simple, follow procedure call pattern.

It would be great if we could work with js-ipfs on it.

Naming suggestion: replacing Ls with ReadDir, it is clearer, references readdir from C STD lib and more established.

@ghost
Copy link
Author

ghost commented Jun 20, 2016

We already have a Core API layed out though: ipfs/specs#85

How would these relate to each other?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 20, 2016

There isn't much in terms of specs there (and I don't know how much js team has done on it). I think we shouldn't repeat CLI API scheme (we already have working API like that) and design something extremely simplistic.

It is my view on the matter when it comes to creating and implementing new API as we already have quite complex API which isn't simple to implement / write down in different implementation.

@qxotk
Copy link

qxotk commented Jun 20, 2016

Perhaps the spec differs from ipfs-api in writing style and audience? The spec might be more prose and expose reasoning and api could be terse details using exact language of arguments and returns.

@ghost ghost force-pushed the coreapi branch 2 times, most recently from 0cf8bb8 to aa6dec1 Compare June 22, 2016 01:49
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)

type Path path.Path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to rebind the path type?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep should be an interface instead -- I made a WIP commit while switching computers

@daviddias
Copy link
Member

@ghost
Copy link
Author

ghost commented Jun 22, 2016

have you seen https://github.com/ipfs/interface-ipfs-core ?

Yes -- what's your question? :) We can make that repo hold both js- and go- interfaces, and go-ipfs-api and go-ipfs-core-api hold the implementations.

@daviddias
Copy link
Member

Just making sure it wasn't missed :) It think that if we can have a spec document that works for both, it would be great :)

@ghost ghost mentioned this pull request Jul 6, 2016
@ghost ghost added this to the IPFS Core API milestone Sep 1, 2016
@ghost ghost changed the title Core API and go-ipfs-core-api Gateway uses base IPFS Core API Sep 1, 2016
@ghost ghost added topic/core-api Topic core-api and removed topic/core Topic core labels Sep 1, 2016
@ghost ghost changed the title Gateway uses base IPFS Core API Gateway uses minimal IPFS Core API Sep 1, 2016
@ghost ghost force-pushed the coreapi branch 2 times, most recently from 35c8b67 to e02fc54 Compare September 11, 2016 01:59
Lars Gierth added 2 commits September 11, 2016 05:09
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
WIP
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
@ghost
Copy link
Author

ghost commented Sep 11, 2016

Closing in favor of #3207

@ghost ghost closed this Sep 11, 2016
@ghost ghost deleted the coreapi branch September 11, 2016 16:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review topic/core-api Topic core-api topic/gateway Topic gateway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants