Relay hop not visible in relay client in public network

I have two machines which run ipfs and have a public ip address and added each other ipfs id so that they discover themselves. Such that on ipfs daemon start one machine acts as a relay hop.

relay server ipfs id

{
“ID”: “12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“PublicKey”: “CAESIHt+bDOj5ivPVryUfUAm5ihCZydu3Dg8P8QQC26oX0g+”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip4/127.0.0.1/udp/4001/quic/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip4/172.28.1.179/tcp/4001/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip4/172.28.1.179/udp/4001/quic/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip4/52.203.215.176/tcp/4001/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip4/52.203.215.176/udp/4001/quic/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip6/::1/tcp/4001/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”,
“/ip6/::1/udp/4001/quic/p2p/12D3KooWJ8S8B118DVjMrAzihsXFvGCGZeYThHH9y9MWanoPuNi1”
],
“AgentVersion”: “go-ipfs/0.12.2/”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/ipfs/bitswap”,
“/ipfs/bitswap/1.0.0”,
“/ipfs/bitswap/1.1.0”,
“/ipfs/bitswap/1.2.0”,
“/ipfs/id/1.0.0”,
“/ipfs/id/push/1.0.0”,
“/ipfs/kad/1.0.0”,
“/ipfs/lan/kad/1.0.0”,
“/ipfs/ping/1.0.0”,
“/libp2p/autonat/1.0.0”,
“/libp2p/circuit/relay/0.1.0”,
“/libp2p/circuit/relay/0.2.0/hop”,
“/libp2p/circuit/relay/0.2.0/stop”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

In client machine, I enabled the flag relayclient true and run the daemon and connected to my relayserver public machine and it got swarm connected. Then if I type ipfs id on my relay client machine I should see an address which published via my relay server machine. But I don’t see that and see some other public machines relay server machines address published.

client machine ipfs id

{
“ID”: “12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“PublicKey”: “CAESIAJSwDsX0mE1pPLndt171QXZoZlMWuz3xuqoF7SfTRli”,
“Addresses”: [
“/ip4/10.191.244.206/tcp/24783/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/10.191.244.206/udp/24783/quic/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/127.0.0.1/udp/4001/quic/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/147.75.195.153/tcp/4001/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei/p2p-circuit/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/147.75.195.153/udp/4001/quic/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei/p2p-circuit/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh/p2p-circuit/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/147.75.70.221/udp/4001/quic/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh/p2p-circuit/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/192.168.1.128/tcp/4001/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip4/192.168.1.128/udp/4001/quic/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip6/::1/tcp/4001/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”,
“/ip6/::1/udp/4001/quic/p2p/12D3KooW9ySAnXbPgrUBmcD4t2kdC2t3st3dVbCJv945sjYyuC6u”
],
“AgentVersion”: “go-ipfs/0.12.2/”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/ipfs/bitswap”,
“/ipfs/bitswap/1.0.0”,
“/ipfs/bitswap/1.1.0”,
“/ipfs/bitswap/1.2.0”,
“/ipfs/id/1.0.0”,
“/ipfs/id/push/1.0.0”,
“/ipfs/lan/kad/1.0.0”,
“/ipfs/ping/1.0.0”,
“/libp2p/autonat/1.0.0”,
“/libp2p/circuit/relay/0.1.0”,
“/libp2p/circuit/relay/0.2.0/stop”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

What am I still missing in my relay server machine so that my client machines publish the id via my own relay server machine.

Thank you

You don’t get to pick, the relay client makes that decision for you.

Can we no way mandate that which one to pick ?
Is there any way where I can make my client pick a dedicated relay server?

Thank you

I don’t think so, it’s picked by peerID distance (it picks the closest it can find in ID distance). I tried to find where I read this, but I couldn’t find it.

1 Like

Okay. Now when my relay/hop which are working in public network, like I mean, even if my systems don’t connect to them because of the peer distance some other nodes can get connected right?

Then why can’t the same system work in private network by just adding a swarm key ?
They still show they are started as hop but the clients don’t publish with relay address? Why ?

Am I missing something?

Thank you

Apparently, the relay v2 code does not support the use of swarm keys. So, you could create a private network by only using your own servers in bootstraps, but you can’t use swarm keys unless you use port forwarding instead of relay v2.

1 Like

So, I have to use GitHub - libp2p/go-libp2p-relay-daemon: A standalone libp2p circuit relay daemon providing relay service for versions v1 and v2 of the protocol. and fall back to v1 in that config and then run this along side of my ipfs daemon to make things work?

If that works (I have no experience with it)

I tried as he said but stuck at few places. Like where to run that relay-daemon? On the same machine of ipfs daemon(hop) or on a separate machine.

Do you know any who can give a bit of insight on these ?
Thank you