tomeshnet / prototype-cjdns-pi

Prototype system for mesh networks on single board computers
https://chat.tomesh.net/#/room/#software:tomesh.net
GNU General Public License v3.0
218 stars 42 forks source link

Running ipfs swarm connect on both nodes #421

Open makew0rld opened 5 years ago

makew0rld commented 5 years ago

As I found out here, you need to run ipfs swarm connect on both nodes to actually successfully establish a priority connection. We do this in our code with direct mesh peers, but only on startup of the IPFS service.

This means that sometimes this command will only go one way (when a new node joins), or that sometimes the connection is joined much later (when a node sends it out to a node that doesn't have IPFS started, and then that node later starts it and sends it back). I am checking here and previously here how large the window is between call and response, but that still doesn't solve the former problem about when only one node issues the command.

One solution would be to turn ipfs-swarm.sh into a loop, every 30 seconds or whatever the window is. It could also potentially keep track of which nodes it had established priority connections with, and only the contact the ones it hadn't.

darkdrgn2k commented 5 years ago

I'd rather use some sort of discovery protocol possibly like #385

makew0rld commented 5 years ago

I'm still confused about how this plays out, I've asked to confirm here.