Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const peerId = ipfs._peerInfo.id
pubsubDs = new PubsubDatastore(pubsub, localDatastore, peerId)
ipnsStores.push(pubsubDs)
}
// DHT should not be added as routing if we are offline or it is disabled
if (get(ipfs._options, 'offline') || !get(ipfs._options, 'libp2p.config.dht.enabled', false)) {
const offlineDatastore = new OfflineDatastore(ipfs._repo)
ipnsStores.push(offlineDatastore)
} else {
ipnsStores.push(ipfs.libp2p.dht)
}
// Create ipns routing with a set of datastores
return new TieredDatastore(ipnsStores)
}