Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Updates findProvs example (#4114)
Browse files Browse the repository at this point in the history
findProvs (as mentioned on lines 87-89) is expecting a CID, not a string

Co-authored-by: Alex Potsides <alex@achingbrain.net>
  • Loading branch information
d-r-w and achingbrain authored Jun 1, 2022
1 parent 764b4ad commit be025c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/core-api/DHT.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ Note that if `options.numProviders` are not found an error will be thrown.
### Example

```JavaScript
const providers = ipfs.dht.findProvs('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())
Expand Down

0 comments on commit be025c8

Please sign in to comment.