Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Nov 20, 2025

Warning

Not ready yet, opening draft PR to see if there are any test failures.

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.

add FastProvideRoot and FastProvideWait options to UnixfsAddSettings,
allowing RPC clients to control immediate DHT providing of root CIDs
for faster content discovery

these options default to server config (Import.FastProvideRoot and
Import.FastProvideWait) when not explicitly set by the client
adds Import method to APIDagService interface and RPC client implementation

- new DagImportResult, DagImportRoot, DagImportStats types in coreiface
- DagImportOptions with uniform Set pattern for all params (PinRoots, Stats, FastProvideRoot, FastProvideWait)
- streaming channel API for handling multiple roots and stats
- tests covering basic import, stats, offline mode, and blocking wait
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Nov 20, 2025
@lidel lidel force-pushed the feat/kubo-v0.39-support branch from 6e89063 to 833c3de Compare November 20, 2025 04:35
adds RPC client support for:
- ipfs provide stat (with --lan flag for dual DHT)
- ipfs dag import (with --fast-provide-root/--fast-provide-wait)

client/rpc changes:
- dag.go: add Import() method (~70 lines)
- dag_test.go: 4 test cases for Import (new file)
- routing.go: add ProvideStats() method (~25 lines)
- routing_test.go: 3 test cases for ProvideStats (new file)

to enable RPC client, refactored commands to use CoreAPI:
- add ProvideStats() to RoutingAPI interface and implementation
- add Import() to APIDagService interface and implementation
- commands delegate to CoreAPI (provide.go, dag/import.go)
@lidel lidel force-pushed the feat/kubo-v0.39-support branch from 833c3de to 45d17e7 Compare November 20, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants