mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
parent
7ea461955f
commit
041615beda
@ -27,19 +27,6 @@ import
|
|||||||
logScope:
|
logScope:
|
||||||
topics = "diagnose connections"
|
topics = "diagnose connections"
|
||||||
|
|
||||||
proc `$`*(cap: Capabilities): string =
|
|
||||||
case cap
|
|
||||||
of Capabilities.Relay:
|
|
||||||
return "Relay"
|
|
||||||
of Capabilities.Store:
|
|
||||||
return "Store"
|
|
||||||
of Capabilities.Filter:
|
|
||||||
return "Filter"
|
|
||||||
of Capabilities.Lightpush:
|
|
||||||
return "Lightpush"
|
|
||||||
of Capabilities.Sync:
|
|
||||||
return "Sync"
|
|
||||||
|
|
||||||
proc allPeers(pm: PeerManager): string =
|
proc allPeers(pm: PeerManager): string =
|
||||||
var allStr: string = ""
|
var allStr: string = ""
|
||||||
for idx, peer in pm.switch.peerStore.peers():
|
for idx, peer in pm.switch.peerStore.peers():
|
||||||
|
|||||||
@ -20,7 +20,7 @@ method send*(
|
|||||||
discard (
|
discard (
|
||||||
await self.wakuNode.lightpushPublish(some(topic), message, some(servicePeer))
|
await self.wakuNode.lightpushPublish(some(topic), message, some(servicePeer))
|
||||||
).valueOr:
|
).valueOr:
|
||||||
if error.code == NO_PEERS_TO_RELAY and
|
if error.code == LightPushErrorCode.NO_PEERS_TO_RELAY and
|
||||||
error.desc != some("No peers for topic, skipping publish"):
|
error.desc != some("No peers for topic, skipping publish"):
|
||||||
# TODO: We need better separation of errors happening on the client side or the server side.-
|
# TODO: We need better separation of errors happening on the client side or the server side.-
|
||||||
return err("dial_failure")
|
return err("dial_failure")
|
||||||
|
|||||||
@ -28,6 +28,7 @@ const ProtocolsTable = {
|
|||||||
"rendezvous": "/rendezvous/",
|
"rendezvous": "/rendezvous/",
|
||||||
"ipfs-ping": "/ipfs/ping/",
|
"ipfs-ping": "/ipfs/ping/",
|
||||||
"peer-exchange": "/vac/waku/peer-exchange/",
|
"peer-exchange": "/vac/waku/peer-exchange/",
|
||||||
|
"mix": "mix/1.0.0",
|
||||||
}.toTable
|
}.toTable
|
||||||
|
|
||||||
const WebSocketPortOffset = 1000
|
const WebSocketPortOffset = 1000
|
||||||
|
|||||||
2
vendor/mix
vendored
2
vendor/mix
vendored
@ -1 +1 @@
|
|||||||
Subproject commit e45cd05bfdb775a4cb2c9443077a15b9da13c037
|
Subproject commit 5e95337693ad0787baec1ee25293f454c2d105ca
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#!fmt: off
|
||||||
|
|
||||||
import os
|
import os
|
||||||
mode = ScriptMode.Verbose
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
@ -21,14 +23,15 @@ requires "nim >= 2.2.4",
|
|||||||
"stew",
|
"stew",
|
||||||
"stint",
|
"stint",
|
||||||
"metrics",
|
"metrics",
|
||||||
"libp2p == 1.10.1", # Only for Waku v2
|
"libp2p >= 1.13.0",
|
||||||
"web3",
|
"web3",
|
||||||
"presto",
|
"presto",
|
||||||
"regex",
|
"regex",
|
||||||
"results",
|
"results",
|
||||||
"db_connector",
|
"db_connector",
|
||||||
"minilru",
|
"minilru",
|
||||||
"quic"
|
"quic",
|
||||||
|
"https://github.com/vacp2p/mix#0.1.0"
|
||||||
|
|
||||||
### Helper functions
|
### Helper functions
|
||||||
proc buildModule(filePath, params = "", lang = "c"): bool =
|
proc buildModule(filePath, params = "", lang = "c"): bool =
|
||||||
|
|||||||
@ -3,8 +3,7 @@ import
|
|||||||
chronicles,
|
chronicles,
|
||||||
bearssl/rand,
|
bearssl/rand,
|
||||||
libp2p/protocols/connectivity/autonat/client,
|
libp2p/protocols/connectivity/autonat/client,
|
||||||
libp2p/protocols/connectivity/autonat/service,
|
libp2p/protocols/connectivity/autonat/service
|
||||||
libp2p/protocols/connectivity/autonat/types
|
|
||||||
|
|
||||||
const AutonatCheckInterval = Opt.some(chronos.seconds(30))
|
const AutonatCheckInterval = Opt.some(chronos.seconds(30))
|
||||||
|
|
||||||
|
|||||||
@ -1238,7 +1238,7 @@ proc lightpushPublishHandler(
|
|||||||
WakuLightPushCodec,
|
WakuLightPushCodec,
|
||||||
Opt.some(
|
Opt.some(
|
||||||
MixParameters(expectReply: Opt.some(true), numSurbs: Opt.some(byte(1)))
|
MixParameters(expectReply: Opt.some(true), numSurbs: Opt.some(byte(1)))
|
||||||
# indicating we expect a single reply hence numSurbs = 1
|
# indicating we only want a single path to be used for reply hence numSurbs = 1
|
||||||
),
|
),
|
||||||
).valueOr:
|
).valueOr:
|
||||||
error "could not create mix connection"
|
error "could not create mix connection"
|
||||||
|
|||||||
@ -96,7 +96,7 @@ proc getEnrsFromCache(
|
|||||||
|
|
||||||
proc poolFilter*(cluster: Option[uint16], peer: RemotePeerInfo): bool =
|
proc poolFilter*(cluster: Option[uint16], peer: RemotePeerInfo): bool =
|
||||||
if peer.origin != Discv5:
|
if peer.origin != Discv5:
|
||||||
debug "peer not from discv5", peer = $peer, origin = $peer.origin
|
trace "peer not from discv5", peer = $peer, origin = $peer.origin
|
||||||
return false
|
return false
|
||||||
|
|
||||||
if peer.enr.isNone():
|
if peer.enr.isNone():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user