How to setup V1 Relay in the new config

Hmmm, so the issue is that relay v2 doesn’t support the use of swarm keys. Well, that kinda sucks, it means that your only recourse is to set up proper port forwarding on all your client nodes instead then… :confused:

1 Like

I have 2 questions:

  1. I have not set up 147.75.195.153, 147.75.70.221. I guess it is hard coded in IPFS when no swarm.key, correct?
    ipfs swarm peers
    /ip4/147.75.195.153/tcp/4001/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei
    /ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh
    /ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh/p2p-circuit/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS
    /ip4/52.221.249.235/tcp/4001/p2p/12D3KooWLjHvyiufBnv3whtWnJ1ZrZjkX4jmohbioQi1dym8LTab
    /ip4/54.169.103.175/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP
  2. Do you have any documents relating to port forwarding setup
  3. Does relay v1 work with swarm.key (It seems susarlanikhilesh made it worked)
  1. no, it discovered those addresses in the dht (nodes on your network announced those addresses to the dht). actually, it looks like you connected to main net, which means you are using main net bootstrap addresses, not your own nodes. fix that.
  2. unfortunately, port forwarding is set up on your router (not ipfs, not your computer), and there’s a gazillion different routers on the market, so refer to your router’s manual. you need to forward tcp 4001 and udp 4001 to your computer’s private IP address.
  3. I assume it did, but I have no experience with it. v1 is still available as a stand alone daemon, you could run that on your C node instead of the ipfs daemon, and it should work (your client nodes will pick up either v1 or v2, they don’t care, they support both).

Should we raise an issue on go-ipfs project ?

The standalone daemon also does not support I believe.
If you referring to this.

Yeah, I’d let them know it’s something you care about. If enough people want it, I’m sure they’ll prioritize it.

1 Like

Using the relay-daemon and making it private we were able to connect and my client node is publishing the relay address as part of address. But they are dropping and those values to show up in the addresses take time. Where does this lie to check and to keep it alive as long as the ipfs is running.

what can be sometimes, that it advertises as a hop but does not publish the public address

{
        "ID": "12D3KooWNE76XyRBtKYhmVbnTryyAEE8wsFLocKHDrg9CG27sUau",
        "PublicKey": "CAESILhhI9FlJ1HlemKDgsW58+4umRZMaFhDG9pOrR197/2K",
        "Addresses": [
                "/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWNE76XyRBtKYhmVbnTryyAEE8wsFLocKHDrg9CG27sUau",
                "/ip4/172.28.1.135/tcp/4001/p2p/12D3KooWNE76XyRBtKYhmVbnTryyAEE8wsFLocKHDrg9CG27sUau",
                "/ip6/::1/tcp/4001/p2p/12D3KooWNE76XyRBtKYhmVbnTryyAEE8wsFLocKHDrg9CG27sUau"
        ],
        "AgentVersion": "go-ipfs/0.14.0-dev/ce7d41cc",
        "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/hop",
                "/libp2p/circuit/relay/0.2.0/stop",
                "/p2p/id/delta/1.0.0",
                "/x/"
        ]
}

I have added announce and it shows as a hop, but when I try to connect to the other node via the hop node it fails.

I have RelayService : true in the hop node. The other nodes have RelayClient: true and EnableHolePunching : true.

Error: connect 12D3KooWH9aQeFFqPRqQJzXpCYdDAQkYp9Wu5uqqX4rvQEdxjgnW failure: failed to dial 12D3KooWH9aQeFFqPRqQJzXpCYdDAQkYp9Wu5uqqX4rvQEdxjgnW:
  * [/ip4/pubilic-ip-addr/tcp/4002/p2p/12D3KooWNyfErMvXCm4PNWurKDPLM9Ua5EbJAv1xSaqBZDqncLy4/p2p-circuit] error opening relay circuit: NO_RESERVATION (204)
  * [/dnsaddr/dns-value/p2p/12D3KooWNyfErMvXCm4PNWurKDPLM9Ua5EbJAv1xSaqBZDqncLy4/p2p-circuit] concurrent active dial through the same relay failed with a protocol error
  * [/ip4/192.168.88.3/tcp/4001] dial tcp4 0.0.0.0:4001->192.168.88.3:4001: i/o timeout

Am I missing something?

You can’t force the announce of a relay circuit, that’s something only the node can do on its own after it gets a reservation on the relay server it chose (you can’t choose it yourself). If you force one, it won’t have a reservation on the relay you announce, so a connection won’t be possible. You can only announce static routes that you have verified you have (port forwarding).

2 Likes

Currently Im using go-ipfs 0.15.0 and can ping / swarm connect between A and B, but got another problem
ipfs get cid from A/B hang indefinitely. Any ideas?

I think the difference is that ping can go through the relay, but get requires a direct connection, so it’s probably trying to open one using hole punching.

1 Like

But why swarm connect is success, but get command still hangs, please help

Are you using relay v1 or relay v2?

we are using v2, go-ipfs 0.15.0,

Then what I said stands. The swarm connect establishes a connection through the relay. It’s a low bandwidth connection that is only good for ping and as a meeting point to establish a “hole punch” direct connection. Anything else will require the hole punch connection to be established first (this is automatic). If that connection fails, whatever you are trying to do (such as a get) will fail.

The easiest way to test it is to establish the relay connection, then use ipfs id for the remote. If successful, ipfs swarm peers will report two connections to the peer, the initial relay connection, and the direct “hole punch” connection. Only the direct connection can use bitswap, which is what’s needed for a get.

both nodes can see, and can do swarm connect success, but when it get a small file …it hangs. our relay server is at /ip4/54.169.103.175/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP in case you want to try

It seems ok from here, but what matters is the other two nodes. Make sure they report "/libp2p/dcutr" when you do an ipfs id for them. If they don’t, that’s your problem.

Config on both clients (different network)
“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”,
“/libp2p/dcutr”,
“/p2p/id/delta/1.0.0”,
“/x/”
]

it is still hanging
you can try thi CID QmYxfrxaNq75vMXi4sEFsNbSzWVtG1kT4SmbknGT9u6RD1

Does the “Addresses” part of the ipfs id show p2p circuit addresses through the relay or something else?