kubo icon indicating copy to clipboard operation
kubo copied to clipboard

Support ad-hoc retrieval without separate `daemon` or `init`

Open lidel opened this issue 7 months ago • 1 comments

Need

a subset of users needs a tool for ad-hoc downloads, similar to curl, wget or aria2c.

https://github.com/ipfs/ipget and https://github.com/filecoin-project/lassie exist, but are poorly maintained, and often lag behind libp2p/boxo updates. they are also not present in package managers the way Kubo's ipfs binary is

what I feel should happen, is NOT adding more unmaintained binaries, but leverage ipfs that users already have, and make it support running in similar way to aria2c

Implementation idea

We want ability to run ipfs cat, ipfs get and ipfs dag export work in "ad-hoc" mode in CLI, without the need to initialize repo and start the daemon separately.

How could we implement an equivalent of docker run --rm, which would run with ephemeral repository initialized with random ports, and then remove it after exit?

Perhaps we could simply add support for --foo flag that:

  • accepts an optional path, if not.. creates repo in systems temporary directory
  • seamlessly starts ad-hoc demon against that config/repo from that dir
  • executes ipfs cmd against that repo
  • if no path was passed, removed the directory

cc @gammazero as we talked about it but never captured this idea in and issue

lidel avatar Jun 16 '25 12:06 lidel

I'm not particularly happy with adding more knifes to the swiss knife, given that ipget exists (should be better maintained?). Perhaps the right step is to bundle or release tools together.

That said, it sounds backwards to listen on ports or have a temporary repo for operations that are stateless. i.e. you can't use 2x the space to dowload a dag, even if you delete a temp repo afterwards. The approach calls for a temp libp2p peer that does what it needs to do without worrying about repos, listening ports, config or anything, even if re-usability factor for this is low.

hsanjuan avatar Jun 16 '25 13:06 hsanjuan