enable metrics server in lp-mix example

This commit is contained in:
Prem Chaitanya Prathi 2025-04-01 11:51:32 +05:30
parent d238cda993
commit 3c6722cb92
2 changed files with 7 additions and 3 deletions

View File

@ -11,7 +11,8 @@ import
libp2p/multiaddress,
eth/keys,
eth/p2p/discoveryv5/enr,
metrics
metrics,
metrics/chronos_httpserver
import mix/entry_connection, mix/protocol, mix/curve25519
@ -123,7 +124,10 @@ proc setupAndPublish(rng: ref HmacDrbgContext, conf: LPMixConf) {.async.} =
await node.start()
node.peerManager.start()
node.startPeerExchangeLoop()
try:
startMetricsHttpServer("0.0.0.0", Port(8008))
except Exception:
error "failed to start metrics server: ", error = getCurrentExceptionMsg()
(await node.fetchPeerExchangePeers()).isOkOr:
warn "Cannot fetch peers from peer exchange", cause = error

2
vendor/mix vendored

@ -1 +1 @@
Subproject commit 010bfb646655c10d32d42a39ba376db60f855461
Subproject commit e85b086ea1d68638681ca3d34d94c6f1e14f45fc