boxo icon indicating copy to clipboard operation
boxo copied to clipboard

example: turn directory into UnixFS DAG

Open lidel opened this issue 1 year ago • 5 comments

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 avatar Aug 27 '24 18:08 lidel

Triage notes:

  • we are missing high level api, may need to create new ones first
  • could be an example with existing APIs and opinionated as ipfs add from Kubo + document default settings

lidel avatar Aug 27 '24 18:08 lidel

maybe show only server side will be more simple,like the bitswap transfer ,no need a CLI+daemon or client/server mode example

mostcute avatar Sep 25 '24 02:09 mostcute

client side can show how to get/download the whole dir and single file in a dir. show how client to parse the dag from dir-cid and choose a file to get

mostcute avatar Sep 25 '24 02:09 mostcute

PRs with example ideas are welcome. Feel free to open PR drafts + comment on identified gaps + refer this issue in description.

lidel avatar Oct 22 '24 14:10 lidel

Hi @lidel I tried to tackle this issue... Please have a look at it

PsychoPunkSage avatar Feb 20 '25 12:02 PsychoPunkSage