How to setup V1 Relay in the new config

Yes it did work @ylempereur
Thanks a lot for your help and patience in looking into the issue and guiding out.

Node C

{
“ID”: “12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”,
“PublicKey”: “CAESINtkM3qJ1Vzx8Sud/cqF6C6voZ1i+MNeBbg4foxVQ+Up”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”,
“/ip4/172.28.1.179/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”,
“/ip4/52.203../tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”,
“/ip6/::1/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”
],
“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/”
]
}

Node D

{
“ID”: “12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”,
“PublicKey”: “CAESIAi//Shornz1pDXi3QvucDsSRzp7UfVmAz1QBCMClbeZ”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”,
“/ip4/172.28.1.135/tcp/4001/p2p/12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”,
“/ip4/54.165..*/tcp/4001/p2p/12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”,
“/ip6/::1/tcp/4001/p2p/12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”
],
“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/”
]
}

So now the client machine A and B can turn on RelayClient { Enabled: true } and swarm connecting to these C and D nodes should help A and B to communicate and transfer data right ?

A and B are successfully connected to C and D.
Then I want to connect A and B to each other. So I ran the below command.

ipfs.exe swarm connect /ip4/node-C-id/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG/p2p-circuit/p2p/12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL

Error: connect 12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL failure: failed to dial 12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL:

  • [/ip4/node-c-ip/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG/p2p-circuit] error opening relay circuit: NO_RESERVATION (204)

Do we need to enable something so that reservations are made ?
Or do you think enable whole punching is better way and faster way to transfer data as you mentioned very early on this thread.

1 Like

You can’t just arbitrarily pick a relay node and expect to connect through it (the node chooses which relay it wants you to use).

First, type ipfs id on your target node to see if it advertises a relay address. If it does, now type ipfs id <node_id> on the other node and see if that returns the same info (another way to display those addresses that you can try is ipfs dht findpeer <node_id>). Next, you can try ipfs swarm connect using that address, but the previous command will have already connected you as a side effect if it worked (use ipfs swarm peers to confirm it). the final thing you can do after that is set up peering between those two nodes, so that they connect automatically and remain connected to each other.

P.S. make sure hole punching is enabled on both A & B, or they won’t be able to connect

Node A ipfs id output

{
“ID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PublicKey”: “CAESICzE8LUriLxkWnIPU+WzZIyyDBLoW5WAstnU6AZ4DruO”,
“Addresses”: [
“/ip4/10.191.244.206/tcp/34227/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“/ip4/192.168.1.127/tcp/4001/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“/ip6/::1/tcp/4001/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”
],
“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/”
]
}

Node B ipfs id output

{
“ID”: “12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL”,
“PublicKey”: “CAESIC8slvE00xCqiN2gfDUrHdKmrxPtN2WcnuzCfOprOhnh”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL”,
“/ip4/192.168.55.107/tcp/4001/p2p/12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL”,
“/ip6/::1/tcp/4001/p2p/12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL”
],
“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/”
]
}

Note: Both machines are connected to C and D

And if I do ipfs id <node_id> / ipfs dht findpeer <node_id>

ipfs.exe id 12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL
Error: routing: not found

Not able to see the relay addresses published on these nodes.

Node A config

{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: ,
“AppendAnnounce”: ,
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: ,
“Swarm”: [
“/ip4/0.0.0.0/tcp/4001”,
“/ip6/::/tcp/4001”,
“/ip4/0.0.0.0/udp/4001/quic”,
“/ip6/::/udp/4001/quic”
]
},
“AutoNAT”: {},
“Bootstrap”: ,
“DNS”: {
“Resolvers”: {}
},
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“child”: {
“path”: “badgerds”,
“syncWrites”: false,
“truncate”: true,
“type”: “badgerds”
},
“prefix”: “badger.datastore”,
“type”: “measure”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“AcceleratedDHTClient”: false,
“FilestoreEnabled”: false,
“GraphsyncEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“StrategicProviding”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: ,
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
"
]
},
“NoDNSLink”: false,
“NoFetch”: false,
“PathPrefixes”: [],
“PublicGateways”: null,
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PrivKey”: "CAESQDIIQOjQeFh40XADC2DuHMJvAdvsY+oHO44pansD2+IbLMTwtSuIvGRacg9T5bNkjLIMEuhblYCy
******”
},
“Internal”: {},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Migration”: {
“DownloadSources”: ,
“Keep”: “”
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Peering”: {
“Peers”: null
},
“Pinning”: {
“RemoteServices”: {}
},
“Plugins”: {
“Plugins”: null
},
“Provider”: {
“Strategy”: “”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“EnableHolePunching”: true,
“RelayClient”: {
“Enabled”: true
},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}
}
}

Node B config

{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: ,
“AppendAnnounce”: ,
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: ,
“Swarm”: [
“/ip4/0.0.0.0/tcp/4001”,
“/ip6/::/tcp/4001”,
“/ip4/0.0.0.0/udp/4001/quic”,
“/ip6/::/udp/4001/quic”
]
},
“AutoNAT”: {},
“Bootstrap”: ,
“DNS”: {
“Resolvers”: {}
},
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“child”: {
“path”: “badgerds”,
“syncWrites”: false,
“truncate”: true,
“type”: “badgerds”
},
“prefix”: “badger.datastore”,
“type”: “measure”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“AcceleratedDHTClient”: false,
“FilestoreEnabled”: false,
“GraphsyncEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“StrategicProviding”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: ,
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
"
]
},
“NoDNSLink”: false,
“NoFetch”: false,
“PathPrefixes”: [],
“PublicGateways”: null,
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “12D3KooWCzWmNhrmBrqqThnXYdRTZX9YcxywSt1tfFzAr6Gh4UzL”,
“PrivKey”: "CAESQGYSks9CBETIek3Dc+WEtOL4B/5AG6SdH5AgVC+sRddxLyyW8TTTEKqI3aB8NSsd0qavE+03ZZye7MJ
********”
},
“Internal”: {},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Migration”: {
“DownloadSources”: ,
“Keep”: “”
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Peering”: {
“Peers”: null
},
“Pinning”: {
“RemoteServices”: {}
},
“Plugins”: {
“Plugins”: null
},
“Provider”: {
“Strategy”: “”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“EnableHolePunching”: true,
“RelayClient”: {
“Enabled”: true
},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}
}
}

Are we missing something?

1 Like

I got same error message as him. I guess we are about to solve it :slight_smile: @ylempereur hope you can help us

K, they don’t seem to feel the need to advertise a relay address for some reason. Let’s see if we can force their hand.

On nodes A & B (try just one of them first), change the contents of the Addresses.Swarm array to:

"Swarm": [
    "/ip4/127.0.0.1/tcp/4001",
    "/ip4/127.0.0.1/udp/4001/quic"
]

then restart it and see if it advertises a relay address now. If it does, do it on the other one too, and then see if they’ll connect to each other.

Config of A

{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: ,
“AppendAnnounce”: ,
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: ,
“Swarm”: [
“/ip4/127.0.0.1/tcp/4001”,
“/ip4/127.0.0.1/udp/4001/quic”
]
},
“AutoNAT”: {},
“Bootstrap”: ,
“DNS”: {
“Resolvers”: {}
},
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“child”: {
“path”: “badgerds”,
“syncWrites”: false,
“truncate”: true,
“type”: “badgerds”
},
“prefix”: “badger.datastore”,
“type”: “measure”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“AcceleratedDHTClient”: false,
“FilestoreEnabled”: false,
“GraphsyncEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“StrategicProviding”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: ,
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
“*”
]
},
“NoDNSLink”: false,
“NoFetch”: false,
“PathPrefixes”: ,
“PublicGateways”: null,
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PrivKey”: “CAESQDIIQOjQeFh40XADC2DuHMJvAdvsY+oHO44pansD2+IbLMTwtSuIvGRacg9T5bNkjLIMEuhblYCy2dToBngOu44=”
},
“Internal”: {},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Migration”: {
“DownloadSources”: ,
“Keep”: “”
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Peering”: {
“Peers”: null
},
“Pinning”: {
“RemoteServices”: {}
},
“Plugins”: {
“Plugins”: null
},
“Provider”: {
“Strategy”: “”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“EnableHolePunching”: true,
“RelayClient”: {
“Enabled”: true
},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}
}
}

ipfs id of A

{
“ID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PublicKey”: “CAESICzE8LUriLxkWnIPU+WzZIyyDBLoW5WAstnU6AZ4DruO”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”
],
“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/”
]
}

Looks like it doesn’t.

I don’t see C & D in the Bootstrap array of A. Both A & B should have them (make sure to use their public address).

I was manually connecting them. Let me add them in the bootstrap for A & B

ipfs id of A

{
“ID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PublicKey”: “CAESICzE8LUriLxkWnIPU+WzZIyyDBLoW5WAstnU6AZ4DruO”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”
],
“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/”
]
}

Config of A

{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: ,
“AppendAnnounce”: ,
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: ,
“Swarm”: [
“/ip4/127.0.0.1/tcp/4001”,
“/ip4/127.0.0.1/udp/4001/quic”
]
},
“AutoNAT”: {},
“Bootstrap”: [
“/ip4/52.203.215.176/tcp/4001/p2p/12D3KooWQan5Bj7xjK8wuKjLn1CTUKnKX4jufM8bohnhAAKADhAG”,
“/ip4/54.165.44.174/tcp/4001/p2p/12D3KooWAQXE5gfUUWri8EfemPCxMCXnA6Yys8LwMNKqogSPvLgG”
],
“DNS”: {
“Resolvers”: {}
},
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“child”: {
“path”: “badgerds”,
“syncWrites”: false,
“truncate”: true,
“type”: “badgerds”
},
“prefix”: “badger.datastore”,
“type”: “measure”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“AcceleratedDHTClient”: false,
“FilestoreEnabled”: false,
“GraphsyncEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“StrategicProviding”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: ,
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
“*”
]
},
“NoDNSLink”: false,
“NoFetch”: false,
“PathPrefixes”: ,
“PublicGateways”: null,
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “12D3KooWCq8HLWuii9xAwvaKmN7CUvEWfHP8eygwQVc4JQoPTErq”,
“PrivKey”: “CAESQDIIQOjQeFh40XADC2DuHMJvAdvsY+oHO44pansD2+IbLMTwtSuIvGRacg9T5bNkjLIMEuhblYCy2dToBngOu44=”
},
“Internal”: {},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Migration”: {
“DownloadSources”: ,
“Keep”: “”
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Peering”: {
“Peers”: null
},
“Pinning”: {
“RemoteServices”: {}
},
“Plugins”: {
“Plugins”: null
},
“Provider”: {
“Strategy”: “”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“EnableHolePunching”: true,
“RelayClient”: {
“Enabled”: true
},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}
}
}

ipfs daemon output

Initializing daemon…
go-ipfs version: 0.12.2
Repo version: 12
System version: amd64/windows
Golang version: go1.16.15
Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: c99475fbaea06dea11eb63c9e19f8b9e
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

On A, use ipfs swarm peers to confirm it is indeed connected to C & D. Then use ipfs id <id> on A for C & D, and see if you get the right responses. Then use ipfs dht findpeer <id> to confirm that works too. If all that works properly, we’ll check other things (but, to be honest, I don’t see anything wrong anymore, so I’m not sure what to explore next yet).

It works properly, but cannot see B from A. I can give you all of my test acc (ubuntu server for you to trace if you want). It is serious to my project, hope we can find the root cause

If we can’t solve it by the time I get off work, I may ask you for that so that I can poke around and try to figure out what is going on. In his ipfs daemon output, it actually states that it’s listening on /p2p-circuit, but then it doesn’t announce it. I can’t explain why it doesn’t

1 Like

FYI: some commands

Things look fine as you mentioned. But it doesn’t publish relay address on A

Yeah, that’s normal. The node you are trying to reach must first connect to the relay server itself, then announce it (that’s what’s known as the reservation). Then, using the address it announced, you can connect to it. Just trying a random relay won’t work, because the target doesn’t have a connection to it, and it’s just as stuck as you are, it can’t dial the node any more than you can.

1 Like

Looks good. That part is now working the way it should.

In your ipfs daemon output, it says it’s listening on /p2p-circuit, but then only announces the localhost address instead of announcing both. That’s where the next problem is, but I’m not sure what could be causing that.

I’m trying a few things on my own nodes right now, to see if I can get some insights into what is going on.

2 Likes

Sure. Thank you for the help.
Let me know if you want swarm.key of my private network to look at the issue more deeper.

OK, I have it working flawlessly on one of my nodes (it can be done :grin:). However, I’m using the main net, not a private net like you guys are trying to do (I’m not sure it matters, but I had to disclose it).

I’m using the same configuration you are using:

"Addresses": {
	"API": "/ip4/127.0.0.1/tcp/5001",
	"Announce": [],
	"AppendAnnounce": null,
	"Gateway": "/ip4/127.0.0.1/tcp/8080",
	"NoAnnounce": [],
	"Swarm": [
		"/ip4/127.0.0.1/tcp/4001",
		"/ip4/127.0.0.1/udp/4001/quic"
	]
},
...
	"EnableHolePunching": true,
	"RelayClient": {
		"Enabled": true
	},
	"RelayService": {},

However, the thing is kinda fickle. There are two things I noticed:

  • if the node thinks it has the ability to be reachable (even if you prevent it with NoAnnounce), it will not connect to the relay service, ever.
  • it doesn’t connect to the relay service right away. when the node finishes coming up, it only announces the localhost address. later, it will start announcing the relay address as well. how much later varies, a lot (it can be as short as 15 seconds, and it has taken as long as 5-10 minutes). I have no idea why.

Once the relay address is announced, I can connect to it with ipfs id <node_id>, which it will answer through the relay, and if I ask for content that only it has, the hole punch connection gets established, and the content is retrieved.

Here is what ipfs id looks like on the node right now:

"Addresses": [
	"/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/127.0.0.1/udp/4001/quic/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/173.255.205.80/tcp/4001/p2p/12D3KooWSc12Ch2SR63TN4KsfwdVpXHBNfTRN6iWqXoUkoqJySM6/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/173.255.205.80/udp/4001/quic/p2p/12D3KooWSc12Ch2SR63TN4KsfwdVpXHBNfTRN6iWqXoUkoqJySM6/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/79.133.120.84/tcp/4001/p2p/12D3KooWFWLio1PuPnknfXbnZWFCeoK24cEDUsrfuRYHXFrzrT7b/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/79.133.120.84/udp/4001/quic/p2p/12D3KooWFWLio1PuPnknfXbnZWFCeoK24cEDUsrfuRYHXFrzrT7b/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/80.240.115.153/tcp/4001/p2p/12D3KooWFWLio1PuPnknfXbnZWFCeoK24cEDUsrfuRYHXFrzrT7b/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip4/80.240.115.153/udp/4001/quic/p2p/12D3KooWFWLio1PuPnknfXbnZWFCeoK24cEDUsrfuRYHXFrzrT7b/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip6/2600:3c00::f03c:93ff:fe24:4b86/tcp/4001/p2p/12D3KooWSc12Ch2SR63TN4KsfwdVpXHBNfTRN6iWqXoUkoqJySM6/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV",
	"/ip6/2600:3c00::f03c:93ff:fe24:4b86/udp/4001/quic/p2p/12D3KooWSc12Ch2SR63TN4KsfwdVpXHBNfTRN6iWqXoUkoqJySM6/p2p-circuit/p2p/12D3KooWKuSzGoorvsBB8zdXCYVMEfybYKa7sDgXT3AkofAzX3FV"
],

It seems to pick the relays at random. If I restart the node, it will pick different ones.

So, let it sit for a bit, see if the relay address comes up. If not, we’ll have to figure out what is different in your setup.

You are right! I deleted swarm.key on 4 PCs and it works. I also noticed the address is different in 2 cases (Of course we need to setup private not public network. This feature should be supported by ipfs I believe)

With swarm.key

{
“ID”: “12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“PublicKey”: “CAESIFcKxwCuR68/4H5p8ZqiXxzDMoUNcZPb266vJ/EAXIFl”,
“Addresses”: [
“/ip4/10.0.10.10/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip6/::1/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”
],
“AgentVersion”: “go-ipfs/0.12.1/”,
“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/”
]
}

Without swarm.key

{
“ID”: “12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“PublicKey”: “CAESIFcKxwCuR68/4H5p8ZqiXxzDMoUNcZPb266vJ/EAXIFl”,
“Addresses”: [
“/ip4/10.0.10.10/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/10.0.10.10/udp/4001/quic/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/127.0.0.1/udp/4001/quic/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh/p2p-circuit/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip4/147.75.70.221/udp/4001/quic/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh/p2p-circuit/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip6/::1/tcp/4001/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”,
“/ip6/::1/udp/4001/quic/p2p/12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS”
],
“AgentVersion”: “go-ipfs/0.12.1/”,
“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/”
]
}