Skip to content

Commit

Permalink
fix: no enr record in chat2 (#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Aug 15, 2023
1 parent d5d2243 commit fc604ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import
../../waku/waku_lightpush,
../../waku/waku_lightpush/rpc,
../../waku/waku_filter,
../../waku/waku_enr,
../../waku/waku_store,
../../waku/waku_dnsdisc,
../../waku/waku_node,
Expand Down Expand Up @@ -320,9 +321,19 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =

let (extIp, extTcpPort, extUdpPort) = natRes.get()

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()

let node = block:
var builder = WakuNodeBuilder.init()
builder.withNodeKey(nodeKey)
builder.withRecord(record)
builder.withNetworkConfigurationDetails(conf.listenAddress, Port(uint16(conf.tcpPort) + conf.portsShift),
extIp, extTcpPort,
wsBindPort = Port(uint16(conf.websocketPort) + conf.portsShift),
Expand Down

0 comments on commit fc604ca

Please sign in to comment.