Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Add ./examples/browser-service-worker-gateways-with-car #283

Open
lidel opened this issue Apr 18, 2022 · 1 comment
Open

Add ./examples/browser-service-worker-gateways-with-car #283

lidel opened this issue Apr 18, 2022 · 1 comment

Comments

@lidel
Copy link
Collaborator

lidel commented Apr 18, 2022

We have ./examples/browser-service-worker which runs in-memory js-ipfs.

That is fine setup, but comes with limitations, like WebRTC not working in Service Worker, which introduces the need for running js-ipfs outside of Service Worker, and introduces overhead of postMessage serialization.

We should add alternative example at ./examples/browser-service-worker-gateways-with-car which:

  • handles /ipfs/* and /ipns/*
  • does not run js-ipfs in-memory
  • has a list of gateways and uses them (at random or as fallback list) for fetching requested files as CAR, verifies CARs, and returns re-assembled data from Service Worker, without the need of any cross-process postMessage present in ./examples/browser-service-worker
@lidel
Copy link
Collaborator Author

lidel commented Apr 18, 2022

cc @guanzo – potential task for Launchpad

  • After we have this example, we could chat creating real SDK/lib that does both – CAR from gateway pool, and if all gateways are down, fallback to spawning in-memory js-ipfs.
  • For poc use /api/v0/dag/export endpoint, but before we merge we would switch to proper CAR support on /ipfs/ after feat(gateway): Block and CAR response formats ipfs/kubo#8758 ships with go-ipfs 0.13

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant