Closed aschmahmann closed 4 years ago
While I agree "remote pinning over libp2p" is the most elegant thing, and we will most likely have something like that in the future, I don't believe "http over libp2p" is feasible for the mvp at hand:
Dependence on libp2p stack limits the API usefulness to software that can bundle libp2p and run p2p node. For many clients, that level of complexity will be a reason for not supporting this API.
As you noted, we only have relevant libraries for go, and go-ipfs still marking entire feature as experimental. That introduces unnecessary challenges for services that would like to implement this in other languages in time for Filecoin launch.
It also does not solve problem for web based clients, unless app is running js-libp2p node and we re-implement http over libp2p in JS. Same concern about sabotaging adoption and devexp.
Vanilla HTTP API is a hard requirement for the time being. Without it, we won't see community/partner adoption.
I'd like us to look into ways we can improve content routing while keeping HTTP API.
I believe we implemented (1) in #14 already (entire Pin
object is now sent to pinning service).
What if:
Pin.meta[provider]
so Pinning Service can try connecting to a known provider in parallel to asking DHTPinStatus.meta[receiver]
so client can try connecting to a designated receiver node?Sending and acting on these hints would be optional, but pinning from apps with known peerid such as go-ipfs could leverage those hints to ensure peering is in place and data transfer starts immediately.
@aschmahmann Would this be good enough for support in go-ipfs?
I believe we implemented (1) in #14 already
Not quite since we don't send the entire DAG, just the top level pointers.
client sends own peerid/multiaddrs in Pin.meta[provider] so Pinning Service can try connecting to a known provider in parallel to asking DHT
doesn't really help if the client is undialable which is the case I'm concerned about
pinning service returns peerid/multiaddrs in PinStatus.meta[receiver] so client can try connecting to a designated receiver node?
This will work and is basically an easier to deal with version of option 2 👍 (e.g. the pinning services don't have to know keep their PeerIDs long term). Given that the vanilla HTTP API is mandatory for the time being this seems like our only real option and should work reasonably well.
Great. We need a mini spec for those hints. Would an array of string multiaddrs be enough?
Yep, that should be fine
See also #22
Problem:
The current API has the client inform the pinning service of the CID of the data to pin. While this may be convenient if the data is already in the network, it has downsides if the client is the only one with the data including:
Recommended Solution
Take our existing HTTP API and expose it over libp2p instead of over TCP. This will ensure that we are connected to the peer that is supposed to be fetching data from us.
Comparing with Other Solutions
Any of these solutions seem viable, and I'm interested if there are any other proposals out there that I've missed. However, I'm pretty sure we need to do at least one of these things or we're going to have really serious problems with users failing to upload data to pinning services.
It seems like people are not a fan of option 1, which leaves us with 2 and 3. I'm not sure if they're really that different from each other, although I'm currently leading towards option 3 as it's much less hacky and gives us some other nice benefits.
Thoughts?