Skip to content

Use standard IPLD codec names across the CLI/HTTP API #8471

Closed
@aschmahmann

Description

@aschmahmann

Update 11/26 (@schomatis):

For review: #8568.

Working in draft branch with working notes and annotated code.

First attempt at adding the multicodec option for block put in ipfs/interface-go-ipfs-core#80.

Need to confirm this issue's description is in sync with conclusions from thread here and other multicodec issues.


While the recent #7976 related changes were a big step forwards in terms of both using the standardized codec names from https://github.com/multiformats/multicodec/blob/master/table.csv and making better use of the codecs they've left a couple of our APIs as confusing.

ipfs dag put and ipfs dag get both use codec names correctly as pulled from the table above. However, ipfs block put and ipfs cid codecs both use the older set of names defined in https://github.com/ipfs/go-cid/blob/5640b0169f6284562b1b8636b10e32dd85ea0a8a/cid.go#L85-L112.

We should switch both of those commands to use the correct names.

Some recommendations for particulars about the changes:

  • ipfs cid codecs should contain a --supported flag that lists which codecs are known to go-ipfs per Enumerate available encodings for dag get #8171 (review). This has some tradeoffs if different commands support different subsets of codecs, but for now this seems reasonable.
  • ipfs block put --format should probably be kept and deprecated alongside a new ipfs block put --store-codec and if both flags are used the user should receive an error. This would allow us to not break existing users, but still move forward.
    • Unlike with ipfs dag put where there was a backwards compatible changes anyway it seems useful to not break users here since we shouldn't have to.

Metadata

Metadata

Assignees

Labels

P1High: Likely tackled by core team if no one steps upkind/enhancementA net-new feature or improvement to an existing featurekind/maintenanceWork required to avoid breaking changes or harm to project's status quotopic/apiTopic apitopic/docsDocumentation

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions