diff --git a/codex/codex.nim b/codex/codex.nim index f5ab684f..8ecdd178 100644 --- a/codex/codex.nim +++ b/codex/codex.nim @@ -159,7 +159,7 @@ proc start*(s: CodexServer) {.async.} = await s.codexNode.switch.start() - let (announceAddrs,discoveryAddrs)= natedAddress( + let (announceAddrs,discoveryAddrs)= nattedAddress( s.config.nat, s.codexNode.switch.peerInfo.addrs, s.config.discoveryPort) diff --git a/codex/conf.nim b/codex/conf.nim index 54d6dff3..aebbe444 100644 --- a/codex/conf.nim +++ b/codex/conf.nim @@ -40,7 +40,7 @@ import ./utils import ./nat from ./validationconfig import MaxSlots, ValidationGroups -export units, net, codextypes, logutils,completeCmdArg,parseCmdArg,NatConfig +export units, net, codextypes, logutils, completeCmdArg, parseCmdArg, NatConfig export ValidationGroups, MaxSlots export diff --git a/codex/nat.nim b/codex/nat.nim index 317f3546..e9ec0fc8 100644 --- a/codex/nat.nim +++ b/codex/nat.nim @@ -386,7 +386,7 @@ proc setupAddress*(natConfig: NatConfig, bindIp: ValidIpAddress, of NatStrategy.NatUpnp, NatStrategy.NatPmp: return setupNat(natConfig.nat, tcpPort, udpPort, clientId) -proc natedAddress*(natConfig: NatConfig, addrs: seq[MultiAddress], udpPort: Port): tuple[libp2p, discovery: seq[MultiAddress]] = +proc nattedAddress*(natConfig: NatConfig, addrs: seq[MultiAddress], udpPort: Port): tuple[libp2p, discovery: seq[MultiAddress]] = ## Takes a NAT configuration, sequence of multiaddresses and UDP port and returns: ## - Modified multiaddresses with NAT-mapped addresses for libp2p ## - Discovery addresses with NAT-mapped UDP ports diff --git a/codex/utils/addrutils.nim b/codex/utils/addrutils.nim index 3ceda666..4d0bc845 100644 --- a/codex/utils/addrutils.nim +++ b/codex/utils/addrutils.nim @@ -51,13 +51,8 @@ proc getMultiAddrWithIPAndUDPPort*(ip: ValidIpAddress, port: Port): MultiAddress ## Returns: ## A MultiAddress in the format "/ip4/
/udp/