mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 08:57:14 +00:00
deploy: e0d8d8f4680e630fb2eee05baef4cedd1da39b8c
This commit is contained in:
parent
8fe0a3e853
commit
471beb5fbd
@ -172,7 +172,9 @@ proc start*(cmb: Chat2MatterBridge) {.async.} =
|
||||
debug "Start listening on Waku v2"
|
||||
await cmb.nodev2.start()
|
||||
|
||||
cmb.nodev2.mountRelay() # Always mount relay for bridge
|
||||
# Always mount relay for bridge
|
||||
# `triggerSelf` is false on a `bridge` to avoid duplicates
|
||||
cmb.nodev2.mountRelay(triggerSelf = false)
|
||||
|
||||
# Bridging
|
||||
# Handle messages on Waku v2 and bridge to Matterbridge
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az182-211:
|
||||
# Libtool was configured on host fv-az231-806:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
@ -65,27 +65,27 @@ func toWakuMessage(env: Envelope): WakuMessage =
|
||||
proc toWakuV2(bridge: WakuBridge, env: Envelope) {.async.} =
|
||||
let msg = env.toWakuMessage()
|
||||
|
||||
debug "message converted to V2", msg=msg
|
||||
|
||||
if bridge.seen.containsOrAdd(msg.encode().buffer.hash()):
|
||||
# This is a duplicate message. Return
|
||||
trace "Already seen. Dropping.", msg=msg
|
||||
waku_bridge_dropped.inc(labelValues = ["duplicate"])
|
||||
return
|
||||
|
||||
trace "Sending message to V2", msg=msg
|
||||
|
||||
waku_bridge_transfers.inc(labelValues = ["v1_to_v2"])
|
||||
|
||||
await bridge.nodev2.publish(DefaultBridgeTopic, msg)
|
||||
|
||||
proc toWakuV1(bridge: WakuBridge, msg: WakuMessage) {.gcsafe.} =
|
||||
debug "sending message to V1", msg=msg
|
||||
|
||||
if bridge.seen.containsOrAdd(msg.encode().buffer.hash()):
|
||||
# This is a duplicate message. Return
|
||||
trace "Already seen. Dropping.", msg=msg
|
||||
waku_bridge_dropped.inc(labelValues = ["duplicate"])
|
||||
return
|
||||
|
||||
trace "Sending message to V1", msg=msg
|
||||
|
||||
waku_bridge_transfers.inc(labelValues = ["v2_to_v1"])
|
||||
|
||||
# @TODO: use namespacing to map v2 contentTopics to v1 topics
|
||||
@ -154,7 +154,9 @@ proc start*(bridge: WakuBridge) {.async.} =
|
||||
debug "Start listening on Waku v2"
|
||||
await bridge.nodev2.start()
|
||||
|
||||
bridge.nodev2.mountRelay() # Always mount relay for bridge
|
||||
# Always mount relay for bridge.
|
||||
# `triggerSelf` is false on a `bridge` to avoid duplicates
|
||||
bridge.nodev2.mountRelay(triggerSelf = false)
|
||||
|
||||
# Bridging
|
||||
# Handle messages on Waku v1 and bridge to Waku v2
|
||||
|
@ -441,12 +441,13 @@ proc mountRelay*(node: WakuNode,
|
||||
topics: seq[string] = newSeq[string](),
|
||||
rlnRelayEnabled = false,
|
||||
keepAlive = false,
|
||||
relayMessages = true) {.gcsafe.} =
|
||||
relayMessages = true,
|
||||
triggerSelf = true) {.gcsafe.} =
|
||||
let wakuRelay = WakuRelay.init(
|
||||
switch = node.switch,
|
||||
# Use default
|
||||
#msgIdProvider = msgIdProvider,
|
||||
triggerSelf = true,
|
||||
triggerSelf = triggerSelf,
|
||||
sign = false,
|
||||
verifySignature = false
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user