From 28d0e6f0f2007394dae36dae36769adc954881d7 Mon Sep 17 00:00:00 2001 From: George Date: Sat, 10 Jul 2021 17:33:01 +0300 Subject: [PATCH 1/2] Fix autopeering --- assets/peers.txt | 92 ++++++++++++++++++++------------------- make_assets | 2 +- src/autopeering/module.go | 12 +++-- src/autopeering/peers.go | 92 ++++++++++++++++++++------------------- 4 files changed, 103 insertions(+), 95 deletions(-) diff --git a/assets/peers.txt b/assets/peers.txt index b271725..5bef638 100644 --- a/assets/peers.txt +++ b/assets/peers.txt @@ -1,64 +1,66 @@ +tcp://140.238.168.104:17117 tcp://159.203.12.215:1010 -tls://159.203.12.215:1020 +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://37.205.14.171:46370 tcp://[2a03:3b40:fe:ab::1]:46370 +tcp://[2a04:5b81:2010::90]:2000 tcp://[2a05:9403::8b]:7743 -tls://217.195.164.4:10531 -tcp://212.129.52.193:39565 +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://[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://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://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://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://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://yugudorashiru.de:80 tcp://y.zbin.eu:7743 -tcp://[2a04:5b81:2010::90]:2000 +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 -tcp://140.238.168.104:17117 -tls://140.238.168.104:17121 -tcp://78.27.153.163:33165 +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 -tcp://curiosity.tdjs.tech:30003 -tcp://213.188.199.150:10010 -tcp://213.188.210.9:10010 -tcp://[2a09:8280:1::3:312]:10010 -tcp://[2a09:8280:1::a:2e2]:10010 -tcp://lancis.iscute.moe:49273 -tcp://longseason.1200bps.xyz:13121 +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 diff --git a/make_assets b/make_assets index 238df6d..cf8e094 100755 --- a/make_assets +++ b/make_assets @@ -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 diff --git a/src/autopeering/module.go b/src/autopeering/module.go index 336fb1c..8606f06 100644 --- a/src/autopeering/module.go +++ b/src/autopeering/module.go @@ -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) + } + }() } } diff --git a/src/autopeering/peers.go b/src/autopeering/peers.go index 4228a12..d9db007 100644 --- a/src/autopeering/peers.go +++ b/src/autopeering/peers.go @@ -1,67 +1,69 @@ package autopeering var PublicPeers = []string{ + "tcp://140.238.168.104:17117", "tcp://159.203.12.215:1010", - "tls://159.203.12.215:1020", + "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://37.205.14.171:46370", "tcp://[2a03:3b40:fe:ab::1]:46370", + "tcp://[2a04:5b81:2010::90]:2000", "tcp://[2a05:9403::8b]:7743", - "tls://217.195.164.4:10531", - "tcp://212.129.52.193:39565", + "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://[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://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://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://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://yggnode.cf:18226", + "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://46.151.26.194: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://ygg-ru.cofob.ru:18001", - "tls://ygg-ru2.cofob.ru:443", + "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://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://213.188.199.150:10010", - "tcp://213.188.210.9:10010", - "tcp://[2a09:8280:1::3:312]:10010", - "tcp://[2a09:8280:1::a:2e2]:10010", - "tcp://lancis.iscute.moe:49273", - "tcp://longseason.1200bps.xyz:13121", - "tls://lancis.iscute.moe:49274", - "tls://longseason.1200bps.xyz:13122"} + "tls://yugudorashiru.de:443"} From 35020b0391790d16ca64117031349e6ddefaf1ec Mon Sep 17 00:00:00 2001 From: George Date: Sat, 10 Jul 2021 17:42:36 +0300 Subject: [PATCH 2/2] Update meshname module to v0.1.2 --- go.mod | 2 +- go.sum | 2 ++ src/meshname/module.go | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index b8d8816..82777e7 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mitchellh/mapstructure v1.4.1 github.com/vishvananda/netlink v1.1.0 github.com/yggdrasil-network/yggdrasil-go v0.4.0 - github.com/zhoreeq/meshname v0.1.0 + github.com/zhoreeq/meshname v0.1.2 golang.org/x/net v0.0.0-20210610132358-84b48f89b13b golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f ) diff --git a/go.sum b/go.sum index ff15904..9856f06 100644 --- a/go.sum +++ b/go.sum @@ -49,6 +49,8 @@ github.com/yggdrasil-network/yggdrasil-go v0.4.0 h1:H2CS2pTjCTzNQMHFU7sEW3Ge59fQ github.com/yggdrasil-network/yggdrasil-go v0.4.0/go.mod h1:/iMJjOrXRsjlFgqhWOPhecOKi7xHmHiY4/En3A42Fog= github.com/zhoreeq/meshname v0.1.0 h1:o7HlQeki4zxv+iorEhmmr4qRQdA2c43/+DLjeOO1Z6g= github.com/zhoreeq/meshname v0.1.0/go.mod h1:3I8MpFZ304bAYiD+e+ovlMDDZat8aKyUlqllUok4qm0= +github.com/zhoreeq/meshname v0.1.2 h1:82jjvRNx9U5OA+WgufQwu/6TFdfCaOeSaXW1ili4K0I= +github.com/zhoreeq/meshname v0.1.2/go.mod h1:3I8MpFZ304bAYiD+e+ovlMDDZat8aKyUlqllUok4qm0= gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f h1:Wku8eEdeJqIOFHtrfkYUByc4bCaTeA6fL0UJgfEiFMI= gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f/go.mod h1:Tiuhl+njh/JIg0uS/sOJVYi0x2HEa5rc1OAaVsb5tAs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/src/meshname/module.go b/src/meshname/module.go index e4f1d9e..f7b92bb 100644 --- a/src/meshname/module.go +++ b/src/meshname/module.go @@ -27,7 +27,9 @@ func (s *MeshnameServer) Init(yggcore *core.Core, yggConfig *config.NodeConfig, s.server = _meshname.New( log, popConfig.Meshname.Listen, - map[string]*net.IPNet{"ygg": yggIPNet, "meshname": yggIPNet}, + map[string]*net.IPNet{"ygg": yggIPNet, "meshname": yggIPNet, "vapordns": yggIPNet}, + false, // enable meship protocol + false, // allow remote queries ) if dnsRecords, err := _meshname.ParseDNSRecordsMap(popConfig.Meshname.Config); err == nil {