Skip to content

Commit

Permalink
feat: store blocks by multihash instead of CID (#3124)
Browse files Browse the repository at this point in the history
Updates the `ipfs-repo` dep to a version that stores blocks by multihash instead of CID to support CIDv1 and CIDv0 access to the same block.

New features:

- Adds a `--multihash` argument to the cli command `ipfs refs local` which prints the base32 encoded multihash of each block

BREAKING CHANGES:

- `ipfs.refs.local` now returns a v1 CID with the raw codec for every block and not the original CID by which it was added to the blockstore

Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
  • Loading branch information
achingbrain and hugomrdias committed Jul 2, 2020
1 parent 02a3f0b commit 73a6726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@
"merge-options": "^2.0.0",
"multiaddr": "^7.4.3",
"multiaddr-to-uri": "^5.1.0",
"multibase": "^0.7.0",
"multibase": "^1.0.1",
"multicodec": "^1.0.0",
"multihashes": "^1.0.1",
"nanoid": "^3.0.2",
"node-fetch": "^2.6.0",
"parse-duration": "^0.1.2",
"parse-duration": "^0.4.4",
"stream-to-it": "^0.2.0"
},
"devDependencies": {
"aegir": "^22.1.0",
"aegir": "^23.0.0",
"cross-env": "^7.0.0",
"go-ipfs-dep": "^0.5.1",
"interface-ipfs-core": "^0.137.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Multiaddr = require('multiaddr')
const toUri = require('multiaddr-to-uri')
const { isBrowser, isWebWorker } = require('ipfs-utils/src/env')
const { URL } = require('iso-url')
const parseDuration = require('parse-duration')
const parseDuration = require('parse-duration').default
const log = require('debug')('ipfs-http-client:lib:error-handler')
const HTTP = require('ipfs-utils/src/http')
const merge = require('merge-options')
Expand Down

0 comments on commit 73a6726

Please sign in to comment.