feat(dag): add --local-only to dag export and import#11229
Open
ChayanDass wants to merge 10 commits intoipfs:masterfrom
Open
feat(dag): add --local-only to dag export and import#11229ChayanDass wants to merge 10 commits intoipfs:masterfrom
ChayanDass wants to merge 10 commits intoipfs:masterfrom
Conversation
- Export: only export blocks present locally; skip missing (partial CAR). --local-only with --offline. Support both binary and base58 link keys. - Import: support partial CARs; --local-only with -- pin-roots=false (error if both --pin-roots and --local-only set). - Fix cidFromBinString to accept base58 key format from link implementations. Signed-off-by: Chayan Das <01chayandas@gmail.com>
2e5e224 to
9ad0c3b
Compare
- remove local replace directive for go-car/v2 - upgrade to v2.16.1-0.20260306172652-7d2f4aceb070
lidel
requested changes
Mar 8, 2026
Member
lidel
left a comment
There was a problem hiding this comment.
Thank you @ChayanDass, quick first pass review below.
Also, we need to wait for go-car release with your fix before this can be merged.
Signed-off-by: Chayan Das <01chayandas@gmail.com>
Signed-off-by: Chayan Das <01chayandas@gmail.com>
Author
|
@lidel i’ve added the tests ,PTAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
--local-onlytodag exportanddag importSummary
Adds support for partial CAR export and import: export only blocks that exist locally (skipping missing blocks), and import such partial CARs without pinning roots.
Changes
dag export--local-only(bool): When set, only blocks present in the local blockstore are exported; missing blocks are skipped (partial CAR). User must pass--offlineexplicitly for a local-only DAG walk; the command does not set offline automatically.dag import--pin-roots(bool, default true): Pin optional roots listed in the CAR headers after importing.--pin-roots=falseand--local-only(not both with pin-roots true).Usage
Export a partial CAR (local blocks only; user must pass both flags):
Import that partial CAR without pinning roots:
ipfs dag import --pin-roots=false partial.car # or ipfs dag import --local-only --pin-roots=false partial.carReferences
ipfs dag export --ignore-missing-blocks#10826, ipfs-webui#2380