-
-
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
interface for go-ipfs clients #176
Comments
Huh, dhtHell would love to have this |
How about a convience Writer? type ObjectWriter interface {
// Object that represents everything written thus far
Root() Object
Write([]byte) (int, error) {
// Flush the last chunk in the internal splitter and prevent further writes.
Close() error
} |
ehmry, thats called the DagWriter, its in unixfs/io |
heh, so it is. |
Turns out if you make DAGService an interface, you can swap out the blockservice with RPC calls and reuse DagWriter/DagReader in a simple client. |
i like that |
hey @ehmry would you like to submit a PR for |
@briantigerchow Let me look and see what I got. |
This is what I had https://github.com/ehmry/go-ipfs/blob/client/merkledag/merkledag.go |
I'm confused, DAGService is an interface at master, and I know longer remember what I was working on. |
I think it was the distinction between mutable and immutable dag nodes. But i could be wrong |
i have a common interface here: https://github.com/whyrusleeping/fallback-ipfs-shell that lets us have the same 'object' be either an http client or an embedded node. It needs some documentation work, but it's the direction I want to go with this. |
Let's transform this issue into a documentation effort on how to use IPFS programatically in go, using:
There is currently one example available at https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/QmQwAP9vFjbCtKvD8RkJdCvPHqLQjZfW7Mqbbqx18zd8j7/api/service/readme.md (would be good to verify that it still follows the current API) @RichardLitt this would fit nicely into the API documentation efforts |
I'd like to use IPFS embedded in my golang App, has the convenience API described at the top of this ticket been implemented or are there any further examples of how to access the current IPFS implementation programatically. |
@novocodev go-ipfs-api might get you some of what you need: https://github.com/ipfs/go-ipfs-api |
Eh nevermind sorry -- I misread that you want to embed go-ipfs. |
@lgierth can this be closed in favor of core api discussions? |
Yes, closing this. The follow up on this is that there's now a Core API (ipfs/interface-ipfs-core) which all IPFS implementations should implement. The go-ipfs implementation of this has only just started and currently lives in the |
typo in dht_bootstrap.go
Currently any clients created through `NewApiWithClient` will make a HTTP request to the api, even if the multiaddress specifies TLS or (the deprecated multiaddr option) https. This commit addresses this by having NewApiWithClient iterate the available protocols for the multiaddress, specifying the URL proto as https if it finds TLS or HTTPS is specified. The default continues to be http for those multiaddresses that do not specify these options. Should resolve #176 This commit was moved from ipfs/go-ipfs-http-client@7e1de1f
Would be great to setup a very simple interface for programmatic go-ipfs clients.
Let's use this issue to outline what the interface below should look like
And some nice functions that can setup a node for you, given certain specific types of workflows:
The text was updated successfully, but these errors were encountered: