From 73a67261a5448cfc1218e01a8ab140d1e90a2166 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 2 Jul 2020 13:27:07 +0100 Subject: [PATCH] feat: store blocks by multihash instead of CID (#3124) 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 --- package.json | 6 +++--- src/lib/core.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 067f9a315..31d37a466 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/lib/core.js b/src/lib/core.js index 22389c106..fb6b51ebc 100644 --- a/src/lib/core.js +++ b/src/lib/core.js @@ -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')