From e38a3edcaf4c079d5e7a5dcf6a8cf4cf9e24d440 Mon Sep 17 00:00:00 2001 From: Derek White Date: Mon, 30 May 2022 19:56:27 -0500 Subject: [PATCH 1/2] Updates findProvs example Perhaps this is outdated? findProvs (as mentioned on lines 87-89) is expecting a CID, not a string --- docs/core-api/DHT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core-api/DHT.md b/docs/core-api/DHT.md index fef01450f4..61915cb704 100644 --- a/docs/core-api/DHT.md +++ b/docs/core-api/DHT.md @@ -109,7 +109,7 @@ Note that if `options.numProviders` are not found an error will be thrown. ### Example ```JavaScript -const providers = ipfs.dht.findProvs('QmdPAhQRxrDKqkGPvQzBvjYe3kU8kiEEAd2J6ETEamKAD9') +const providers = ipfs.dht.findProvs(Ipfs.CID.parse('QmdPAhQRxrDKqkGPvQzBvjYe3kU8kiEEAd2J6ETEamKAD9')) for await (const provider of providers) { console.log(provider.id.toString()) From c2018f897c83f09490c0f9d5a463ad2768c39039 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 1 Jun 2022 14:16:49 +0100 Subject: [PATCH 2/2] chore: update docs/core-api/DHT.md --- docs/core-api/DHT.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/core-api/DHT.md b/docs/core-api/DHT.md index 61915cb704..964bb20eed 100644 --- a/docs/core-api/DHT.md +++ b/docs/core-api/DHT.md @@ -109,7 +109,9 @@ Note that if `options.numProviders` are not found an error will be thrown. ### Example ```JavaScript -const providers = ipfs.dht.findProvs(Ipfs.CID.parse('QmdPAhQRxrDKqkGPvQzBvjYe3kU8kiEEAd2J6ETEamKAD9')) +import { CID } from 'multiformats/cid' + +const providers = ipfs.dht.findProvs(CID.parse('QmdPAhQRxrDKqkGPvQzBvjYe3kU8kiEEAd2J6ETEamKAD9')) for await (const provider of providers) { console.log(provider.id.toString())