ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
247 stars 68 forks source link

Support IPLD format multicodec `IpfsClient::dag_put` selection, or at least document the hardcoded defaullt. #79

Open nathan-at-least opened 3 years ago

nathan-at-least commented 3 years ago

The docs for [IpfsClient::dag_put aren't clear about which IPLD format multicodec is used.

For comparison, the js-ipfs API docs for ipfs.dag.put present an option for selecting the IPLD format.

Imagine a developer needs both a JS client and a rust ipfs_api client to interoperate. To do this, at minimum the ipfs_api needs to document which format is used, then the more flexible JS api would need to be modified to match. OTOH, if IpfsClient::dag_put allowed selection of the format, then either implementation could change to interoperate with the other.

dowlandaiello commented 2 years ago

Just for everyone that might need this: the IPFS HTTP API docs specify that that inputted data will be parsed as JSON, and committed to the DAG as CBOR encoded data. This seems to be the case upon further testing and inspecting this repo's source code, but it would be good if this behavior was documented!