-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: example how to enable both HTTP and libp2p at the same time #106
Comments
No technical reason. We could get one going. |
FYI I also recently opened ipfs/helia#638 I don't think there's a technical reason, but I am in favor of adding an example that enables client-only-libp2p for doing bitswap without doing any dht-walking or other work. it should be a pretty simple config honestly, just https://github.com/ipfs/helia/blob/4f14996a9b976f2b60f4c8fe52a4fd1632420749/packages/helia/src/utils/libp2p-defaults.browser.ts#L34 without:
|
I think we need to find a better way to allow users to customise Helia and libp2p when instantiating Maybe it's also time for us to enable p2p retrieval by default in Verified Fetch. How to do this todayconst helia = await createHelia()
const verifiedFetch = await createVerifiedFetch(helia) However, with this, you get hundreds of connections due to the bootstrap nodes and the DHT Client. Since Verified Fetch is concerned with retrieval How can you do this without all the connections// Create helia without connecting to any bootstrap peers
const helia = await createHelia({
libp2p: {
peerDiscovery: [],
}
}) However, this will still instantiate the DHT service. Another problem is that this will also have all transports enabled, and we know some of them don't work well, e.g. WebTransport. Path forwardMy initial instinct is to handle this in the Verified Fetch constructor by adding additional options similar to the way they are displayed in the SW Gateway (https://inbrowser.link/#/ipfs-sw-config) that will determine whether Helia/http or libp2p helia and which transports. If don’t imagine that most devs will want to customise like we did in the SW Gateway (it’s pretty unruly). Concretely, I was thinking along the lines of: helia-verified-fetch/packages/verified-fetch/src/index.ts Lines 648 to 667 in 7bf29f3
I'm exploring the DX around this in #130. Feedback would be appreciated @achingbrain @SgtPooki @lidel |
We chatted about this in Helia WG today and decided that:
|
https://github.com/ipfs/helia-verified-fetch/tree/main/packages/verified-fetch#usage-with-customized-helia shows how to configure custom helia with HTTP-only(?) backend.
iiuc
/wss
bitswap providers discovered over delegated routing API are dead and can't be used for bitswap due to lack of libp2p.We should have an explicit example which enables both HTTP and bitswap-over-llibp2p backends at the same time, and make it a prominent one, then have HTTP-only after it.
The text was updated successfully, but these errors were encountered: