(no title)
2color | 1 year ago
IPFS contributor here.
I had a look at your code and saw how you handle downloading from multiple gateways.
There's a better way to this which also leverages direct P2P retrieval in browsers, which is now a thing with IPFS! [0] If you just want to fetch, checkout @helia/verified-fetch[1] which gives you a Fetch like API that accepts CIDs. It handles all the content routing and retrieval p2p magic and can help reduce reliance on gateways.
You can also pass it gateways in case it can connect to providers directly (due to transports)
[0] https://blog.ipfs.tech/2024-shipyard-improving-ipfs-on-the-w... [1] https://github.com/ipfs/helia-verified-fetch/tree/main/packa...
yoavm|1 year ago
Edit: I now realised we previously talked on the Discord channel, thank you for the help there!
2color|1 year ago
Any reason you chose BLAKE2b-256?
BLAKE2/3 are amazing hashing functions and have a lot of cool properties, but they really suck on the web in terms of performance. This came up literally yesterday https://bsky.app/profile/norman.life/post/3lbw2qltokc2i and has been reported by multiple devs recently (who also shared excitement about BLAKE)
2color|1 year ago
You can also pass [@helia/verified-fetch] gateways as a fallback for when it *cannot* connect to providers directly (due to transports).