berty / go-orbit-db

Go version of P2P Database on IPFS
https://berty.tech
Apache License 2.0
403 stars 55 forks source link

oneonone/channel.go:74","msg":"unable to connect to remote peer" #107

Closed songxiang93 closed 1 year ago

songxiang93 commented 2 years ago

oneonone/channel.go 74 line

if err := c.ipfs.Swarm().Connect(ctx, peer.AddrInfo{ID: target}); err != nil {
        c.logger.Warn("unable to connect to remote peer", zap.String("peer", target.String()))
}

peer.AddrInfo has 2 params.Only one param cause "argument "address" is required' bug。

peletron commented 1 year ago

@ppt93 thanks for reporting of issue. We will take a look and get back to you as soon as possible.

gfanton commented 1 year ago

@ppt93 the only parameter required here is the ID, Addrs is optional.

Connect method will:

  1. add the given Addrs from AddrInfo (if provided) to the Peerstore
  2. retrieve all Addrs from the Peerstore
  3. if no Addrs is found it will try to run a find peers with the given discovery service (on a routed host only)
  4. use those Addrs to connect

At this point, the pubsub discovery mechanism should already have added all the necessary Addrs in the PeerStore to successfully connect.

songxiang93 commented 1 year ago

@gfanton I understand what you mean. That's right

peletron commented 1 year ago

@gfanton Thanks for follow up. Hope this helps @ppt93 :)

Closing this issue