mirror of https://github.com/waku-org/nwaku.git
fix: Set `record` to the Waku Node Builder in the examples as it is required (#2328)
This commit is contained in:
parent
7b4f4bb18c
commit
42ede93b25
|
@ -43,8 +43,18 @@ proc setupAndPublish(rng: ref HmacDrbgContext) {.async.} =
|
|||
ip = parseIpAddress("0.0.0.0")
|
||||
flags = CapabilitiesBitfield.init(lightpush = false, filter = false, store = false, relay = true)
|
||||
|
||||
var enrBuilder = EnrBuilder.init(nodeKey)
|
||||
|
||||
let recordRes = enrBuilder.build()
|
||||
let record =
|
||||
if recordRes.isErr():
|
||||
error "failed to create enr record", error=recordRes.error
|
||||
quit(QuitFailure)
|
||||
else: recordRes.get()
|
||||
|
||||
var builder = WakuNodeBuilder.init()
|
||||
builder.withNodeKey(nodeKey)
|
||||
builder.withRecord(record)
|
||||
builder.withNetworkConfigurationDetails(ip, Port(wakuPort)).tryGet()
|
||||
let node = builder.build().tryGet()
|
||||
|
||||
|
|
|
@ -38,8 +38,18 @@ proc setupAndSubscribe(rng: ref HmacDrbgContext) {.async.} =
|
|||
ip = parseIpAddress("0.0.0.0")
|
||||
flags = CapabilitiesBitfield.init(lightpush = false, filter = false, store = false, relay = true)
|
||||
|
||||
var enrBuilder = EnrBuilder.init(nodeKey)
|
||||
|
||||
let recordRes = enrBuilder.build()
|
||||
let record =
|
||||
if recordRes.isErr():
|
||||
error "failed to create enr record", error=recordRes.error
|
||||
quit(QuitFailure)
|
||||
else: recordRes.get()
|
||||
|
||||
var builder = WakuNodeBuilder.init()
|
||||
builder.withNodeKey(nodeKey)
|
||||
builder.withRecord(record)
|
||||
builder.withNetworkConfigurationDetails(ip, Port(wakuPort)).tryGet()
|
||||
let node = builder.build().tryGet()
|
||||
|
||||
|
|
Loading…
Reference in New Issue