mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-17 00:47:03 +00:00
Add Yamux experimental support (#5080)
This commit is contained in:
parent
8a853fc4e4
commit
11d18acfeb
@ -305,6 +305,12 @@ type
|
||||
defaultValue: false
|
||||
name: "enr-auto-update" .}: bool
|
||||
|
||||
enableYamux* {.
|
||||
hidden
|
||||
desc: "Enable the Yamux multiplexer"
|
||||
defaultValue: false
|
||||
name: "enable-yamux" .}: bool
|
||||
|
||||
weakSubjectivityCheckpoint* {.
|
||||
desc: "Weak subjectivity checkpoint in the format block_root:epoch_number"
|
||||
name: "weak-subjectivity-checkpoint" .}: Option[Checkpoint]
|
||||
|
@ -102,6 +102,12 @@ type LightClientConf* = object
|
||||
defaultValue: false
|
||||
name: "enr-auto-update" .}: bool
|
||||
|
||||
enableYamux* {.
|
||||
hidden
|
||||
desc: "Enable the Yamux multiplexer"
|
||||
defaultValue: false
|
||||
name: "enable-yamux" .}: bool
|
||||
|
||||
agentString* {.
|
||||
defaultValue: "nimbus",
|
||||
desc: "Node agent string which is used as identifier in network"
|
||||
|
@ -2271,8 +2271,14 @@ func gossipId(
|
||||
proc newBeaconSwitch(config: BeaconNodeConf | LightClientConf,
|
||||
seckey: PrivateKey, address: MultiAddress,
|
||||
rng: ref HmacDrbgContext): Switch {.raises: [Defect, CatchableError].} =
|
||||
SwitchBuilder
|
||||
.new()
|
||||
var sb =
|
||||
if config.enableYamux:
|
||||
SwitchBuilder.new().withYamux()
|
||||
else:
|
||||
SwitchBuilder.new()
|
||||
# Order of multiplexers matters, the first will be default
|
||||
|
||||
sb
|
||||
.withPrivateKey(seckey)
|
||||
.withAddress(address)
|
||||
.withRng(rng)
|
||||
|
Loading…
x
Reference in New Issue
Block a user