fission-codes / fission

Fission CLI & server
https://runfission.com/docs
119 stars 14 forks source link

Have local IPFS node connect to in-browser js-ipfs #329

Open bmann opened 4 years ago

bmann commented 4 years ago

From the forum: https://talk.fission.codes/t/automatically-pin-locally/640

As long as IPFS is running on my machine I do not have to wait for huge uploads to complete before I can share a video for example, or any of my stuff.

Hopefully fission drive could arrange to pin everything I have locally, and tell me when it is all done. To know that even if I turn my machine off it will be available.

I would like to tell fission.drive, here is a cid for something I just pinned on my machine, please make sure that it is pinned on fission drive too.

Likely this can be a very small change, where as well as sending the hash to pin remotely, we also pin it locally.

expede commented 4 years ago

I believe this is how it works today. @dholms can you investigate?

dholms commented 4 years ago

Yeah I'm nearly positive that IPFS automatically pins things when you add them locally. But I'll double check this

dholms commented 4 years ago

oops wrong button, reopening

bmann commented 4 years ago

This is low priority.

The more interesting question is “what is the best way to make sure that pinning files locally make Fission perform well in a local browser without a plugin”

Which is a larger challenge.

dholms commented 4 years ago

Ran a test: ipfs add definitely pins that content :+1:

ipfs add ./pic.jpg
ipfs pin ls | grep ${cid}

The more interesting question is “what is the best way to make sure that pinning files locally make Fission perform well in a local browser without a plugin” hmm yeah this is a bit trickier. You need to get the in browser node to connect to your local node. But most people aren't going to be running their local node with websockets, much less with a proxy which provides SSL.

We could solve that first part with some quick edits to their IPFS config during setup. I wonder if a browser node can connect to a non-secure websockets node on the same machine through a relay hop :thinking:

expede commented 4 years ago

connect to a non-secure websockets node on the same machine through a relay hop

Probably not without running some extra software (e.g. our CLI). We also need to know the PK for the IPFS node. We could actually maybe do that on setup, but that has some not great security implications.

bmann commented 4 years ago

I've renamed this, unassigned Daniel, and put it in the Icebox