mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-09 09:23:14 +00:00
chore: update mix
This commit is contained in:
parent
e17d8b9f43
commit
536b148f40
2
vendor/mix
vendored
2
vendor/mix
vendored
@ -1 +1 @@
|
||||
Subproject commit 78cca77195d5bbd257cdd3a74c2dd79e2bafe7cf
|
||||
Subproject commit 5847afa996b13b28f524c4beb633b9e24114ef6b
|
||||
2
vendor/nim-libp2p
vendored
2
vendor/nim-libp2p
vendored
@ -1 +1 @@
|
||||
Subproject commit 4c0d11c8b59dca7076e8e3acc4714d56a5d67c6e
|
||||
Subproject commit b517b692dfcdf39943963e60e39c7cff1fc6f289
|
||||
@ -23,12 +23,9 @@ import
|
||||
libp2p/transports/tcptransport,
|
||||
libp2p/transports/wstransport,
|
||||
libp2p/utility,
|
||||
mix,
|
||||
mix/mix_node,
|
||||
mix/mix_protocol,
|
||||
mix/curve25519,
|
||||
mix/protocol,
|
||||
mix/mix_metrics,
|
||||
mix/entry_connection
|
||||
mix/mix_protocol
|
||||
|
||||
import
|
||||
../waku_core,
|
||||
@ -1195,12 +1192,9 @@ proc lightpushPublishHandler(
|
||||
msg_hash = msgHash,
|
||||
mixify = mixify
|
||||
if mixify:
|
||||
let conn = MixEntryConnection.newConn(
|
||||
$peer.addrs[0], #TODO: How to handle multiple addresses?
|
||||
peer.peerId,
|
||||
ProtocolType.fromString(WakuLightPushCodec),
|
||||
node.mix,
|
||||
)
|
||||
#TODO: How to handle multiple addresses?
|
||||
let conn =
|
||||
node.mix.toConnection(peer.peerId, Opt.some(peer.addrs[0]), WakuLightPushCodec)
|
||||
return await node.wakuLightpushClient.publishWithConn(
|
||||
pubsubTopic, message, conn, peer.peerId
|
||||
)
|
||||
|
||||
@ -47,14 +47,10 @@ proc withWssTransport*(
|
||||
): SwitchBuilder {.raises: [Defect, IOError].} =
|
||||
let key: TLSPrivateKey = getSecureKey(secureKeyPath)
|
||||
let cert: TLSCertificate = getSecureCert(secureCertPath)
|
||||
b.withTransport(
|
||||
proc(upgr: Upgrade, privateKey: crypto.PrivateKey): Transport =
|
||||
WsTransport.new(
|
||||
upgr,
|
||||
tlsPrivateKey = key,
|
||||
tlsCertificate = cert,
|
||||
{TLSFlags.NoVerifyHost, TLSFlags.NoVerifyServerName},
|
||||
)
|
||||
b.withWsTransport(
|
||||
tlsPrivateKey = key,
|
||||
tlsCertificate = cert,
|
||||
{TLSFlags.NoVerifyHost, TLSFlags.NoVerifyServerName}, # THIS IS INSECURE, NO?
|
||||
)
|
||||
|
||||
proc newWakuSwitch*(
|
||||
|
||||
@ -7,7 +7,6 @@ import
|
||||
mix/mix_protocol,
|
||||
mix/mix_node,
|
||||
mix/mix_metrics,
|
||||
mix/tag_manager,
|
||||
libp2p/[multiaddress, multicodec, peerid]
|
||||
|
||||
import
|
||||
@ -142,13 +141,14 @@ proc new*(
|
||||
peermgr.switch.peerInfo.privateKey.skkey,
|
||||
)
|
||||
|
||||
let mixProto =
|
||||
MixProtocol.new(localMixNodeInfo, initTable[PeerId, MixPubInfo](), peermgr.switch)
|
||||
let wakuMix = WakuMix(mixProto)
|
||||
wakuMix.peerManager = peermgr
|
||||
wakuMix.clusterId = clusterId
|
||||
# TODO : ideally mix should not be marked ready until certain min pool of mixNodes are discovered
|
||||
var m = WakuMix(peerManager: peermgr, clusterId: clusterId)
|
||||
procCall MixProtocol(m).initialize(
|
||||
localMixNodeInfo, peermgr.switch, initTable[PeerId, MixPubInfo]()
|
||||
)
|
||||
|
||||
return ok(m)
|
||||
return ok(wakuMix)
|
||||
|
||||
proc start*(mix: Wakumix) =
|
||||
discard mix.startMixNodePoolMgr()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user