I’m trying to make a connection to a peer and then disconnect it, but I get:
disconnect QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy failure: conn not found
Steps:
Connect to peer
ipfs swarm connect /p2p-circuit/ipfs/QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy
success!
ipfs swarm disconnect /p2p-circuit/ipfs/QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy
Get:
disconnect QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy failure: conn not found
Also I tried with variants of /ip4/IP/tcp/4001/ipfs/QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy
but I got the same error
Any insight?
1 Like
root@fe0299e8b4c7:/uploader# ipfs --version
ipfs version 0.4.14
root@fe0299e8b4c7:/uploader# ipfs swarm connect /p2p-circuiyWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy
connect QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy success
root@fe0299e8b4c7:/uploader# ipfs swarm disconnect /p2p-cirdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy
disconnect QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy failure: conn not found
That doesn’t help.
If I run
ipfs swarm addrs
I can see the peerId like
QmUZ7t5hVXMdt2yWAPkDVBuSPuGc8uNNzSzNWDoZ1i5eLy (4)
ip4/....
ip4/....
ip4/....
ip4/....
I don’t know why it works like this, but if you grab the full peer ID connection for the connection from ipfs swarm peers
then use that with ipfs swarm disconnect
it works as expected.
For example:
$ ipfs swarm connect /p2p-circuit/ipfs/QmSF2YVkh7PsWUG15QXbr6QeWaeVdaEVL3FjC8mFN9vwkZ
connect QmSF2YVkh7PsWUG15QXbr6QeWaeVdaEVL3FjC8mFN9vwkZ success
$ ipfs swarm peers | grep wkZ
/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVDKNAd/p2p-circuit/ipfs/QmSF2ZVkh7PsWUG15QXbr6QeWaeVdaEVL3FjC8mFN9vwkZ
$ ipfs swarm disconnect /ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVDKNAd/p2p-circuit/ipfs/QmSF2YVkh7PsWUG15QXbr6QeWaeVdaEVL3FjC8mFN9vwkZ
disconnect QmSF2YVkh7PsWUG15QXbr6QeWaeVdaEVL3FjC8mFN9vwkZ success
leerspace:
ipfs swarm peers |
wow, it seems it creates another IP for the peer connection.
Thanks @leerspace
One single line command could be
ipfs swarm disconnect $(ipfs swarm peers | grep *peerID*)
In case anyone comes across this thread and is curious like I was, the connection to the p2p-circuit address happens through a relay. That’s where the stuff before the address that was specified in the ipfs swarm connect
command comes from.
This is documented in more detail here:
# Experimental features of go-ipfs
This document contains a list of experimental features in go-ipfs.
These features, commands, and APIs aren't mature, and you shouldn't rely on them.
Once they reach maturity, there's going to be mention in the changelog and
release posts. If they don't reach maturity, the same applies, and their code is
removed.
Subscribe to https://github.com/ipfs/go-ipfs/issues/3397 to get updates.
When you add a new experimental feature to go-ipfs, or change an experimental
feature, you MUST please make a PR updating this document, and link the PR in
the above issue.
- [ipfs pubsub](#ipfs-pubsub)
- [Client mode DHT routing](#client-mode-dht-routing)
- [go-multiplex stream muxer](#go-multiplex-stream-muxer)
- [Raw leaves for unixfs files](#raw-leaves-for-unixfs-files)
- [ipfs filestore](#ipfs-filestore)
- [ipfs urlstore](#ipfs-urlstore)
This file has been truncated. show original
1 Like