ipfs / boxo

A set of reference libraries for building IPFS applications and implementations in Go.
https://github.com/ipfs/boxo#readme
Other
195 stars 86 forks source link

example: turn directory into a CAR with UnixFS DAG #663

Open lidel opened 2 weeks ago

lidel commented 2 weeks ago

Problem

We have many unixfs implementations, and it is extremely confusing for new developers to understand what they should use and why. (cc @2color)

Proposed improvement

The ./exmaples should have an example of ipfs add + ipfs dag export equivalent for reading a file or a directory from local filesystem, and turning it into a CAR with UnixFS DAG that was properly chunked / HAMT-sharded.

The example should be a CLI tool that accepts same flags as ipfs add, demonstrating how to adjust chunker, hash function, or decide if mode/mtime should be preserved.

lidel commented 2 weeks ago

@gammazero thoughts which APIs should be used in this example?