Hi everyone!
I started playing with IPFS a couple of weeks ago and i managed to build a live chat system with integrated file sharing across the peers, nothing crazy.
Basically when User A joins a chat i subscribe to a specific PubSub and send some messages around to the other Peers.
There is obviously no problem in discovering local Peers and i always get connected to my devices under the same WiFi.
So at this point i decided to try across different networks and my iPhone on cellular cannot discover my laptop (on WiFi), i even tried hosting my own js-libp2p-webrtc-star signaling server (with SSL and stuff) but nothing helped.
Any suggestion?
Here is the configuration im using in the browser IPFS instance so far:
const conf: any = {
peerId,
addresses: {
listen: [
'/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star',
'/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star',
],
},
dialer: {
maxParallelDials: 150, // 150 total parallel multiaddr dials
maxDialsPerPeer: 4, // Allow 4 multiaddrs to be dialed per peer in parallel
dialTimeout: 10e3, // 10 second dial timeout per peer dial
resolvers: {
dnsaddr: dnsaddrResolver
},
addressSorter: publicAddressesFirst
},
modules: {
transport: [WS, WebRTCStar],
streamMuxer: [MPLEX],
connEncryption: [NOISE],
peerDiscovery: [Bootstrap],
pubsub: GossipSub,
dht: KadDHT,
},
transportManager: {
// https://github.com/libp2p/js-libp2p/blob/0a6bc0d1013dfd80ab600e8f74c1544b433ece29/doc/CONFIGURATION.md#configuring-transport-manager
// We don't want js-ipfs boot to fail when all webrtc signaling servers are down
faultTolerance: FaultTolerance.NO_FATAL
},
config: {
peerDiscovery: {
autoDial: true,
[Bootstrap.tag]: {
enabled: true,
list: bootstrapList
},
// [WebRTCStar.discovery.tag]
[WebRTCStar.tag]: {
enabled: true
}
},
dht: {
enabled: true,
kBucketSize: 20,
randomWalk: {
enabled: true,
interval: 10e3, // This is set low intentionally, so more peers are discovered quickly. Higher intervals are recommended
timeout: 2e3 // End the query quickly since we're running so frequently
}
},
pubsub: {
enabled: true,
emitSelf: true
},
nat: {
enabled: true,
ttl: 7200, // TTL for port mappings (min 20 minutes)
keepAlive: true, // Refresh port mapping after TTL expires
pmp: {
enabled: false, // defaults to false
}
},
relay: {
enabled: true,
hop: {
enabled: true,
active: true
}
}
},
metrics: {
enabled: false
},
peerStore: {
persistence: true,
threshold: 1
}
}
SIDE NOTE: connecting my iPhone to the office VPN ends up “fixing” the issue and my laptop can see the iphone peer but this is happening in the VPN subnet of course, im suspecting something about advertising maybe.