ipfs / js-kubo-rpc-client

A client library for the Kubo RPC API
https://www.npmjs.com/package/kubo-rpc-client
Other
35 stars 7 forks source link

swarm.connect not happy with PeerId argument #230

Open Hugo-Trentesaux opened 6 months ago

Hugo-Trentesaux commented 6 months ago

The swarm.connect function should take an argument multiaddrOrPeerId that can be Multiaddr | PeerId. However, it complains when receiving a PeerId: HTTPError: failed to parse multiaddr "12D3KooWBusr11HGqzKu6C789vFWibV4DoTBiwZi7N5Gtkepsp9v": must begin with /.

I guess the problem comes from the createConnect function which is missing conversion from peerid to multiaddr.