Mount keepalive on chat2bridge and bridge (#591)

This commit is contained in:
Hanno Cornelius 2021-06-02 16:54:38 +02:00 committed by GitHub
parent 106418113f
commit 83f546ede4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -95,6 +95,11 @@ proc toMatterbridge(cmb: Chat2MatterBridge, msg: WakuMessage) {.gcsafe.} =
chat2_mb_dropped.inc(labelValues = ["duplicate"])
return
if msg.contentTopic != cmb.contentTopic:
# Only bridge messages on the configured content topic
chat2_mb_dropped.inc(labelValues = ["filtered"])
return
trace "Post chat2 message to Matterbridge"
chat2_mb_transfers.inc(labelValues = ["chat2_to_mb"])
@ -249,6 +254,8 @@ when isMainModule:
# Now load rest of config
# Mount configured Waku v2 protocols
mountKeepalive(bridge.nodev2)
if conf.store:
mountStore(bridge.nodev2)

View File

@ -254,6 +254,8 @@ when isMainModule:
elif conf.fleetV1 == test: connectToNodes(bridge.nodev1, WhisperNodesTest)
# Mount configured Waku v2 protocols
mountKeepalive(bridge.nodev2)
if conf.store:
mountStore(bridge.nodev2, persistMessages = false) # Bridge does not persist messages

View File

@ -642,8 +642,11 @@ when isMainModule:
proc startMetricsServer(serverIp: ValidIpAddress, serverPort: Port) =
info "Starting metrics HTTP server", serverIp, serverPort
metrics.startHttpServer($serverIp, serverPort)
info "Metrics HTTP server started", serverIp, serverPort
proc startMetricsLog() =
# https://github.com/nim-lang/Nim/issues/17369
var logMetrics: proc(udata: pointer) {.gcsafe, raises: [Defect].}