You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Implements an option for the CLI, HTTP API and core (where appropriate) that will allow the user to pick the multibase encoding for any CIDs that are returned as strings.
**NOTE** Using the CID base option in `bitswap`, `dag` and `object` APIs **WILL NOT** auto upgrade your CID to v1 if it is a v0 CID and **WILL NOT** apply the encoding you specified. This is because these APIs return IPLD objects with links and changing the version of the links would result in a different hash for the node if you were to re-add it. Also, the CID you used to retrieve the node wouldn't actually refer to the node you got back any longer. [Read this](ipfs/kubo#5349 (comment)) for further context.
This PR adds a `--cid-base` option to the following **CLI commands**:
* `jsipfs bitswap stat`
* `jsipfs bitswap unwant`
* `jsipfs bitswap wantlist`
* `jsipfs block put`
* `jsipfs block stat`
* `jsipfs add`
* `jsipfs ls`
* `jsipfs object get`
* `jsipfs object links`
* `jsipfs object new`
* `jsipfs object patch add-link`
* `jsipfs object patch append-data`
* `jsipfs object patch rm-link`
* `jsipfs object patch set-data`
* `jsipfs object put`
* `jsipfs object stat`
* `jsipfs pin add`
* `jsipfs pin ls`
* `jsipfs pin rm`
* `jsipfs resolve`
Note: these two MFS commands _already_ implement the `--cid-base` option:
* `jsipfs files ls`
* `jsipfs files stat`
It also adds `?cid-base=` query option to the following **HTTP endpoints**:
* `/api/v0/bitswap/wantlist`
* `/api/v0/bitswap/stat`
* `/api/v0/bitswap/unwant`
* `/api/v0/block/put`
* `/api/v0/block/stat`
* `/api/v0/add`
* `/api/v0/ls`
* `/api/v0/object/new`
* `/api/v0/object/get`
* `/api/v0/object/put`
* `/api/v0/object/stat`
* `/api/v0/object/links`
* `/api/v0/object/patch/append-data`
* `/api/v0/object/patch/set-data`
* `/api/v0/object/patch/add-link`
* `/api/v0/object/patch/rm-link`
* `/api/v0/pin/ls`
* `/api/v0/pin/add`
* `/api/v0/pin/rm`
* `/api/v0/resolve`
It adds a `cidBase` option to the following **core functions**:
* `resolve`
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
0 commit comments