ipfs-shipyard / js-ipfs-http-client-lite

An alternative client library for the IPFS HTTP API, aiming to be as lightweight as possible (<20kB) in the browser.
Other
34 stars 7 forks source link

Adding dag.get and dag.put methods #4

Open Schwartz10 opened 5 years ago

Schwartz10 commented 5 years ago

Hi @alanshaw - I'm trying to get a better sense of what it would take to add dag.get and dag.put methods to this lite client.

I'm looking at the js-ipfs-http-client dag directory as a reference, and upon an initial skim, it seems like building support for these two methods should be relatively straightforward.

Do you see any possible complications or things to look out for? Are there any dependencies being used in the js-ipfs-http-client (related to the dag.put and dag.get methods) that we should avoid using here?

alanshaw commented 5 years ago

In the case of dag.get we could just request the dag endpoint rather than using the block API - we don't need to return actual IPLD nodes.

For dag.put we could just accept bytes (buffer/arraybuffer) of the serialized IPLD node to put. i.e. no built in serialization.

Including any IPLD modules is going to increase the bundle size significantly so I'd like to avoid if possible.