Move relay & autonat to connectivity folder (#769)
This commit is contained in:
parent
72abe822c0
commit
5e7e009445
|
@ -1,6 +1,6 @@
|
||||||
import chronos, stew/byteutils
|
import chronos, stew/byteutils
|
||||||
import ../libp2p,
|
import ../libp2p,
|
||||||
../libp2p/protocols/relay/[relay, client]
|
../libp2p/protocols/connectivity/relay/[relay, client]
|
||||||
|
|
||||||
# Helper to create a circuit relay node
|
# Helper to create a circuit relay node
|
||||||
proc createCircuitRelaySwitch(r: Relay): Switch =
|
proc createCircuitRelaySwitch(r: Relay): Switch =
|
||||||
|
|
|
@ -26,8 +26,8 @@ import
|
||||||
switch, peerid, peerinfo, stream/connection, multiaddress,
|
switch, peerid, peerinfo, stream/connection, multiaddress,
|
||||||
crypto/crypto, transports/[transport, tcptransport],
|
crypto/crypto, transports/[transport, tcptransport],
|
||||||
muxers/[muxer, mplex/mplex, yamux/yamux],
|
muxers/[muxer, mplex/mplex, yamux/yamux],
|
||||||
protocols/[identify, secure/secure, secure/noise, autonat],
|
protocols/[identify, secure/secure, secure/noise],
|
||||||
protocols/relay/[relay, client, rtransport],
|
protocols/connectivity/[autonat, relay/relay, relay/client, relay/rtransport],
|
||||||
connmanager, upgrademngrs/muxedupgrade,
|
connmanager, upgrademngrs/muxedupgrade,
|
||||||
nameresolving/nameresolver,
|
nameresolving/nameresolver,
|
||||||
errors, utility
|
errors, utility
|
||||||
|
|
|
@ -14,13 +14,13 @@ else:
|
||||||
|
|
||||||
import std/[options, sets, sequtils]
|
import std/[options, sets, sequtils]
|
||||||
import chronos, chronicles, stew/objects
|
import chronos, chronicles, stew/objects
|
||||||
import ./protocol,
|
import ../protocol,
|
||||||
../switch,
|
../../switch,
|
||||||
../multiaddress,
|
../../multiaddress,
|
||||||
../multicodec,
|
../../multicodec,
|
||||||
../peerid,
|
../../peerid,
|
||||||
../utils/semaphore,
|
../../utils/semaphore,
|
||||||
../errors
|
../../errors
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "libp2p autonat"
|
topics = "libp2p autonat"
|
|
@ -20,10 +20,10 @@ import ./relay,
|
||||||
./messages,
|
./messages,
|
||||||
./rconn,
|
./rconn,
|
||||||
./utils,
|
./utils,
|
||||||
../../peerinfo,
|
../../../peerinfo,
|
||||||
../../switch,
|
../../../switch,
|
||||||
../../multiaddress,
|
../../../multiaddress,
|
||||||
../../stream/connection
|
../../../stream/connection
|
||||||
|
|
||||||
|
|
||||||
logScope:
|
logScope:
|
|
@ -14,8 +14,8 @@ else:
|
||||||
|
|
||||||
import options, macros, sequtils
|
import options, macros, sequtils
|
||||||
import stew/objects
|
import stew/objects
|
||||||
import ../../peerinfo,
|
import ../../../peerinfo,
|
||||||
../../signed_envelope
|
../../../signed_envelope
|
||||||
|
|
||||||
# Circuit Relay V1 Message
|
# Circuit Relay V1 Message
|
||||||
|
|
|
@ -14,7 +14,7 @@ else:
|
||||||
|
|
||||||
import chronos
|
import chronos
|
||||||
|
|
||||||
import ../../stream/connection
|
import ../../../stream/connection
|
||||||
|
|
||||||
type
|
type
|
||||||
RelayConnection* = ref object of Connection
|
RelayConnection* = ref object of Connection
|
|
@ -19,16 +19,16 @@ import chronos, chronicles
|
||||||
import ./messages,
|
import ./messages,
|
||||||
./rconn,
|
./rconn,
|
||||||
./utils,
|
./utils,
|
||||||
../../peerinfo,
|
../../../peerinfo,
|
||||||
../../switch,
|
../../../switch,
|
||||||
../../multiaddress,
|
../../../multiaddress,
|
||||||
../../multicodec,
|
../../../multicodec,
|
||||||
../../stream/connection,
|
../../../stream/connection,
|
||||||
../../protocols/protocol,
|
../../../protocols/protocol,
|
||||||
../../transports/transport,
|
../../../transports/transport,
|
||||||
../../errors,
|
../../../errors,
|
||||||
../../utils/heartbeat,
|
../../../utils/heartbeat,
|
||||||
../../signed_envelope
|
../../../signed_envelope
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# * Eventually replace std/times by chronos/timer. Currently chronos/timer
|
# * Eventually replace std/times by chronos/timer. Currently chronos/timer
|
|
@ -19,9 +19,9 @@ import chronos, chronicles
|
||||||
import ./client,
|
import ./client,
|
||||||
./rconn,
|
./rconn,
|
||||||
./utils,
|
./utils,
|
||||||
../../switch,
|
../../../switch,
|
||||||
../../stream/connection,
|
../../../stream/connection,
|
||||||
../../transports/transport
|
../../../transports/transport
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "libp2p relay relay-transport"
|
topics = "libp2p relay relay-transport"
|
|
@ -17,7 +17,7 @@ import options
|
||||||
import chronos, chronicles
|
import chronos, chronicles
|
||||||
|
|
||||||
import ./messages,
|
import ./messages,
|
||||||
../../stream/connection
|
../../../stream/connection
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "libp2p relay relay-utils"
|
topics = "libp2p relay relay-utils"
|
|
@ -3,7 +3,7 @@ import chronos, chronicles, stew/byteutils
|
||||||
import helpers
|
import helpers
|
||||||
import ../libp2p
|
import ../libp2p
|
||||||
import ../libp2p/[daemon/daemonapi, varint, transports/wstransport, crypto/crypto]
|
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
|
type
|
||||||
SwitchCreator = proc(
|
SwitchCreator = proc(
|
||||||
|
|
|
@ -3,7 +3,7 @@ import chronos
|
||||||
import
|
import
|
||||||
../libp2p/[
|
../libp2p/[
|
||||||
builders,
|
builders,
|
||||||
protocols/autonat
|
protocols/connectivity/autonat
|
||||||
],
|
],
|
||||||
./helpers
|
./helpers
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import stublogger
|
||||||
|
|
||||||
import helpers, commoninterop
|
import helpers, commoninterop
|
||||||
import ../libp2p
|
import ../libp2p
|
||||||
import ../libp2p/crypto/crypto, ../libp2p/protocols/relay/[relay, client]
|
import ../libp2p/crypto/crypto, ../libp2p/protocols/connectivity/relay/[relay, client]
|
||||||
|
|
||||||
proc switchMplexCreator(
|
proc switchMplexCreator(
|
||||||
ma: MultiAddress = MultiAddress.init("/ip4/127.0.0.1/tcp/0").tryGet(),
|
ma: MultiAddress = MultiAddress.init("/ip4/127.0.0.1/tcp/0").tryGet(),
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
import options, bearssl, chronos
|
import options, bearssl, chronos
|
||||||
import stew/byteutils
|
import stew/byteutils
|
||||||
import ../libp2p/[protocols/relay/relay,
|
import ../libp2p/[protocols/connectivity/relay/relay,
|
||||||
protocols/relay/client,
|
protocols/connectivity/relay/client,
|
||||||
protocols/relay/messages,
|
protocols/connectivity/relay/messages,
|
||||||
protocols/relay/utils,
|
protocols/connectivity/relay/utils,
|
||||||
protocols/relay/rtransport,
|
protocols/connectivity/relay/rtransport,
|
||||||
multiaddress,
|
multiaddress,
|
||||||
peerinfo,
|
peerinfo,
|
||||||
peerid,
|
peerid,
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
import bearssl, chronos, options
|
import bearssl, chronos, options
|
||||||
import ../libp2p
|
import ../libp2p
|
||||||
import ../libp2p/[protocols/relay/relay,
|
import ../libp2p/[protocols/connectivity/relay/relay,
|
||||||
protocols/relay/messages,
|
protocols/connectivity/relay/messages,
|
||||||
protocols/relay/utils,
|
protocols/connectivity/relay/utils,
|
||||||
protocols/relay/client]
|
protocols/connectivity/relay/client]
|
||||||
import ./helpers
|
import ./helpers
|
||||||
import std/times
|
import std/times
|
||||||
import stew/byteutils
|
import stew/byteutils
|
||||||
|
|
Loading…
Reference in New Issue