code: func (h *BasicHost) Connect(ctx context.Context, pi pstore.PeerInfo) error {
  	// absorb addresses into peerstore
  	h.Peerstore().AddAddrs(pi.ID, pi.Addrs, pstore.TempAddrTTL)
  
  	if h.Network().Connectedness(pi.ID) == inet.Connected {
  		return nil
  	}
  
  	resolved, err := h.resolveAddrs(ctx, h.Peerstore().PeerInfo(pi.ID))
  	if err != nil {
  		return err
  	}
  	h.Peerstore().AddAddrs(pi.ID, resolved, pstore.TempAddrTTL)
  
  	return h.dialPeer(ctx, pi.ID)
  }
docs: // Connect ensures there is a connection between this host and the peer with
  // given peer.ID. If there is not an active connection, Connect will issue a
  // h.Network.Dial, and block until a connection is open, or an error is returned.
  // Connect will absorb the addresses in pi into its internal peerstore.
  // It will also resolve any /dns4, /dns6, and /dnsaddr addresses.