ipfs add: parameter to control the width of created UnixFS DAG #10751
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
topic/files
Topic files
topic/rpc-api
Issues related to Kubo RPC API at /api/v0
topic/UnixFS
Topic UnixFS
TLDR
There is no CLI / RPC / Config option to control max DAG width in Kubo when creating a UnixFS DAG.
Users who want to fully control the final CID need to be able to control this.
Details
and iiuc the implicit defaults are different for files and directories:
DefaultShardWidth
here is 256fanout
from Unixfs spec but has to be confirmed – see Caveats section belowDefaultLinksPerBlock
here is ~174ability to pass a static dag width for files could be exposed via
ipfs add --help
the same way as--chunker
and--hash
are, but it requires PR against boxo and kubo.Proposed design
dag-width
ipfs add --dag-width=N
with default being defined in config atImport.UnixFSDAGWidth
, similar to Import.UnixFSChunker.legacy-cid-v0
profile match current default (174?)test-cid-v1
– perhaps 1024, matching Storachaboxo
to expose ability to override mentionedDefault..
Acceptance criteria / caveats
legacy-cid-v0
profile should ensure current behavior does not changeImport.UnixFSDAGWidth
andImport.UnixFSHAMTWidth
just to make this profile possible.fanout
ofHAMTShard
UnixFS node type. if 256 is a hard requirement, keep it. If not, makeImport.UnixFSHAMTWidth
followImport.UnixFSDAGWidth
unless both are set to different values by the userThe text was updated successfully, but these errors were encountered: