Fix autopeering

This commit is contained in:
George
2021-07-10 17:33:01 +03:00
parent 0270fecff2
commit 28d0e6f0f2
4 changed files with 124 additions and 116 deletions
+57 -55
View File
@@ -1,64 +1,66 @@
tcp://159.203.12.215:1010
tls://159.203.12.215:1020
tcp://195.123.245.146:7743
tcp://217.195.164.4:10000
tcp://37.205.14.171:46370
tcp://[2a03:3b40:fe:ab::1]:46370
tcp://[2a05:9403::8b]:7743
tls://217.195.164.4:10531
tcp://212.129.52.193:39565
tcp://51.15.204.214:12345
tcp://[2001:470:1f13:e56::64]:39565
tls://212.129.52.193:39575
tls://51.15.204.214:54321
tls://[2001:470:1f13:e56::64]:39575
tcp://94.130.203.208:5999
tcp://bunkertreff.ddns.net:5454
tcp://ygg.cofob.ru:80
tcp://yugudorashiru.de:80
tls://ygg.cofob.ru:443
tls://yugudorashiru.de:443
tcp://213.188.197.95:10010
tcp://[2a09:8280:1::3:313]:10010
tls://213.188.197.95:10020
tls://[2a09:8280:1::3:313]:10020
tls://45.147.198.155:6010
tls://94.103.82.150:8080
tcp://yggdrasil.frank2.net:1337
tcp://185.165.169.234:8880
tls://185.165.169.234:8443
tcp://46.151.26.194:60575
tcp://lan.tdem.in:50001
tcp://ygg-ru.cofob.ru:18000
tcp://ygg-ru2.cofob.ru:80
tcp://ygg.loskiq.dev:17313
tcp://ygg.tomasgl.ru:61933
tcp://ygg.tomasgl.ru:61933?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576
tcp://yggnode.cf:18226
tls://185.22.60.71:8443
tls://46.151.26.194:8443
tls://[2a01:d0:ffff:4353::2]:6010
tls://lan.tdem.in:50002
tls://ygg-ru.cofob.ru:18001
tls://ygg-ru2.cofob.ru:443
tls://ygg.loskiq.dev:17314
tls://ygg.tomasgl.ru:61944
tls://ygg.tomasgl.ru:61944?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576
tls://yggnode.cf:18227
tcp://y.zbin.eu:7743
tcp://[2a04:5b81:2010::90]:2000
tls://185.130.44.194:7040
tls://[2a07:e01:105:444:c634:6bff:feb5:6e28]:7040
tcp://140.238.168.104:17117
tls://140.238.168.104:17121
tcp://78.27.153.163:33165
tls://78.27.153.163:33166
tcp://curiosity.tdjs.tech:30003
tcp://159.203.12.215:1010
tcp://185.165.169.234:8880
tcp://195.123.245.146:7743
tcp://[2001:470:1f13:e56::64]:39565
tcp://212.129.52.193:39565
tcp://213.188.197.95:10010
tcp://213.188.199.150:10010
tcp://213.188.210.9:10010
tcp://217.195.164.4:10000
tcp://[2a03:3b40:fe:ab::1]:46370
tcp://[2a04:5b81:2010::90]:2000
tcp://[2a05:9403::8b]:7743
tcp://[2a09:8280:1::3:312]:10010
tcp://[2a09:8280:1::3:313]:10010
tcp://[2a09:8280:1::a:2e2]:10010
tcp://37.205.14.171:46370
tcp://46.151.26.194:60575
tcp://51.15.204.214:12345
tcp://78.27.153.163:33165
tcp://94.130.203.208:5999
tcp://bunkertreff.ddns.net:5454
tcp://curiosity.tdjs.tech:30003
tcp://lancis.iscute.moe:49273
tcp://lan.tdem.in:50001
tcp://longseason.1200bps.xyz:13121
tcp://ygg.cofob.ru:80
tcp://yggdrasil.frank2.net:1337
tcp://ygg.loskiq.dev:17313
tcp://yggnode.cf:18226
tcp://ygg-ru2.cofob.ru:80
tcp://ygg-ru.cofob.ru:18000
tcp://ygg.tomasgl.ru:61933
tcp://ygg.tomasgl.ru:61933?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576
tcp://yugudorashiru.de:80
tcp://y.zbin.eu:7743
tls://140.238.168.104:17121
tls://159.203.12.215:1020
tls://185.130.44.194:7040
tls://185.165.169.234:8443
tls://185.22.60.71:8443
tls://[2001:470:1f13:e56::64]:39575
tls://212.129.52.193:39575
tls://213.188.197.95:10020
tls://213.188.199.150:10020
tls://217.195.164.4:10531
tls://[2a01:d0:ffff:4353::2]:6010
tls://[2a07:e01:105:444:c634:6bff:feb5:6e28]:7040
tls://[2a09:8280:1::3:313]:10020
tls://[2a09:8280:1::a:2e2]:10020
tls://45.147.198.155:6010
tls://46.151.26.194:8443
tls://51.15.204.214:54321
tls://78.27.153.163:33166
tls://94.103.82.150:8080
tls://lancis.iscute.moe:49274
tls://lan.tdem.in:50002
tls://longseason.1200bps.xyz:13122
tls://ygg.cofob.ru:443
tls://ygg.loskiq.dev:17314
tls://yggnode.cf:18227
tls://ygg-ru2.cofob.ru:443
tls://ygg-ru.cofob.ru:18001
tls://ygg.tomasgl.ru:61944
tls://ygg.tomasgl.ru:61944?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576
tls://yugudorashiru.de:443
+1 -1
View File
@@ -7,7 +7,7 @@ PEER_LIST=${PEER_LIST:-"assets/peers.txt"}
# Create peers.go "asset" file
make_peers_go() {
PEERS_GO_FILE="src/autopeering/peers.go"
printf "package autopeering\nvar PublicPeers = []string{\n" >$PEERS_GO_FILE
printf "package autopeering\n\nvar PublicPeers = []string{\n" >$PEERS_GO_FILE
while IFS= read -r line
do
printf "\t\"$line\",\n" >> $PEERS_GO_FILE
+8 -4
View File
@@ -17,7 +17,7 @@ import (
const (
linkLocalPrefix = "fe80"
autopeerTimeout = time.Minute
autopeerTimeout = 30 * time.Second
peerCheckTimeout = 10 * time.Second
)
@@ -69,6 +69,7 @@ func (ap *AutoPeering) checkPeerLoop() {
for _, p := range ap.core.GetPeers() {
if p.Remote[:4] != linkLocalPrefix {
ap.log.Debugln("autopeering: remote peer is connected ", p.Remote)
havePeers = true
break
}
@@ -77,15 +78,18 @@ func (ap *AutoPeering) checkPeerLoop() {
if havePeers {
ap.hadPeers = time.Now()
} else if time.Since(ap.hadPeers) > autopeerTimeout {
ap.log.Debugln("autopeering: adding a new peer")
ap.hadPeers = time.Now()
peers := RandomPick(GetClosestPeers(*ap.publicPeers, 10), 1)
if len(peers) == 1 {
peerUri := ap.getPeerUri(peers[0])
ap.log.Infoln("autopeering: adding new peer", peerUri)
if err := ap.core.CallPeer(peerUri, ""); err != nil {
ap.log.Infoln("autopeering: Failed to connect to peer:", err)
}
go func(){
if err := ap.core.CallPeer(peerUri, ""); err != nil {
ap.log.Infoln("autopeering: peer connection failed:", err)
}
}()
}
}
+58 -56
View File
@@ -1,67 +1,69 @@
package autopeering
var PublicPeers = []string{
"tcp://159.203.12.215:1010",
"tls://159.203.12.215:1020",
"tcp://195.123.245.146:7743",
"tcp://217.195.164.4:10000",
"tcp://37.205.14.171:46370",
"tcp://[2a03:3b40:fe:ab::1]:46370",
"tcp://[2a05:9403::8b]:7743",
"tls://217.195.164.4:10531",
"tcp://212.129.52.193:39565",
"tcp://51.15.204.214:12345",
"tcp://[2001:470:1f13:e56::64]:39565",
"tls://212.129.52.193:39575",
"tls://51.15.204.214:54321",
"tls://[2001:470:1f13:e56::64]:39575",
"tcp://94.130.203.208:5999",
"tcp://bunkertreff.ddns.net:5454",
"tcp://ygg.cofob.ru:80",
"tcp://yugudorashiru.de:80",
"tls://ygg.cofob.ru:443",
"tls://yugudorashiru.de:443",
"tcp://213.188.197.95:10010",
"tcp://[2a09:8280:1::3:313]:10010",
"tls://213.188.197.95:10020",
"tls://[2a09:8280:1::3:313]:10020",
"tls://45.147.198.155:6010",
"tls://94.103.82.150:8080",
"tcp://yggdrasil.frank2.net:1337",
"tcp://185.165.169.234:8880",
"tls://185.165.169.234:8443",
"tcp://46.151.26.194:60575",
"tcp://lan.tdem.in:50001",
"tcp://ygg-ru.cofob.ru:18000",
"tcp://ygg-ru2.cofob.ru:80",
"tcp://ygg.loskiq.dev:17313",
"tcp://ygg.tomasgl.ru:61933",
"tcp://ygg.tomasgl.ru:61933?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576",
"tcp://yggnode.cf:18226",
"tls://185.22.60.71:8443",
"tls://46.151.26.194:8443",
"tls://[2a01:d0:ffff:4353::2]:6010",
"tls://lan.tdem.in:50002",
"tls://ygg-ru.cofob.ru:18001",
"tls://ygg-ru2.cofob.ru:443",
"tls://ygg.loskiq.dev:17314",
"tls://ygg.tomasgl.ru:61944",
"tls://ygg.tomasgl.ru:61944?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576",
"tls://yggnode.cf:18227",
"tcp://y.zbin.eu:7743",
"tcp://[2a04:5b81:2010::90]:2000",
"tls://185.130.44.194:7040",
"tls://[2a07:e01:105:444:c634:6bff:feb5:6e28]:7040",
"tcp://140.238.168.104:17117",
"tls://140.238.168.104:17121",
"tcp://78.27.153.163:33165",
"tls://78.27.153.163:33166",
"tcp://curiosity.tdjs.tech:30003",
"tcp://159.203.12.215:1010",
"tcp://185.165.169.234:8880",
"tcp://195.123.245.146:7743",
"tcp://[2001:470:1f13:e56::64]:39565",
"tcp://212.129.52.193:39565",
"tcp://213.188.197.95:10010",
"tcp://213.188.199.150:10010",
"tcp://213.188.210.9:10010",
"tcp://217.195.164.4:10000",
"tcp://[2a03:3b40:fe:ab::1]:46370",
"tcp://[2a04:5b81:2010::90]:2000",
"tcp://[2a05:9403::8b]:7743",
"tcp://[2a09:8280:1::3:312]:10010",
"tcp://[2a09:8280:1::3:313]:10010",
"tcp://[2a09:8280:1::a:2e2]:10010",
"tcp://37.205.14.171:46370",
"tcp://46.151.26.194:60575",
"tcp://51.15.204.214:12345",
"tcp://78.27.153.163:33165",
"tcp://94.130.203.208:5999",
"tcp://bunkertreff.ddns.net:5454",
"tcp://curiosity.tdjs.tech:30003",
"tcp://lancis.iscute.moe:49273",
"tcp://lan.tdem.in:50001",
"tcp://longseason.1200bps.xyz:13121",
"tcp://ygg.cofob.ru:80",
"tcp://yggdrasil.frank2.net:1337",
"tcp://ygg.loskiq.dev:17313",
"tcp://yggnode.cf:18226",
"tcp://ygg-ru2.cofob.ru:80",
"tcp://ygg-ru.cofob.ru:18000",
"tcp://ygg.tomasgl.ru:61933",
"tcp://ygg.tomasgl.ru:61933?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576",
"tcp://yugudorashiru.de:80",
"tcp://y.zbin.eu:7743",
"tls://140.238.168.104:17121",
"tls://159.203.12.215:1020",
"tls://185.130.44.194:7040",
"tls://185.165.169.234:8443",
"tls://185.22.60.71:8443",
"tls://[2001:470:1f13:e56::64]:39575",
"tls://212.129.52.193:39575",
"tls://213.188.197.95:10020",
"tls://213.188.199.150:10020",
"tls://217.195.164.4:10531",
"tls://[2a01:d0:ffff:4353::2]:6010",
"tls://[2a07:e01:105:444:c634:6bff:feb5:6e28]:7040",
"tls://[2a09:8280:1::3:313]:10020",
"tls://[2a09:8280:1::a:2e2]:10020",
"tls://45.147.198.155:6010",
"tls://46.151.26.194:8443",
"tls://51.15.204.214:54321",
"tls://78.27.153.163:33166",
"tls://94.103.82.150:8080",
"tls://lancis.iscute.moe:49274",
"tls://longseason.1200bps.xyz:13122"}
"tls://lan.tdem.in:50002",
"tls://longseason.1200bps.xyz:13122",
"tls://ygg.cofob.ru:443",
"tls://ygg.loskiq.dev:17314",
"tls://yggnode.cf:18227",
"tls://ygg-ru2.cofob.ru:443",
"tls://ygg-ru.cofob.ru:18001",
"tls://ygg.tomasgl.ru:61944",
"tls://ygg.tomasgl.ru:61944?key=c5e0c28a600c2118e986196a0bbcbda4934d8e9278ceabea48838dc5d8fae576",
"tls://yugudorashiru.de:443"}