Skip to content

Commit 78623a5

Browse files
committed
add mix pubkey in enr and fix lightpush rebase issues
1 parent 69c1079 commit 78623a5

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

waku/factory/internal_config.nim

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import
1111
../common/utils/nat,
1212
../node/config,
1313
../waku_enr/capabilities,
14+
../waku_enr/mix,
1415
../waku_enr,
1516
../waku_core
1617

@@ -33,6 +34,9 @@ proc enrConfiguration*(
3334
).isOkOr:
3435
return err("could not initialize ENR with shards")
3536

37+
if conf.mix and conf.mixKey.isSome():
38+
enrBuilder.withMixKey(conf.mixKey.get())
39+
3640
let recordRes = enrBuilder.build()
3741
let record =
3842
if recordRes.isErr():

waku/node/waku_node.nim

-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ proc mountMix*(node: WakuNode, mixPrivKey: string): Future[Result[void, string]]
272272
node.switch.mount(node.mix)
273273
if catchRes.isErr():
274274
return err(catchRes.error.msg)
275-
276275
return ok()
277276

278277
## Waku Sync

waku/waku_lightpush/client.nim

+8-4
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,19 @@ proc publishToAny*(
114114

115115
proc publishWithConn*(
116116
wl: WakuLightPushClient, pubSubTopic: PubsubTopic, message: WakuMessage, conn: Connection
117-
): Future[WakuLightPushResult[void]] {.async, gcsafe.} =
117+
): Future[WakuLightPushResult] {.async, gcsafe.} =
118118
## This proc is similar to the publish one but in this case
119119
## we use existing connection to publish.
120120

121121
info "publishWithConn", msg_hash = computeMessageHash(pubsubTopic, message).to0xHex
122122

123-
let pushRequest = PushRequest(pubSubTopic: pubSubTopic, message: message)
124-
let rpc = PushRPC(requestId: generateRequestId(wl.rng), request: some(pushRequest))
125-
await conn.writeLP(rpc.encode().buffer)
123+
let pushRequest = LightpushRequest(
124+
requestId: generateRequestId(wl.rng),
125+
pubSubTopic: some(pubSubTopic),
126+
message: message,
127+
)
128+
129+
await conn.writeLP(pushRequest.encode().buffer)
126130

127131
for obs in wl.publishObservers:
128132
obs.onMessagePublished(pubSubTopic, message)

0 commit comments

Comments
 (0)