Skip to content

Commit

Permalink
chore: Integrate the cluster ID and shards into the Waku node
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya committed Jun 14, 2024
1 parent a81f296 commit 942ffa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/wakucanary/wakucanary.nim
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} =

var enrBuilder = EnrBuilder.init(nodeKey)

let relayShards = RelayShards.init(conf.clusterId, conf.shards)
if relayShards.isok():
enrBuilder.withWakuRelaySharding(relayShards.get()).isOkOr:
error "Building ENR with relay sharding failed", error = error
else:
error "Relay shards initialization failed", error = relayShards.error

let recordRes = enrBuilder.build()
let record =
if recordRes.isErr():
Expand All @@ -229,6 +236,8 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} =
)

let node = builder.build().tryGet()
node.mountMetadata(conf.clusterId).isOkOr:
error "failed to mount waku metadata protocol: ", err = error

if conf.ping:
try:
Expand Down

0 comments on commit 942ffa9

Please sign in to comment.