diff --git a/examples/circuitrelay.nim b/examples/circuitrelay.nim index 290c47399..b7c66d2ed 100644 --- a/examples/circuitrelay.nim +++ b/examples/circuitrelay.nim @@ -1,6 +1,6 @@ import chronos, stew/byteutils import ../libp2p, - ../libp2p/protocols/relay/[relay, client] + ../libp2p/protocols/connectivity/relay/[relay, client] # Helper to create a circuit relay node proc createCircuitRelaySwitch(r: Relay): Switch = diff --git a/libp2p/builders.nim b/libp2p/builders.nim index 828fc5283..5d111b2ee 100644 --- a/libp2p/builders.nim +++ b/libp2p/builders.nim @@ -26,8 +26,8 @@ import switch, peerid, peerinfo, stream/connection, multiaddress, crypto/crypto, transports/[transport, tcptransport], muxers/[muxer, mplex/mplex, yamux/yamux], - protocols/[identify, secure/secure, secure/noise, autonat], - protocols/relay/[relay, client, rtransport], + protocols/[identify, secure/secure, secure/noise], + protocols/connectivity/[autonat, relay/relay, relay/client, relay/rtransport], connmanager, upgrademngrs/muxedupgrade, nameresolving/nameresolver, errors, utility diff --git a/libp2p/protocols/autonat.nim b/libp2p/protocols/connectivity/autonat.nim similarity index 98% rename from libp2p/protocols/autonat.nim rename to libp2p/protocols/connectivity/autonat.nim index bdee79990..4f7fb53eb 100644 --- a/libp2p/protocols/autonat.nim +++ b/libp2p/protocols/connectivity/autonat.nim @@ -14,13 +14,13 @@ else: import std/[options, sets, sequtils] import chronos, chronicles, stew/objects -import ./protocol, - ../switch, - ../multiaddress, - ../multicodec, - ../peerid, - ../utils/semaphore, - ../errors +import ../protocol, + ../../switch, + ../../multiaddress, + ../../multicodec, + ../../peerid, + ../../utils/semaphore, + ../../errors logScope: topics = "libp2p autonat" diff --git a/libp2p/protocols/relay/client.nim b/libp2p/protocols/connectivity/relay/client.nim similarity index 98% rename from libp2p/protocols/relay/client.nim rename to libp2p/protocols/connectivity/relay/client.nim index 8f03881ae..b12a728dc 100644 --- a/libp2p/protocols/relay/client.nim +++ b/libp2p/protocols/connectivity/relay/client.nim @@ -20,10 +20,10 @@ import ./relay, ./messages, ./rconn, ./utils, - ../../peerinfo, - ../../switch, - ../../multiaddress, - ../../stream/connection + ../../../peerinfo, + ../../../switch, + ../../../multiaddress, + ../../../stream/connection logScope: diff --git a/libp2p/protocols/relay/messages.nim b/libp2p/protocols/connectivity/relay/messages.nim similarity index 99% rename from libp2p/protocols/relay/messages.nim rename to libp2p/protocols/connectivity/relay/messages.nim index 62e2aaa0f..862d3d993 100644 --- a/libp2p/protocols/relay/messages.nim +++ b/libp2p/protocols/connectivity/relay/messages.nim @@ -14,8 +14,8 @@ else: import options, macros, sequtils import stew/objects -import ../../peerinfo, - ../../signed_envelope +import ../../../peerinfo, + ../../../signed_envelope # Circuit Relay V1 Message diff --git a/libp2p/protocols/relay/rconn.nim b/libp2p/protocols/connectivity/relay/rconn.nim similarity index 98% rename from libp2p/protocols/relay/rconn.nim rename to libp2p/protocols/connectivity/relay/rconn.nim index 44dbb1445..f355fd8a9 100644 --- a/libp2p/protocols/relay/rconn.nim +++ b/libp2p/protocols/connectivity/relay/rconn.nim @@ -14,7 +14,7 @@ else: import chronos -import ../../stream/connection +import ../../../stream/connection type RelayConnection* = ref object of Connection diff --git a/libp2p/protocols/relay/relay.nim b/libp2p/protocols/connectivity/relay/relay.nim similarity index 97% rename from libp2p/protocols/relay/relay.nim rename to libp2p/protocols/connectivity/relay/relay.nim index 10288eb34..a19f4c6a4 100644 --- a/libp2p/protocols/relay/relay.nim +++ b/libp2p/protocols/connectivity/relay/relay.nim @@ -19,16 +19,16 @@ import chronos, chronicles import ./messages, ./rconn, ./utils, - ../../peerinfo, - ../../switch, - ../../multiaddress, - ../../multicodec, - ../../stream/connection, - ../../protocols/protocol, - ../../transports/transport, - ../../errors, - ../../utils/heartbeat, - ../../signed_envelope + ../../../peerinfo, + ../../../switch, + ../../../multiaddress, + ../../../multicodec, + ../../../stream/connection, + ../../../protocols/protocol, + ../../../transports/transport, + ../../../errors, + ../../../utils/heartbeat, + ../../../signed_envelope # TODO: # * Eventually replace std/times by chronos/timer. Currently chronos/timer diff --git a/libp2p/protocols/relay/rtransport.nim b/libp2p/protocols/connectivity/relay/rtransport.nim similarity index 97% rename from libp2p/protocols/relay/rtransport.nim rename to libp2p/protocols/connectivity/relay/rtransport.nim index d84f43355..011f682db 100644 --- a/libp2p/protocols/relay/rtransport.nim +++ b/libp2p/protocols/connectivity/relay/rtransport.nim @@ -19,9 +19,9 @@ import chronos, chronicles import ./client, ./rconn, ./utils, - ../../switch, - ../../stream/connection, - ../../transports/transport + ../../../switch, + ../../../stream/connection, + ../../../transports/transport logScope: topics = "libp2p relay relay-transport" diff --git a/libp2p/protocols/relay/utils.nim b/libp2p/protocols/connectivity/relay/utils.nim similarity index 98% rename from libp2p/protocols/relay/utils.nim rename to libp2p/protocols/connectivity/relay/utils.nim index efa9744ba..c5449aaa3 100644 --- a/libp2p/protocols/relay/utils.nim +++ b/libp2p/protocols/connectivity/relay/utils.nim @@ -17,7 +17,7 @@ import options import chronos, chronicles import ./messages, - ../../stream/connection + ../../../stream/connection logScope: topics = "libp2p relay relay-utils" diff --git a/tests/commoninterop.nim b/tests/commoninterop.nim index c2850706d..c8fd12bff 100644 --- a/tests/commoninterop.nim +++ b/tests/commoninterop.nim @@ -3,7 +3,7 @@ import chronos, chronicles, stew/byteutils import helpers import ../libp2p import ../libp2p/[daemon/daemonapi, varint, transports/wstransport, crypto/crypto] -import ../libp2p/protocols/relay/[relay, client, utils] +import ../libp2p/protocols/connectivity/relay/[relay, client, utils] type SwitchCreator = proc( diff --git a/tests/testautonat.nim b/tests/testautonat.nim index 8d523fae4..ce44b581a 100644 --- a/tests/testautonat.nim +++ b/tests/testautonat.nim @@ -3,7 +3,7 @@ import chronos import ../libp2p/[ builders, - protocols/autonat + protocols/connectivity/autonat ], ./helpers diff --git a/tests/testinterop.nim b/tests/testinterop.nim index 5cbd53d5a..8c9f7110d 100644 --- a/tests/testinterop.nim +++ b/tests/testinterop.nim @@ -2,7 +2,7 @@ import stublogger import helpers, commoninterop import ../libp2p -import ../libp2p/crypto/crypto, ../libp2p/protocols/relay/[relay, client] +import ../libp2p/crypto/crypto, ../libp2p/protocols/connectivity/relay/[relay, client] proc switchMplexCreator( ma: MultiAddress = MultiAddress.init("/ip4/127.0.0.1/tcp/0").tryGet(), diff --git a/tests/testrelayv1.nim b/tests/testrelayv1.nim index 17206be5c..5595af31d 100644 --- a/tests/testrelayv1.nim +++ b/tests/testrelayv1.nim @@ -2,11 +2,11 @@ import options, bearssl, chronos import stew/byteutils -import ../libp2p/[protocols/relay/relay, - protocols/relay/client, - protocols/relay/messages, - protocols/relay/utils, - protocols/relay/rtransport, +import ../libp2p/[protocols/connectivity/relay/relay, + protocols/connectivity/relay/client, + protocols/connectivity/relay/messages, + protocols/connectivity/relay/utils, + protocols/connectivity/relay/rtransport, multiaddress, peerinfo, peerid, diff --git a/tests/testrelayv2.nim b/tests/testrelayv2.nim index 5ce1f640a..8565b36d9 100644 --- a/tests/testrelayv2.nim +++ b/tests/testrelayv2.nim @@ -2,10 +2,10 @@ import bearssl, chronos, options import ../libp2p -import ../libp2p/[protocols/relay/relay, - protocols/relay/messages, - protocols/relay/utils, - protocols/relay/client] +import ../libp2p/[protocols/connectivity/relay/relay, + protocols/connectivity/relay/messages, + protocols/connectivity/relay/utils, + protocols/connectivity/relay/client] import ./helpers import std/times import stew/byteutils