From 252c770e92d1ed77eb53679368ea44f5dea2ab76 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 26 Oct 2019 00:26:28 +0200 Subject: [PATCH] feat: support CIDs in /ipns/ content paths This is WIP. While the change is minimal, the code does not work because we requires async refactor of libp2p to land first. License: MIT Signed-off-by: Marcin Rataj --- package.json | 2 +- src/core/ipns/resolver.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0b04b66c7c..0d8cada02c 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "p-iteration": "^1.1.8", "p-queue": "^6.1.0", "peer-book": "^0.9.1", - "peer-id": "^0.12.2", + "peer-id": "libp2p/js-peer-id#feat/cid-support", "peer-info": "~0.15.1", "progress": "^2.0.1", "promise-nodeify": "^3.0.1", diff --git a/src/core/ipns/resolver.js b/src/core/ipns/resolver.js index 0970eecdfc..5e68be904e 100644 --- a/src/core/ipns/resolver.js +++ b/src/core/ipns/resolver.js @@ -74,7 +74,7 @@ class IpnsResolver { // resolve ipns entries from the provided routing async _resolveName (name) { - const peerId = PeerId.createFromB58String(name) + const peerId = PeerId.createFromCID(name) const { routingKey } = ipns.getIdKeys(peerId.toBytes()) let record