fix(wakunode2): move node config inside app init branch (#2423)

This commit is contained in:
Aaryamann Challani 2024-02-13 15:40:45 +05:30 committed by GitHub
parent 50308eda0d
commit 0dac9f9dd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 22 deletions

View File

@ -66,6 +66,22 @@ when isMainModule:
var conf = confRes.get()
## Logging setup
# Adhere to NO_COLOR initiative: https://no-color.org/
let color =
try:
not parseBool(os.getEnv("NO_COLOR", "false"))
except CatchableError:
true
logging.setupLogLevel(conf.logLevel)
logging.setupLogFormat(conf.logFormat, color)
case conf.cmd
of generateRlnKeystore:
doRlnKeystoreGenerator(conf)
of noCommand:
# The Waku Network config (cluster-id=1)
if conf.clusterId == 1:
let twnClusterConf = ClusterConf.TheWakuNetworkConf()
@ -85,26 +101,11 @@ when isMainModule:
conf.discv5BootstrapNodes =
conf.discv5BootstrapNodes & twnClusterConf.discv5BootstrapNodes
## Logging setup
# Adhere to NO_COLOR initiative: https://no-color.org/
let color =
try:
not parseBool(os.getEnv("NO_COLOR", "false"))
except CatchableError:
true
logging.setupLogLevel(conf.logLevel)
logging.setupLogFormat(conf.logFormat, color)
var wakunode2 = App.init(rng, conf)
info "Running nwaku node", version = app.git_version
logConfig(conf)
case conf.cmd
of generateRlnKeystore:
doRlnKeystoreGenerator(conf)
of noCommand:
var wakunode2 = App.init(rng, conf)
##############
# Node setup #