This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File added right after 'ready' event doesn't get announced to DHT #1526
Labels
exp/expert
Having worked on the specific codebase is important
kind/bug
A bug in existing code (including security flaws)
kind/wontfix-migration-available
status/deferred
Conscious decision to pause or backlog
Type: Bug
Severity: Medium
Description:
When I enable the DHT and disable prefetch in the ipfs-101 example, the added file is not advertised through the DHT and is thus not visible to other nodes. This is happening because
dht.provide()
is called before any peers are available, so the call todht.getClosestPeers()
fails. The following appears in the logs:Adding a few seconds of delay before calling
node.files.add()
fixes the issue.I'm not sure where this should be fixed (even ipfs vs libp2p), but the DHT shouldn't be used before it's ready to accept queries.
Steps to reproduce the error:
DEBUG="libp2p:dht*" node 1.js
ipfs cat /ipfs/<hash>
on another node. It hangs forever.The text was updated successfully, but these errors were encountered: