kubo icon indicating copy to clipboard operation
kubo copied to clipboard

feat(client/rpc): add `provide stat` and `dag import` support

Open lidel opened this issue 1 month ago • 0 comments

[!WARNING] Not ready yet, opening draft PR to see if there are any test failures. I will work on this is spare time, but likely 0.40.

This PR adds client/rpc (RPC library for GO) support for:

  • ipfs provide stat
  • ipfs dag import (with --fast-provide-root/--fast-provide-wait)

To enable this, refactored commands to use CoreAPI, which is reusable layer shared between commands (cli/rpc) and client/rpc (remote rpc client library for go):

  • add ProvideStats() to RoutingAPI interface and implementation
  • add Import() to APIDagService interface and implementation
  • commands delegate to CoreAPI (provide.go, dag/import.go)

We shoul've done that when we added original commands / flags, making sure things end up in CoreAPI to work with client/rpc, but we do this very rarely so we forgot. This PR cleans this up.

lidel avatar Nov 20 '25 04:11 lidel