libp2p / jvm-libp2p

a libp2p implementation for the JVM, written in Kotlin 🔥
https://libp2p.io
Apache License 2.0
260 stars 74 forks source link

Implement circuit relay v2 #345

Closed ianopolous closed 7 months ago

ianopolous commented 8 months ago

Specs: https://docs.libp2p.io/concepts/nat/circuit-relay/ https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md

Go source: https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/circuitv2/relay/relay.go

Fixes https://github.com/libp2p/jvm-libp2p/issues/344

Nashatyrev commented 8 months ago

Basically looks good to me! I didn't dive deeply into the circuit implementation code though I would be happy if you could add some (at least sanity) unit tests for protocol implementations and if possible add the RelayTransport test as a subclass of TransportTests

Could you also please add a 🍋 for the Circuit Relay component row on the main README.md 😄

ianopolous commented 8 months ago

It seems like the protobuf changes have broken a peerid test. It's not clear to me why yet.

ianopolous commented 8 months ago

I had a look at making RelayTransportTest a subclass of TransportTests, but it seems quite awkward, because it needs the Host in the transport via setHost and the host builder modifier. It would be nice to find a better solution to this that didn't need to use HostBuilder().builderModifier()

StefanBratanov commented 8 months ago

LGTM

@StefanBratanov may be you could give another review?

I am having a look.