“How to enable dht routing in node IPFS ? I’m trying to findprovs of CIDs”
I got error “dht not enabled”
const IPFS = require('ipfs-core')
async function run() {
const ipfs = await IPFS.create({Routing: 'dht' }) // I should enter dht here?
const { cid } = await ipfs.add('Hello world')
console.log(cid)
// QmNRCQWfgze6AbBCaT1rkrkV5tJ2aP4oTNPb5JZcXYywve
const providers = ipfs.dht.findProvs('QmNRCQWfgze6AbBCaT1rkrkV5tJ2aP4oTNPb5JZcXYywve')
for await (const provider of providers) {
console.log(provider.id.toString())
}
}
run()
node_modules/ipfs-core/src/components/dht.js:216
throw new NotEnabledError(‘dht not enabled’)