ipfs-shipyard / py-ipfs-http-client

A python client library for the IPFS API
MIT License
682 stars 201 forks source link

swarm.connect() ipfshttpclient.exceptions.ErrorResponse: failed to parse multiaddr "": empty multiaddr #292

Open avatar-lavventura opened 3 years ago

avatar-lavventura commented 3 years ago

When I try to connect into a ipfs node I keep having following error: *** ipfshttpclient.exceptions.ErrorResponse: failed to parse multiaddr "": empty multiaddr

$ client.swarm.connect("/ip4/10.132.0.4/tcp/4001/p2p/12D...c8N")
*** ipfshttpclient.exceptions.ErrorResponse: failed to parse multiaddr "": empty multiaddr

What may be the main cause of this error? How can I resolve it?

v-stickykeys commented 3 years ago

You don't want swarm connect here. Your client should be connecting via http. Swarm is for peers.

What you want is something like /ip4/127.0.0.1/tcp/5001/http

avatar-lavventura commented 3 years ago

I want to connect into peers though. Shouldn't be correct way to do it?

from ipfs's README:

DESCRIPTION

  'ipfs swarm connect' opens a new direct connection to a peer address.
  The address format is an IPFS multiaddr:
  ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ