ChenXi

Results 13 comments of ChenXi

> You don't need to implemenent anything. If you run go-libp2p with EnableHolepunching option it'll hole punch when it can. > > If you can share more specific questions around...

> > > You don't need to implemenent anything. If you run go-libp2p with EnableHolepunching option it'll hole punch when it can. > > > If you can share more...

> For lack of something better you can look at Kubo's implementation: https://github.com/ipfs/kubo/blob/master/core/node/libp2p/relay.go Thanks you for the lead!❤️ I'll try to make it happen~

> You don't need to implemenent anything. If you run go-libp2p with EnableHolepunching option it'll hole punch when it can. > > If you can share more specific questions around...

> You don't need to implemenent anything. If you run go-libp2p with EnableHolepunching option it'll hole punch when it can. > > If you can share more specific questions around...

> Q1:我相当确定`EnableHolePunching`应该传递给希望连接的两个节点,中继上不需要它。 > > Q2.1:您可以通过调用中继主机来找到多地址`host.Addrs()`​​,您可以使用通知或事件总线在添加中继地址时接收通知。 您共享的地址应该可以工作(但是它需要路由系统或中继地址的 OOB 知识),一般来说您可以`relayMaddr + "/p2p-circuit/p2p/" + peerid`这样做,例如`/ip4/1.2.3.4/udp/12345/quic-v1/p2p/RelayPeerid/p2p-circuit/p2p/DestinationPeerid` > > Q2.2:当您使用带有打洞功能的中继 v2 时,中继上不会发送流量,如果您使用的是最新版本,NewStream 将等待直到建立直接连接(您可以使用魔法咒语使其建立)中继连接上的流,但您可能不想这样做),如果您使用的是以前的版本,如果您在建立直接连接之前尝试使用它,NewStream 将出错。 > > 关于问题 1 的注意事项:您不需要自己编写地址,只需拿给`host.Addrs()`您的内容并按原样分享即可。 Thank you! And I wanna know...

> ```go > s, err := (*local.host).NewStream(a.ctx, info.ID, "/chat/1.0.0") > ``` > > 你有什么东西进来吗`err`? 如果它仍然卡住,您可以尝试此操作: > > ```go > ctx, cancel := context.WithTimeout(a.ctx, time.Second * 15) > defer cancel() >...

> How do you know no attempt to hole punch ? Does `NewStream` returns `nil` error ? Yes, the error is `nil`. And here is the result of `fmt.Println(s.Conn().RemoteMultiaddr())` `/ip4/106.15.180.40/tcp/55555/p2p/12D3KooWL6LJYwzmLj9Ny4WRYeYg6T58HrMPuhChNs8RfkQuCJhf/p2p-circuit`...

> What versions of go-libp2p are you using ? Both on relay and client are go-libp2p v0.32.1, and the package used in relay is `github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay` and `github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client` in client. Is...

Yes, my project is using the wails. So let me send the whole project for you. I am not familiar with the github operation so let me use the transfer...