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