-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Achieving Connectivity Magic #1459
Comments
It took me a while to see this: the three steps proposed are: 1) routing via DNS records 2) delegated routing 3) proper DHT routing |
Everyone, thank you for the really awesome sync up. It was lovely to see how everyone came up together so quickly, communicated well their concerns and proposed solutions and eventually converged in a good set of next steps 👏🏽👏🏽👏🏽❤️❤️❤️. We converged on an alternative solution to (1), we named it
Note on hitting the preload gateway: Use the |
Here's the pros/cons of 1a) always connecting to ipfs.io gateways, and 1b) separate preload gateways, that were mentioned in the call:
|
While I'm setting up these preload gateways, you can use the old OVH gateway nodes for testing: the wss0,wss1 addresses in js-ipfs bootstrap config. These run the gateway on :443/ipfs, right next to the /ws transport on :443/ws. They're crappy fault-prone hardware and will be decomissioned soon, but should be good enough for a few days. |
+1 Can we call them "storage peers" rather than "prefetch gateways"? It's confusing to me to use the term gateway when we mean HTTP to IPFS translation, and it seems that storing files directly on the gateways has been the cause of some trouble. As I see it we are proposing to add some "stable bootstrap peers with a good chunk of storage" to the network that will expose an http interface just to allow us to poke them out of band to trigger a request to fetch content from connected browser nodes. These "storage peers" will (hopefully, usually) be in the swarm for all the gateway nodes too, so that requests for the content sent to the regular gateway will be 1 hop away (rather than 0 as they used to be, or |
So to clarify, we'd add all of the gateways to the bootstrap list, but HEAD request just one of those after add/get/cat/dag.get/dag.put?
|
Notes on redirect opt-out in Companion and preload:
|
So, unfortunately JFK Terminal 1 has roughly three power outlets so I can't work on this tonight. I'll have addresses for you tomorrow morning-ish (http for the preload requests and dnsaddr for peering). We don't have proper hosts for this provisioned yet, but in the meantime the old gateway hosts can be used for testing.
Let's do preload peers -- not calling them gateways is fair, but "storage" would give a false sense of permanence. |
By the way, a strong alternative to this is calling |
@lgierth do you know if |
Yes it loads every block that's referenced in that dag -- the nice thing is it enables progress reporting on the "client" side, since you already know the set of all CIDs, and cam compare how much has been fetched already. |
Can I get a quick check in on the status of #1459 (comment) ? |
|
When we're adding content to IPFS, we don't really want to wait around for it to be uploaded to the preload nodes which is why a HEAD request is nice because it's quick and light and the content can then be slurped from my node asynchronously. In companion we HEAD request for every CID added, but is this necessary? Looking at the code it looks as though if you send a HEAD reuqest to a js-ipfs gateway it would load the CID as well as it's descendants (because it doesn't differentiate between HEAD and GET). |
Actually, HEAD is even a bit more diligent than GET -- the former reads the whole node to calculdate Content-Length, the latter reads only what it has to in order to satisfy the request. Both don't read into directories, i.e. if you get a directory index, none of the children or subdirs are fetched. |
Ah yes -- there's now A/AAAA records for preload.ipfs.io, so if you're connected to all preloader peer in There is a slightly different option which is individual A/AAAA records for each preloader peer. That'd let you connect to only one preloader peer, and make HTTP requests to exactly that one, instead of connecting to all of them. |
These preload peers are now reachable:
If js-ipfs can resolve /dnsaddr, these addresses can be shortened to:
|
Sorry I'm a bit late to the party. |
It's gonna be in 0.31 very very soon: #1459 (comment) |
refs #1459 This PR adds a new config property `preload`: ```js new IPFS({ preload: { enabled: false, addresses: ['/multiaddr/api/address'] } }) ``` * `preload.enabled` (default `false`) enables/disabled preloading - **should the default be false?** * `preload.addresses` array of node API addresses to preload content on. This are the addresses we make a `/api/v0/refs?arg=QmHash` request to, to initiate the preload **This PR upgrades the following APIs to preload content**. After adding content with `ipfs.files.add` (for example), we make a request to the first preload gateway addresses (providing `preload.enabled` is true), and will fall back to the second etc. * [x] `dag.put` * [x] `block.put` * [x] `object.new` * [x] `object.put` * [x] `object.patch.*` * [x] `mfs.*` MFS preloading is slightly different - we periodically submit your MFS root to the preload nodes when it changes. NOTE: this PR adds an option to `dag`, `block` and `object` APIs allowing users to opt out of preloading by specifying `preload: false` in their options object. License: MIT Signed-off-by: Alan Shaw <[email protected]>
Update about the PeerID changes mentioned above -- we will not change the PeerIDs, and will keep the PeerIDs mentioned above. This means the addresses above in #1459 (comment) are the correct ones for the release. This also means you can safely remove the |
|
The CORS issue should be fixed |
Preload is confusing because it happens on both add and get, and because it isn't documented anywhere in depth. This clarifies what happens a bit. We should also write out the behavior in more detail like with circuit relay above (possibly in the form of a tutorial for setting up your own preload node) see also ipfs#1459 (comment)
Preload is confusing because it happens on both add and get, and because it isn't documented anywhere in depth. This clarifies what happens a bit. We should also write out the behavior in more detail like with circuit relay above (possibly in the form of a tutorial for setting up your own preload node) see also #1459 (comment)
@alanshaw here's another preload related question -- how long is data retained by the remote nodes? is it just a normal pin? do they announce to DHT? |
Posting this here for discoverability:
|
cc relevant topics:
|
Not a blocker but relevant to the thread libp2p/js-libp2p#385 |
Closing this because it is very stale. We now live in the future where browser nodes can dial server nodes via WebTransport and WebRTC without any extra setup a la WebSockets so as these transports proliferate, connectivity will too. Magic! |
I ran an impromptu and presidential design session with @alanshaw, @olizilla and @achingbrain to walk through some of the design decisions on libp2p and we ended up discussing the Connectivity Magic Objective and what exactly I mean by "creativity".
The tl;dr; there are multiple ways to find file, but all of them have tradeoffs.
Here is the sketch we ended up doing:
Here is an annotated version:
I can make a quick video explaining this, but perhaps it would be more valuable to have @alanshaw, @olizilla and @achingbrain explain this to @hugomrdias (who owns the KR to get files from the gateways) through a Zoom Recorded Call or Text, so that we check that the memes have indeed been transferred :)
The focus should be around on why the shortcoming exists and the 3 solutions on the solution spectrum (from hacky to ideal but not necessarily memory efficient).
The text was updated successfully, but these errors were encountered: