orbitdb-archive / orbit-db-io

Helper module used in OrbitDB to interface with storage layer
MIT License
7 stars 12 forks source link

Upgrade ipfs and switch to ipfs.block api #26

Closed tabcat closed 3 years ago

tabcat commented 3 years ago

this pr upgrades the ipfs-deps and rewrites the package to use the block api instead of the dag api from ipfs. doing this fixed an issue with using go-ipfs@0.10.0-rc1 with ipfs-http-client@52.0.2 and i think results in better usage by us.

something i didnt know until making some edits was that the raw codec was never actually used. supplying write with a 'raw' format param would result in ipfs.dag defaulting to encoding the data with dag-cbor. I chose not to fix this to stay backward compatible for now but in the 1.0 rewrite this package should be revisited again. Three things to look at during the revisit would be the cid helper functions, considering exclusively supporting dag-cbor for encoding, removing the custom 'links' part of handling cbor, and moving cid calculation closer to writing orbit-db entries.