mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 00:46:44 +00:00
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)
|
||||
else: netConfigRes.get()
|
||||
|
||||
let recordRes = createRecord(conf, netConfig, key)
|
||||
let recordRes = createRecord(conf.topics, netConfig, key)
|
||||
let record =
|
||||
if recordRes.isErr():
|
||||
error "failed to create record", error=recordRes.error
|
||||
|
@ -72,8 +72,11 @@ proc networkConfiguration*(conf: WakuNodeConf): NetConfigResult =
|
||||
|
||||
netConfigRes
|
||||
|
||||
proc createRecord*(conf: WakuNodeConf, netConf: NetConfig, key: crypto.PrivateKey): Result[enr.Record, string] =
|
||||
let relayShardsRes = topicsToRelayShards(conf.topics)
|
||||
proc createRecord*(topics: seq[string],
|
||||
netConf: NetConfig,
|
||||
key: crypto.PrivateKey):
|
||||
Result[enr.Record, string] =
|
||||
let relayShardsRes = topicsToRelayShards(topics)
|
||||
|
||||
let relayShardOp =
|
||||
if relayShardsRes.isErr():
|
||||
|
Loading…
x
Reference in New Issue
Block a user