Skip to content

"ipfs stats dht" doesn't work with Routing.Type=custom #9482

@MichaelMure

Description

@MichaelMure

Checklist

Installation method

built from source

Version

ipfs version 0.17.0

Config

...

  "Routing": {
    "Methods": {
      "find-peers": {
        "RouterName": "ParallelHelper"
      },
      "find-providers": {
        "RouterName": "ParallelHelper"
      },
      "get-ipns": {
        "RouterName": "ParallelHelper"
      },
      "provide": {
        "RouterName": "WanDHT"
      },
      "put-ipns": {
        "RouterName": "ParallelHelper"
      }
    },
    "Routers": {
      "CidContact": {
        "Parameters": {
          "Endpoint": "https://cid.contact/reframe"
        },
        "Type": "reframe"
      },
      "ParallelHelper": {
        "Parameters": {
          "Routers": [
            {
              "IgnoreErrors": true,
              "RouterName": "CidContact",
              "Timeout": "3s"
            },
            {
              "ExecuteAfter": "2s",
              "IgnoreErrors": false,
              "RouterName": "WanDHT",
              "Timeout": "5m"
            }
          ]
        },
        "Type": "parallel"
      },
      "WanDHT": {
        "Parameters": {
          "AcceleratedDHTClient": true,
          "Mode": "dhtserver",
          "PublicIPNetwork": true
        },
        "Type": "dht"
      }
    },
    "Type": "custom"
  },

...

Description

When using custom routing, for example using the config detailed in the v0.16 release notes, the ipfs stats dht command return Error: routing service is not a DHT, even though there is a DHT in there.

I understand the relative complexity of searching for a DHT in a custom routing pipeline and the possible edge cases, but it would be nice if that command would work in the (very common) case where there is exactly one DHT. Not only DHT stats are obviously useful, but my understanding is that it's also the only way to figure out if the accelerated DHT is ready to publish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High: Likely tackled by core team if no one steps upexp/expertHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)topic/commandsTopic commandstopic/dhtTopic dht

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions