Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Providers are not found in local network setup #68

Open
fabricedesre opened this issue Nov 22, 2022 · 1 comment
Open

Providers are not found in local network setup #68

fabricedesre opened this issue Nov 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@fabricedesre
Copy link
Contributor

Configuration: running iroh-one on 2 machines on the same local network, with no p2p bootstrap peers. Discovery happens just fine over mDNS.

Use the branch at capyloon/iroh@a7c3b15#diff-4d226c1c8b9372b073d09fa48265e9826c6886a744b6b892eb2c2d800af9d18a to push some content to machine1with:

#!/bin/bash

curl 'http://machine1:9050/ipfs/' \
  -v \
  -H 'Accept: */*' \
  -H 'Accept-Language: en-US' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: text/plain;charset=UTF-8' \
  -H 'Origin: null' \
  -H 'Pragma: no-cache' \
  --data-raw 'Hello Capyloon!'

The CID bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm is getting provided. Check that the CID is in store with curl http://machine1:9050/ipfs/bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm

Then from machine2, wait for both peer counts to reflect the mDNS discovery, and try to fetch the same CID locally: curl http://localhost:9050/ipfs/bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm

I see that log in machine2:

  2022-11-22T18:56:33.182383Z  INFO iroh_p2p::node: bitswap find providers bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm
    at iroh-p2p/src/node.rs:465
    in iroh_p2p::node::handle_node_event with event: Bitswap(FindProviders { key: Cid(bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm), response: Sender { chan: Tx { inner: Chan { tx: Tx { block_tail: 0x7fd1fc0155a0, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } }, limit: 10 })
    in iroh_p2p::node::handle_swarm_event with event: Behaviour(Bitswap(FindProviders { key: Cid(bafkreia5so3urvs3o5mvguua7othrzg5ssz6djdwqtywrmc6m5l7h7wlnm), response: Sender { chan: Tx { inner: Chan { tx: Tx { block_tail: 0x7fd1fc0155a0, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } }, limit: 10 }))

But nothing relevant on machine1, and the request times out.

@dignifiedquire in p2p/src/node.rs the BitswapEvent::FindProviders triggers a RpcMessage::ProviderRequest with a ProviderKey::Dht only, could that be why mDNS providers discovery is not working?

@dignifiedquire
Copy link
Contributor

@dignifiedquire in p2p/src/node.rs the BitswapEvent::FindProviders triggers a RpcMessage::ProviderRequest with a ProviderKey::Dht only, could that be why mDNS providers discovery is not working?

No that is not the reason, this part of finding providers is only used as a fallback by bitswap to find providers if it can not find them via bitswap.

@dignifiedquire dignifiedquire added the bug Something isn't working label Nov 24, 2022
@dignifiedquire dignifiedquire transferred this issue from n0-computer/iroh Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants