mirror of https://github.com/waku-org/nwaku.git
refactor of internal_config to avoid passing a 'WakuNodeConf' item (#1832)
This change is needed so that the `libwaku.nim` code gets simpler. The `libwaku.nim` can't import the 'WakuNodeConf' type because this is related to the wakunode2 app, and the library shouldn't know about it.
This commit is contained in:
parent
88b7481f29
commit
96aa59ba58
|
@ -113,7 +113,7 @@ proc init*(T: type App, rng: ref HmacDrbgContext, conf: WakuNodeConf): T =
|
||||||
quit(QuitFailure)
|
quit(QuitFailure)
|
||||||
else: netConfigRes.get()
|
else: netConfigRes.get()
|
||||||
|
|
||||||
let recordRes = createRecord(conf, netConfig, key)
|
let recordRes = createRecord(conf.topics, netConfig, key)
|
||||||
let record =
|
let record =
|
||||||
if recordRes.isErr():
|
if recordRes.isErr():
|
||||||
error "failed to create record", error=recordRes.error
|
error "failed to create record", error=recordRes.error
|
||||||
|
|
|
@ -72,8 +72,11 @@ proc networkConfiguration*(conf: WakuNodeConf): NetConfigResult =
|
||||||
|
|
||||||
netConfigRes
|
netConfigRes
|
||||||
|
|
||||||
proc createRecord*(conf: WakuNodeConf, netConf: NetConfig, key: crypto.PrivateKey): Result[enr.Record, string] =
|
proc createRecord*(topics: seq[string],
|
||||||
let relayShardsRes = topicsToRelayShards(conf.topics)
|
netConf: NetConfig,
|
||||||
|
key: crypto.PrivateKey):
|
||||||
|
Result[enr.Record, string] =
|
||||||
|
let relayShardsRes = topicsToRelayShards(topics)
|
||||||
|
|
||||||
let relayShardOp =
|
let relayShardOp =
|
||||||
if relayShardsRes.isErr():
|
if relayShardsRes.isErr():
|
||||||
|
|
Loading…
Reference in New Issue