go-ssb icon indicating copy to clipboard operation
go-ssb copied to clipboard

Missing: Outgoing connection sheduler

Open cryptix opened this issue 3 years ago • 3 comments

I totally punted on this for now, mostly because go-sbot was intended as a pub for the most time where gossiping happens naturally with the incoming connections.

My other fear is that I saw how messy this can get on the JS side. One rewrite of ssb-gossip went no-where and the 2nd rewrite (ssb-conn) seems to offer more readable code but still lacks behind in features and reliability.

For local client experiments I have been using this as a stop gap:

cat > /tmp/connect.hosts << EOF
net:cryptbox.mindeco.de:8008~shs:xxZeuBUKIXYZZ7y+CIHUuy0NOFXz2MhUBkHemr86S3M=
net:cryptoscope.co:8008~shs:G20wv2IZkB7BA/LKe7WMuByop3++J0u9+Y32OoEVOj8=
net:one.butt.nz:8008~shs:VJM7w1W19ZsKmG2KnfaoKIM66BRoreEkzaVm/J//wl8=
net:pub.t4l3.net:8008~shs:WndnBREUvtFVF14XYEq01icpt91753bA+nVycEJIAX4=
EOF

cat /tmp/connect.hosts | while read maddr
do
  sbotcli connect $maddr
  sleep 600
done

My third hesitation came from the fact that it's very hard to gauge network errors on mobile clients. Is a connection failing because you just went into a tunnel or because the pub server is unreliable? For this reason planetary also schedules it's connections just by calling sbot.Network.Connect(...) without any internal helper code from go-ssb.

I still think it would be good to have a variation of that bash script as an included module that can be switched out, similar to the ssb.ConnTracker interface. A very simple first draft would offer adding favorite pubs like my bash script and then dial them in random once it doesn't have enough connections.

cryptix avatar Nov 11 '20 11:11 cryptix

i was wondering about this, since i noticed the lack of connections to my wee pub, thanks for posting this!

ahdinosaur avatar Jan 10 '22 07:01 ahdinosaur

(ssb-conn) seems to offer more readable code but still lacks behind in features and reliability.

I'm curious what you think is lacking because I'm not aware of any 😅

staltz avatar Jan 10 '22 08:01 staltz

lacks behind in features

I wish I would have spelled those out when I wrote this... 😅

one thing I remember was weird: scheduling of new connections, where it just tried to remain at two but creating new ones all the time from local peers and killing "older" ones. This might be fixed by now.

cryptix avatar Jan 19 '22 16:01 cryptix