Reputation: 13
During IPFS node explorer development we found some unusual online nodes without a valid IP in Addresses
field. For example: QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
Get the node info by ipfs id command.
Query:
root@tux:~# ipfs id QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
Response:
{
"ID": "QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV",
"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFhgftYoqapg+Y7wlWq67HA4O2c37jelJxUJqai0DyZMEeyQBzw4+Jc0VxPuXJNovb3SRIz9XCq3tyibbBs2JcZkHF+i9t8WERJth7c3rnLsEddPHAagW9nnBd+XxT4l9guZZtYOQ/YFZBTicZEdyKdc4fithz4QaweZqj/sa5lWYuaTTEA9y4Zikhh2NkM6gs0Suhamtym2boBrFaIJMfS7I1GLJecg1ap/fGTBsdmncQ4cEKnxpUAtGzLcsqukr9qkTYKeXP5imGvrm077A1mXwbPTKP1st5zmtZduRayIfOWvWtwhrfm1CrTpUzhu+XZsAn5sTO/Dk2QWnTiuNzAgMBAAE=",
"Addresses": [
"/ip6/::1/tcp/4001"
],
"AgentVersion": "go-ipfs/0.4.17/",
"ProtocolVersion": "ipfs/0.1.0"
}
Got only IPv6 loopback address and no public one.
Now ping the node using ipfs ping:
Query:
root@tux:~# ipfs ping -n 4 QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
Response:
PING QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV.
Pong received: time=8.28 ms
Pong received: time=5.98 ms
Pong received: time=6.27 ms
Pong received: time=6.20 ms
Average latency: 6.68ms
How can it be up without an IP address? How to get the IP addresses of such nodes?
Upvotes: 1
Views: 845
Reputation: 2016
Rather than doing ipfs id <PeerID>
you can ask the DHT of how it sees the peer by doing ipfs dht findpeer <PeerID>
. In the case of QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
I see the following:
$ ipfs dht findpeer QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
/ip4/192.168.10.11/tcp/4001
/ip4/127.0.0.1/tcp/4001
/ip6/::1/tcp/4001
/ip4/83.162.192.96/tcp/31885
/ip4/83.162.192.96/tcp/16803
If there is a case you want to see how you are connected to the peer, you can use ipfs swarm peers
(peer you are currently connected to) together with grep
(filtering output)
$ ipfs swarm peers | grep QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
/ipfs/QmZSe5GZJb5jcKQZzQmdWaFtimTHafjvtxyMMTJy5nZ6hN/p2p-circuit/ipfs/QmRBRUCPY8saqzsLRyHexza3qUL8Wn9Zt59TcLMNnXF6zV
Upvotes: 1