How to setup V1 Relay in the new config

OK, try a couple things:

First, type ipfs id on C and post that here, then type it on A or B and post it here.

Next, remove the RelayService.Enabled from C and bring it up, then type ipfs id on C and post it here.

Then, type ipfs id <B_peer_id> on A and post that here.

Hopefully, there will be a hint of what is going on in those messages (or, removing the enabled from C will actually make things work, as it’s supposed to be on by default for the purpose of hole punching).

I’ll include the material from the release notes here, so you can see what I’m working with (again, I had this setup working for me before, but I only had 2 clients, I was relying on a relay server somewhere on the ipfs network, so I don’t really know how that one is set up):


:repeat: Circuit Relay v2

This release adds support for the circuit relay v2 protocol based on the reference implementation from go-libp2p 0.16.

This is the cornerstone for maximizing p2p connections between IPFS peers. Every publicly dialable peer can now act as a limited relay v2, which can be used for hole punching and other decentralized signaling protocols.

Limited relay v2 configuration options

go-ipfs can now be configured to act as a RelayClient that uses other peers for autorelay functionality when behind a NAT, or provide a limited RelayService to other peers on the network.

Starting with go-ipfs v0.11 every publicly dialable go-ipfs (based on AutoNAT determination) will start a limited RelayService . RelayClient remains disabled by default for now, as we want the network to update and get enough v2 service providers first.

Note: the limited Circuit Relay v2 provided with this release only allows low-bandwidth protocols (identify, ping, holepunch) over transient connections. If you want to relay things like bitswap sessions, you need to set up a v1 relay by some other means. See details below.

Removal of unlimited v1 relay service provider

Switching to v2 of the relay spec means removal or deprecation of configuration keys that were specific to v1.

  • Relay transport and client support circuit-relay v2:
    • Swarm.EnableAutoRelay was replaced by Swarm.RelayClient.Enable .
    • Swarm.DisableRelay is deprecated, relay transport can be now disabled globally (both client and service) by setting Swarm.Transports.Network.Relay to false
  • Relay v1 service provider was replaced by v2:
    • Swarm.EnableRelayHop no longer starts an unlimited v1 relay. If you have it set to true the node will refuse to start and display an error message.
    • Existing users who choose to continue running a v1 relay should migrate their setups to relay v1 based on js-ipfs running in node, or the standalone libp2p-relay-daemon configured with RelayV1.Enabled set to true . Be mindful that v1 relays are unlimited, and one may want to set up some ACL based either on PeerIDs or Subnets.

:hole: Decentralized Hole Punching (DCUtR protocol client)

We are working towards enabling hole punching for NAT traversal when port forwarding is not possible.

go-libp2p 0.16 provides an implementation of the DCUtR (decentralized hole punching) protocol. It is hidden behind the Swarm.EnableHolePunching configuration flag.

When enabled, go-ipfs will coordinate with the counterparty using a relayed v2 connection, to upgrade to a direct connection through a NAT/firewall whenever possible.

This feature is disabled by default in this release, but we hope to enable it by default as soon the network updates to go-ipfs v0.11 and gains a healthy set of limited v2 relays.

ipfs id on C

{
“ID”: “12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”,
“PublicKey”: “CAESIE6h+Ymv4ba/Kujbggf9jWw**************”,
“Addresses”: [
“/ip4/10.1.193.173/tcp/4001/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V”
],
“AgentVersion”: “go-ipfs/0.13.0-dev/daa9beb7”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

ipfs id on A

{
“ID”: “12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”,
“PublicKey”: “CAESIP9YLND3/gNyBZa2qD/DVAq2XyZXiq***************”,
“Addresses”: [
“/ip4/10.191.244.206/tcp/55259/p2p/12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”,
“/ip4/192.168.1.127/tcp/4001/p2p/12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”,
“/ip6/::1/tcp/4001/p2p/12D3KooWT187aTvpbyurLUgZjLZtFS18xcDz1um2GMvFDekDycMn”
],
“AgentVersion”: “go-ipfs/0.13.0-dev/daa9beb7”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

ipfs id on B

{
“ID”: “12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”,
“PublicKey”: “CAESIHgPeMofzc4TfexjlA07R3YU8ioJC+z6r*************”,
“Addresses”: [
“/ip4/10.133.11.255/tcp/60852/p2p/12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”,
“/ip4/192.168.0.127/tcp/4001/p2p/12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”,
“/ip6/::1/tcp/4001/p2p/12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”,
“/ip6/fd01::b849:8849:cb3f:b465/tcp/4001/p2p/12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h”
],
“AgentVersion”: “go-ipfs/0.13.0-dev/daa9beb7”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

When typed ipfs id B on A machine

Error: failed to dial 12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h:

  • [/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V/p2p-circuit] error opening relay circuit: HOP_CANT_SPEAK_RELAY (270)
  • [/ip4/192.168.0.127/tcp/4001] dial tcp4 0.0.0.0:4001->192.168.0.127:4001: i/o timeout
  • [/ip4/10.133.11.255/tcp/60852] dial tcp4 0.0.0.0:4001->10.133.11.255:60852: i/o timeout
  • [/ip4/10.133.11.255/tcp/27222] dial tcp4 0.0.0.0:4001->10.133.11.255:27222: i/o timeout
  • [/ip4/10.133.11.255/tcp/51554] dial tcp4 0.0.0.0:4001->10.133.11.255:51554: i/o timeout
  • [/ip4/192.168.88.9/tcp/4001] dial tcp4 0.0.0.0:4001->192.168.88.9:4001: i/o timeout

Removing RelayService.Enabled from C

ipfs id on C

{
“ID”: “12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V”,
“PublicKey”: “CAESIE6h+Ymv4ba/Kujbggf9jWw+LbzZoSx**************”,
“Addresses”: [
“/ip4/10.1.214.67/tcp/4001/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V”
],
“AgentVersion”: “go-ipfs/0.13.0-dev/daa9beb7”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

When typed ipfs id B on A machine

Error: failed to dial 12D3KooWHu2mxR4ZgQko4SUPdnRWCJiVTdnNafCPdyUzbRGL4R4h:

  • [/ip4/10.133.11.255/tcp/51554] dial backoff
  • [/ip4/192.168.88.9/tcp/4001] dial backoff
  • [/ip4/10.133.11.255/tcp/60852] dial backoff
  • [/ip4/10.133.11.255/tcp/54555] dial backoff
  • [/ip4/10.133.11.255/tcp/27222] dial backoff
  • [/ip4/192.168.0.127/tcp/4001] dial backoff
  • [/p2p/12D3KooWF7KDk87dvSDTdPR3nYqc5rWmFpLqc85wzz4jL1pFMT2V/p2p-circuit] error opening relay circuit: HOP_CANT_SPEAK_RELAY (270)

Let me know if any more information is required
Thank you

AHA!

Your C node does not have a public address! That causes it not to spawn the relay service, which then causes clients to get the error they get. Here is what the protocol list should look like (I’m just listing the libp2p part):


"/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",

So, the issue is that 10.x.x.x is a private address range. C node really needs a real public address, or this will never work.

Now, if C node actually does have a real public address, ipfs is not publishing it, which would mean you are behind a firewall and it blocks incoming access (or it has NAT and you need port forwarding).

Progress!!!

2 Likes

I’ve got the same problem here is my C node config
{
“ID”: “12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP”,
“PublicKey”: “CAESIOPm+e7hMLzupcKuxhvGVw7sEP3nwup0/VoIy2b/sKsK”,
“Addresses”: [
“/ip4/0.0.0.0/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP”
],
“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/”
]
}
I also noticed I don’t have this config “/libp2p/circuit/relay/0.2.0/hop” as yours, so any suggestion, btw I don’t understand “Your C node does not have a public address”, it could be nice if you can give steps how to set it up on ubuntu, thank you so much

Well, the first thing to know is: if you turned on the RelayClient, that also turns off the RelayService, which will cause that line to disappear (that’s normal, it’s an either/or situation). So, that’s one thing to check.

Second, unless you edited the output manually before posting it, your node is advertising 0.0.0.0 as its address. That can’t be right, in any circumstances, so your config is wrong in some way.

Finally, if your node isn’t advertising a proper set of addresses, generally, it’s because you are behind a NAT router/firewall and you didn’t set up port mapping correctly or didn’t enable the RelayClient/HolePunching.

I can’t tell what your situation is without seeing your config file.

Node A:

{
  "API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [
      "/ip4/0.0.0.0/tcp/4001"
    ],
    "AppendAnnounce": [x],
    "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": [
    "/ip4/54.169.103.175/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "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": "12D3KooWGD5myqbSM1YQp7Sb3ot4UCAAF7wiEwcN24xC8B8pNJxe"
  },
  "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": {
      "Enabled": false
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Node B

{
  "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": [
    "/ip4/54.169.103.175/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "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": "12D3KooWFg9ApLqQiTdkaGhgFNTWFsiRMCSDGCQgZ1RuBwSMXAmS"
  },
  "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": {
      "Enabled": false
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Node C

{
  "API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Announce": [
      "/ip4/0.0.0.0/tcp/4001"
    ],
    "AppendAnnounce": [],
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [
      "/ip4/10.0.0.0/ipcidr/8",
      "/ip4/100.64.0.0/ipcidr/10",
      "/ip4/169.254.0.0/ipcidr/16",
      "/ip4/172.16.0.0/ipcidr/12",
      "/ip4/192.0.0.0/ipcidr/24",
      "/ip4/192.0.2.0/ipcidr/24",
      "/ip4/192.168.0.0/ipcidr/16",
      "/ip4/198.18.0.0/ipcidr/15",
      "/ip4/198.51.100.0/ipcidr/24",
      "/ip4/203.0.113.0/ipcidr/24",
      "/ip4/240.0.0.0/ipcidr/4",
      "/ip6/100::/ipcidr/64",
      "/ip6/2001:2::/ipcidr/48",
      "/ip6/2001:db8::/ipcidr/32",
      "/ip6/fc00::/ipcidr/7",
      "/ip6/fe80::/ipcidr/10"
    ],
    "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": null,
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "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": "12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP"
  },
  "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": [
      "/ip4/10.0.0.0/ipcidr/8",
      "/ip4/100.64.0.0/ipcidr/10",
      "/ip4/169.254.0.0/ipcidr/16",
      "/ip4/172.16.0.0/ipcidr/12",
      "/ip4/192.0.0.0/ipcidr/24",
      "/ip4/192.0.2.0/ipcidr/24",
      "/ip4/192.168.0.0/ipcidr/16",
      "/ip4/198.18.0.0/ipcidr/15",
      "/ip4/198.51.100.0/ipcidr/24",
      "/ip4/203.0.113.0/ipcidr/24",
      "/ip4/240.0.0.0/ipcidr/4",
      "/ip6/100::/ipcidr/64",
      "/ip6/2001:2::/ipcidr/48",
      "/ip6/2001:db8::/ipcidr/32",
      "/ip6/fc00::/ipcidr/7",
      "/ip6/fe80::/ipcidr/10"
    ],
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "EnableHolePunching": false,
    "RelayClient": {
      "Enabled": false
    },
    "RelayService": {
      "Enabled": true
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

ngnix (Node C)
ubuntu@ip-172-31-41-63:/etc/nginx/sites-available$ tail default
        listen 80;
#        server_name your.domain;

        access_log /var/log/nginx/ipfs.access.log;
        error_log /var/log/nginx/ipfs.error.log;

        location / {
                proxy_pass http://0.0.0.0:8080/;
        }
}

Our previous question: HOP_CANT_SPEAK_RELAY error when setting up IPFS private network - #5 by hector

Please help us

Please check our config

First, your announce is very wrong:

"Announce": [
  "/ip4/0.0.0.0/tcp/4001"
],

It is what is causing your node to advertise 0.0.0.0. Just remove the entry, and your node will figure out what to use:

"Announce": [],

Second, I had trouble communicating with your bootstrap node, but then I realized you are probably using a swarm key, so that’s why.

Everything else seems reasonable to me.

Also, you don’t need to repeat the filters in Addresses.NoAnnounce, having them in Swarm.AddrFilters is enough.

So, fix the Announce, restart everything, and then run ipfs id on each node, and post the results here (you can post inline, you don’t have to use an upload site). We’ll have a better idea of what’s going on with that.

  1. I’ve update Announce to and still get the problem
  2. Configs
    Node A
    {
    “ID”: “12D3KooWGD5myqbSM1YQp7Sb3ot4UCAAF7wiEwcN24xC8B8pNJxe”,
    “PublicKey”: “CAESIF738fRL5iNMP2EoanL6hT9CfeR6mYISzSKAz9pMWTuX”,
    “Addresses”: [
    “/p2p/12D3KooWGD5myqbSM1YQp7Sb3ot4UCAAF7wiEwcN24xC8B8pNJxe”
    ],
    “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/”
    ]
    }

Node B
{
“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/”
]
}

Node C (relay server)
{
“ID”: “12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP”,
“PublicKey”: “CAESIOPm+e7hMLzupcKuxhvGVw7sEP3nwup0/VoIy2b/sKsK”,
“Addresses”: [
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP”,
“/ip6/::1/tcp/4001/p2p/12D3KooWR9zzY5ZZnKyvwm5cKTxexPFQ4DZCypAtqZ1sHDm2GtqP”
],
“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/”
]
}

I see what the issue is: since the C node is alone on the network at first, it has no way to use autonat to discover its own address and establish that it’s reachable, so it can only publish localhost. We’re going to have to hard code the C node (this wouldn’t be necessary if you had 2 or more bootstraps, it’s the fact that it’s alone that causes the problem).

Set the announce on C to the following:

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

(assuming that’s the correct public address for C). Then restart C, then the other 2, and do the ipfs id dance again, and post them here. We’re getting closer :slight_smile:

Here is the result (still get HOP_CANT_SPEAK_RELAY)

Please email to nguyenquoctruongson@gmail.com if you want the server acc or swarm.key

K, the problem still is that the relay service is not coming up on node C. Something isn’t working the way it’s supposed to. I have a couple ideas on why that may be happening:

  • the relay v2 service isn’t compatible with the use of a swarm key.
  • the fact that the public node has no bootstrap for itself prevents it from running autonat, so it never finishes configuring itself and never gets to the point where it can decide to bring up the relay service.

The first hypothesis should be easy for you to test (just remove the swarm key from use and see if that changes anything). The second would require setting up 2 public servers having each other as bootstrap and see if that causes the relay service to come up (if you can do that for a test, please try).

If that doesn’t give us more information, I’ll set up my own private network for testing (all my current nodes are attached to the main net) and try to find out what is going on. I’ll also get in touch with some of the libp2p devs for some more insights (maybe it’s just a bug, or an unsupported configuration).

2 Likes
  1. no swarm.key => still get that error
  2. I only have one server as master, It could be nice if you can check that case
    (Im happy to give my credential that support your testing)
    We got this problem around 1 month without go ahead. We are much appreciate your help :slight_smile:

I found the following in the Circuit Relay v2 spec document:

In order to address this problem, we have split the protocol into the hop and stop subprotocols. This allows us to always enable the client-side functionality in a host, while providing the option to later mount the relay service in public hosts, after the reachability of the host has been determined through AutoNAT.

That statement makes it crystal clear that my second guess is the reason the relay service isn’t coming up for you. That means your type of setup can only work with two or more bootstrap nodes and cannot be made to work properly with only one, as the relay service will never come up due to the node having no one to talk to when using AutoNAT (I never ran into that problem when I was using relay v2 myself, as I use the main net which has plenty of bootstrap nodes to work with).

If you cannot run a second server, consider setting up port forwarding on one of your other nodes to make it publicly reachable and setting it as the bootstrap node for your server. That will give your server someone to talk to initially and allow it to determine that it is itself reachable, which will then allow it to bring up the relay service. Everything should work properly after that.

I wish there was a way to force the relay service to come up instead, eliminating the need for a second bootstrap server. Maybe an enhancement request should be filed with the libp2p project, as it is something they clearly never considered.

1 Like

The values that you mentioned “/libp2p/circuit/relay/0.2.0/hop” this should be visible in C (relay node) or the client nodes A/B ? Just a confirmation ?

Only on the relay node (C), it won’t be visible on the other two due to them using the relay client.

ipfs id of C

{
“ID”: “12D3KooWEshZUUGeW3piV4V4pmV7vd85hmTzLHWXZ8pVnGvdVx5Y”,
“PublicKey”: “CAESIEslGoH/7v3TvmuMdCOP4dJW/r8Gm8vQ/OJ1MgW5GNTD”,
“Addresses”: [
“/ip4/10.1.43.220/tcp/4001/p2p/12D3KooWEshZUUGeW3piV4V4pmV7vd85hmTzLHWXZ8pVnGvdVx5Y”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWEshZUUGeW3piV4V4pmV7vd85hmTzLHWXZ8pVnGvdVx5Y”,
“/ip6/::1/tcp/4001/p2p/12D3KooWEshZUUGeW3piV4V4pmV7vd85hmTzLHWXZ8pVnGvdVx5Y”
],
“AgentVersion”: “go-ipfs/0.13.0-dev/daa9beb7”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

Even after assigning it public ip. I don’t see if announcing.

ipfs id of a working node which acts as a relay with v1 config

{
“ID”: “12D3KooWPod5mZzP21QHmxzoqzSsr7KG8SyQ7wJ8ertLM698xKvT”,
“PublicKey”: “CAESIM/S5lQ8exGfMYVgRqlZhOGQUu/IuK8GsKYkQmhp5S3s”,
“Addresses”: [
“/ip4/10.1.207.93/tcp/4001/p2p/12D3KooWPod5mZzP21QHmxzoqzSsr7KG8SyQ7wJ8ertLM698xKvT”,
“/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWPod5mZzP21QHmxzoqzSsr7KG8SyQ7wJ8ertLM698xKvT”
],
“AgentVersion”: “go-ipfs/0.8.0-dev/9f14a84d”,
“ProtocolVersion”: “ipfs/0.1.0”,
“Protocols”: [
“/floodsub/1.0.0”,
“/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”,
“/meshsub/1.0.0”,
“/meshsub/1.1.0”,
“/p2p/id/delta/1.0.0”,
“/x/”
]
}

So, what am I still missing ?
Thank you

You have the same issue as the other person; you are going to need a second bootstrap server for your C server to start publishing its public IP address and enable its relay service. See my previous post.

Yes I was just going through. Let me setup another node same as C (say D) should suffice and start advertising right ?

As long as they both have a public address and use each other’s public address as bootstrap, it should work. Then, all the other nodes should list them both as their own bootstraps.

1 Like