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

Can go-ipfs be programmed or am I stuck with the CLI? #5377

Closed
sorleone opened this issue Aug 13, 2018 · 4 comments
Closed

Can go-ipfs be programmed or am I stuck with the CLI? #5377

sorleone opened this issue Aug 13, 2018 · 4 comments
Labels
kind/support A question or request for support

Comments

@sorleone
Copy link

Can I build something with go-ipfs or can I just use it with the CLI? Js-ipfs is very well documented and very easy to get started, however as long as it keeps crashing every 15 minutes is useless. So I was wondering if I can go back and start from scratch again my project with go-ipfs. However the only things I can find are CLI commands and something about the http api, which I don't like since I don't have the full control I have with js-ipfs and that I hope to have with go-ipfs. There aren't many people able to use the terminal so why all this emphasis on that, instead of making it easy for people to build something with go-ipfs? Since few people even know about this language, there should be a very good guide that helps starting from scratch...

The error I get with js-ipfs has been around for quite long if you search for it:

https://github.com/libp2p/js-libp2p-switch/issues/235

I get it with version 0.31.4, 0.31.3, and 0.30.0, but I think every version has it. This is what I get:

js-ipfs/node_modules/pull-pair/index.js:11
      throw new Error('already piped')

I get this problem with the main example of the ipfs-pubsub-room repository:

https://github.com/ipfs-shipyard/ipfs-pubsub-room

@Stebalien
Copy link
Member

Latest iteration of that bug: ipfs/js-ipfs#1446

The HTTP API allows you to write programs that use the go-ipfs daemon externally, can do this from the browser using js-ipfs-api or from a go application using go-ipfs-api.

You can also use go-ipfs as a library but this isn't currently well supported. We're working on improving this situation by implementing something we call the CoreAPI (the current interfaces live in core/coreapi/interfaces) but that hasn't been completed. Once that has been completed, we'll write some examples.

There aren't many people able to use the terminal so why all this emphasis on that, instead of making it easy for people to build something with go-ipfs?

Take a look at:

IPFS itself is a building block. It's designed in the client-server model where a single user will have a single IPFS daemon running in the background with multiple applications acting as clients. The CLI interface is currently just a convenient client that's relatively easy to write and maintain.


Closing for tracking purposes as this issue isn't directly actionable, feel free to ask follow up questions.

Note: In the future, you should probably ask questions at https://discuss.ipfs.io (our discussion forum). I've answered this one here as it's almost a feature request but the discussion forum is better suited to questions like this.

@Stebalien Stebalien added the kind/support A question or request for support label Aug 13, 2018
@sorleone
Copy link
Author

sorleone commented Aug 14, 2018

@Stebalien thank you very much, now it's clearer, okay I'll use the forum, do you also have a chat or Slack? What I'd love to have from the js-ipfs-api is:

  1. Direct encrypted messages between peers (like sendTo of ipfs-pubsub-room), how can I do that? libp2p dial?
  2. An on ready event like the js-ipfs implementation has, how can I have something similar?
  3. Discover the location of a node, even just at country level of precision. I know this can be done because the WebUI has a globe with positions of the nodes on it.

Bonus questions:

  1. Are pubsub messages encrypted and/or digitally signed? Can I add a password to join a channel, or restrict to a set of peer IDs?
  2. Why does the js-ipfs node always have much less connections with swarm peers, compared with the go-ipfs node?
  3. When will IPFS be production ready and pubsub stopping being just "experimental"?
  4. Does ipfs.util.crypto supports pipable/pullable crypto streams with AES like Node's createCipheriv, and if so how?

@Stebalien
Copy link
Member

do you also have a chat or Slack

You can find us on the #ipfs channel on Freenode (IRC).

...

Let's move this to the forums or IRC. This looks like it's going to be a long discussion.

@sorleone
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

2 participants