mirror of https://github.com/vacp2p/nim-libp2p.git
default `MultiAddress` param for `newStandardSwitch` does not raise (#1056)
This commit is contained in:
parent
ae13a0d583
commit
6c43ab3fce
|
@ -291,23 +291,24 @@ proc build*(b: SwitchBuilder): Switch
|
||||||
return switch
|
return switch
|
||||||
|
|
||||||
proc newStandardSwitch*(
|
proc newStandardSwitch*(
|
||||||
privKey = none(PrivateKey),
|
privKey = none(PrivateKey),
|
||||||
addrs: MultiAddress | seq[MultiAddress] = MultiAddress.init("/ip4/127.0.0.1/tcp/0").tryGet(),
|
addrs: MultiAddress | seq[MultiAddress] =
|
||||||
secureManagers: openArray[SecureProtocol] = [
|
MultiAddress.init("/ip4/127.0.0.1/tcp/0").expect("valid address"),
|
||||||
|
secureManagers: openArray[SecureProtocol] = [
|
||||||
SecureProtocol.Noise,
|
SecureProtocol.Noise,
|
||||||
],
|
],
|
||||||
transportFlags: set[ServerFlags] = {},
|
transportFlags: set[ServerFlags] = {},
|
||||||
rng = newRng(),
|
rng = newRng(),
|
||||||
inTimeout: Duration = 5.minutes,
|
inTimeout: Duration = 5.minutes,
|
||||||
outTimeout: Duration = 5.minutes,
|
outTimeout: Duration = 5.minutes,
|
||||||
maxConnections = MaxConnections,
|
maxConnections = MaxConnections,
|
||||||
maxIn = -1,
|
maxIn = -1,
|
||||||
maxOut = -1,
|
maxOut = -1,
|
||||||
maxConnsPerPeer = MaxConnectionsPerPeer,
|
maxConnsPerPeer = MaxConnectionsPerPeer,
|
||||||
nameResolver: NameResolver = nil,
|
nameResolver: NameResolver = nil,
|
||||||
sendSignedPeerRecord = false,
|
sendSignedPeerRecord = false,
|
||||||
peerStoreCapacity = 1000): Switch
|
peerStoreCapacity = 1000
|
||||||
{.raises: [LPError], public.} =
|
): Switch {.raises: [LPError], public.} =
|
||||||
## Helper for common switch configurations.
|
## Helper for common switch configurations.
|
||||||
{.push warning[Deprecated]:off.}
|
{.push warning[Deprecated]:off.}
|
||||||
if SecureProtocol.Secio in secureManagers:
|
if SecureProtocol.Secio in secureManagers:
|
||||||
|
|
Loading…
Reference in New Issue