service-worker-gateway
service-worker-gateway copied to clipboard
Support blake3 CIDs
bafkr4ihkr4ld3m4gqkjf4reryxsy2s5tkbxprqkow6fin2iiyvreuzzab4 is blake3 and https://inbrowser.dev/ipfs/bafkr4ihkr4ld3m4gqkjf4reryxsy2s5tkbxprqkow6fin2iiyvreuzzab4 fails atm.
Spec-wise, we have blake3 listed as part of Web Pathing spec draft here, and to be production relady drop-in replacement for dweb.link, inbrowser.link should support the same hash functions (as brave/rainbow/kubo-based gateway).
The work required to do this is a little more involved than just adding a hasher:
- you would need to update the createVerifiedFetch call to pass a helia instance (a
@helia/httpinstance for now) here: https://github.com/ipfs/service-worker-gateway/blob/3c9b300f4446da1f801d663ac39012287b87574d/src/sw.ts#L251-L257 - you need to instantiate a
@helia/httpinstance, passing the gateway/routers config, adding the hashers configuration that includes blake3- you can see an example of blake3 hasher at https://github.com/ipfs/ipld-explorer-components/blob/7748e75f8fa7af52347518510f1e7caea2dbfb2d/src/lib/hash-importer.ts#L61-L72
this was done in https://github.com/ipfs/service-worker-gateway/pull/421