Skip to content

Commit

Permalink
Merge branch 'master' into gossipsub-version
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos authored Jun 10, 2024
2 parents 4e7a22e + d0af3fb commit 42481b7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libp2p.nimble
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode = ScriptMode.Verbose

packageName = "libp2p"
version = "1.1.0"
version = "1.3.0"
author = "Status Research & Development GmbH"
description = "LibP2P implementation"
license = "MIT"
Expand Down
6 changes: 2 additions & 4 deletions libp2p/switch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,11 @@ proc start*(s: Switch) {.async, public.} =
s.acceptFuts.add(s.accept(t))
s.peerInfo.listenAddrs &= t.addrs

await s.peerInfo.update()

await s.ms.start()

for service in s.services:
discard await service.setup(s)

await s.peerInfo.update()
await s.ms.start()
s.started = true

debug "Started libp2p node", peer = s.peerInfo
Expand Down
5 changes: 3 additions & 2 deletions tests/hole-punching-interop/hole_punching.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import std/[os, options, strformat]
import std/[os, options, strformat, sequtils]
import redis
import chronos, chronicles
import ../../libp2p/[builders,
switch,
multicodec,
observedaddrmanager,
services/hpservice,
services/autorelayservice,
Expand Down Expand Up @@ -76,7 +77,7 @@ proc main() {.async.} =
debug "Connected to relay", relayId

# Wait for our relay address to be published
while switch.peerInfo.addrs.len == 0:
while not switch.peerInfo.addrs.anyIt(it.contains(multiCodec("p2p-circuit")).tryGet()):
await sleepAsync(100.milliseconds)

if isListener:
Expand Down
2 changes: 1 addition & 1 deletion tests/testautonatservice.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import stubs/autonatclientstub
proc createSwitch(autonatSvc: Service = nil, withAutonat = true, maxConnsPerPeer = 1, maxConns = 100, nameResolver: NameResolver = nil): Switch =
var builder = SwitchBuilder.new()
.withRng(newRng())
.withAddresses(@[ MultiAddress.init("/ip4/0.0.0.0/tcp/0").tryGet() ])
.withAddresses(@[ MultiAddress.init("/ip4/0.0.0.0/tcp/0").tryGet() ], false)
.withTcpTransport()
.withMaxConnsPerPeer(maxConnsPerPeer)
.withMaxConnections(maxConns)
Expand Down
2 changes: 1 addition & 1 deletion tests/testautorelay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ./helpers
proc createSwitch(r: Relay, autorelay: Service = nil): Switch =
var builder = SwitchBuilder.new()
.withRng(newRng())
.withAddresses(@[ MultiAddress.init("/ip4/0.0.0.0/tcp/0").tryGet() ])
.withAddresses(@[ MultiAddress.init("/ip4/0.0.0.0/tcp/0").tryGet() ], false)
.withTcpTransport()
.withMplex()
.withNoise()
Expand Down

0 comments on commit 42481b7

Please sign in to comment.