cpacia / go-onion-transport

MIT License
9 stars 1 forks source link

panic: no good addresses #2

Open psycik opened 2 years ago

psycik commented 2 years ago

I cannot get passed this error when trying to connect two peers. There is also ERROR go-libp2p-swarm swarm_listen.go accept tcp 127.0.0.1:43553: use of closed network connection. Everything appears fine before the connection, Tor starts and create a hidden service, libp2p gets an identity and everything, I get a multiadder like this: /onion3/6ymbnuuu3z3ertz47edmsinxffuf2ofhasfxe3uklsdlh7ncy6ssgiad:53038/p2p/12D3KooWJPnpEUe74qcsUUHm6edQzQhvdGHWMBw2rqoCXznUiz8y

So when getting to the connect part here it breaks:

addr, err := multiaddr.NewMultiaddr("/onion3/6ymbnuuu3z3ertz47edmsinxffuf2ofhasfxe3uklsdlh7ncy6ssgiad:53038/p2p/12D3KooWJPnpEUe74qcsUUHm6edQzQhvdGHWMBw2rqoCXznUiz8y")
    if err != nil {
        onionService.Close()
        torClient.Close()
        panic(err)
    }

    peer, err := peerstore.AddrInfoFromP2pAddr(addr)
    if err != nil {
        onionService.Close()
        torClient.Close()
        panic(err)
    }

    if err := peerHost.Connect(context.Background(), *peer); err != nil {
        onionService.Close()
        torClient.Close()
        panic(err)
    }

    fmt.Println("sending 5 ping messages to", addr)
    ch := pingService.Ping(context.Background(), peer.ID)
    for i := 0; i < 5; i++ {
        res := <-ch
        fmt.Println("pinged", addr, "in", res.RTT)
    }
    onionService.Close()
    torClient.Close()
}
psycik commented 2 years ago

More info about the error:

2021-12-30T16:05:22.998-0800 DEBUG basichost basic/basic_host.go:314 failed to fetch local IPv6 address {“error”: “Element not found.”} 2021-12-30T16:05:23.001-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:109 ResolveUnspecifiedAddresses:[/onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003 /p2p-circuit] [/ip4/192.168.1.235 /ip6/::1 /ip4/127.0.0.1] [/onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003 /p2p-circuit] 2021-12-30T16:05:23.001-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:109 ResolveUnspecifiedAddresses:[/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] [/ip4/192.168.1.235 /ip6/::1 /ip4/127.0.0.1] [/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] 2021-12-30T16:06:01.379-0800 DEBUG basichost basic/basic_host.go:767 host 12D3KooWJPnpEUe74qcsUUHm6edQzQhvdGHWMBw2rqoCXznUiz8y dialing 12D3KooWDGJN3bo1dcwCzhUXLqYTvb67Mk65XDJntWragPWPzqB3 2021-12-30T16:06:01.379-0800 DEBUG swarm2 go-libp2p-swarm@v0.9.0/swarm_dial.go:242 dialing peer {“from”: “12D3KooWJPnpEUe74qcsUUHm6edQzQhvdGHWMBw2rqoCXznUiz8y”, “to”: “12D3KooWDGJN3bo1dcwCzhUXLqYTvb67Mk65XDJntWragPWPzqB3”} 2021-12-30T16:06:01.383-0800 DEBUG basichost basic/basic_host.go:314 failed to fetch local IPv6 address {“error”: “Element not found.”} 2021-12-30T16:06:01.383-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:121 InterfaceAddresses: from manet:[/ip6/fe80::38ac:1eba:e21e:58e5 /ip4/169.254.88.229 /ip4/192.168.137.1 /ip6/fe80::7070:2b84:6530:3b73 /ip4/192.168.1.235 /ip6/fe80::a8c1:3024:bf3e:efc3 /ip4/169.254.239.195 /ip6/fe80::d9af:5f2d:7976:27f /ip4/169.254.2.127 /ip6/fe80::99ae:d2e6:737c:143a /ip4/169.254.20.58 /ip6/fe80::15a6:2e29:f538:52fa /ip4/192.168.35.1 /ip6/::1 /ip4/127.0.0.1] 2021-12-30T16:06:01.383-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:133 InterfaceAddresses: usable:[/ip4/169.254.88.229 /ip4/192.168.137.1 /ip4/192.168.1.235 /ip4/169.254.239.195 /ip4/169.254.2.127 /ip4/169.254.20.58 /ip4/192.168.35.1 /ip6/::1 /ip4/127.0.0.1] 2021-12-30T16:06:01.383-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:109 ResolveUnspecifiedAddresses:[/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] [/ip4/169.254.88.229 /ip4/192.168.137.1 /ip4/192.168.1.235 /ip4/169.254.239.195 /ip4/169.254.2.127 /ip4/169.254.20.58 /ip4/192.168.35.1 /ip6/::1 /ip4/127.0.0.1] [/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] 2021-12-30T16:06:01.383-0800 DEBUG swarm2 go-libp2p-swarm@v0.9.0/swarm_dial.go:267 network for 12D3KooWJPnpEUe74qcsUUHm6edQzQhvdGHWMBw2rqoCXznUiz8y finished dialing 12D3KooWDGJN3bo1dcwCzhUXLqYTvb67Mk65XDJntWragPWPzqB3 2021-12-30T16:06:01.383-0800 DEBUG swarm2 go-libp2p-swarm@v0.9.0/limiter.go:209 [limiter] clearing all peer dials: 12D3KooWDGJN3bo1dcwCzhUXLqYTvb67Mk65XDJntWragPWPzqB3 Dec 30 16:06:01.000 [notice] Catching signal TERM, exiting cleanly. 2021-12-30T16:06:01.386-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:109 ResolveUnspecifiedAddresses:[/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] [/ip4/192.168.1.235 /ip6/::1 /ip4/127.0.0.1] [/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] 2021-12-30T16:06:01.389-0800 DEBUG basichost basic/basic_host.go:314 failed to fetch local IPv6 address {“error”: “Element not found.”} 2021-12-30T16:06:01.392-0800 DEBUG addrutil go-addr-util@v0.1.0/addr.go:109 ResolveUnspecifiedAddresses:[/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] [/ip4/192.168.1.235 /ip6/::1 /ip4/127.0.0.1] [/p2p-circuit /onion3/xsuekqdtpxx5jsbbmgq3nk7msccvd2pgnwopsgq7adgf2boyhxrhgfyd:9003] panic: no good addresses