npm-kubo icon indicating copy to clipboard operation
npm-kubo copied to clipboard

Leverage IPFS nodes for download

Open lidel opened this issue 4 years ago • 1 comments

Downloading from dist.ipfs.io may fail due to routing or service issues. It does not leverage the fact that data could be downloaded from a local IPFS node, or alternative gateway.

Switching download logic to something like ipfs-or-gateway should mitigate issues described in https://github.com/ipfs/npm-go-ipfs-dep/issues/37, where our gateway broke CI for various projects.

The idea

  • introduce an implicit (but configurable) list of gateways to try
  • try downloading from each of them, in order, and fail only when all of them fail
  • default list should work for most of people: [default local, default public]
    • try local IPFS gateway first (default: http://127.0.0.1:8080/ipns/dist.ipfs.io)
    • if that fails, fallback to a public one (default: https://ipfs.io/ipns/dist.ipfs.io)
  • allow people to provide their own list (to use own nodes, or trusted public ones such as cloudflare)

@aphelionz would that help?

lidel avatar Aug 10 '20 14:08 lidel

Seems good, let's give it a shot!

aphelionz avatar Aug 10 '20 14:08 aphelionz