mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
SIGSERV failing isolateed a bit more
This commit is contained in:
parent
73f8fc3641
commit
37a8c88e3d
@ -8,8 +8,8 @@ import
|
|||||||
libp2p/transports/[transport, tcptransport],
|
libp2p/transports/[transport, tcptransport],
|
||||||
libp2p/muxers/[muxer, mplex/mplex, mplex/types],
|
libp2p/muxers/[muxer, mplex/mplex, mplex/types],
|
||||||
libp2p/protocols/[identify, secure/secure],
|
libp2p/protocols/[identify, secure/secure],
|
||||||
libp2p/protocols/pubsub/[pubsub, gossipsub, floodsub]
|
libp2p/protocols/pubsub/[pubsub, gossipsub, floodsub],
|
||||||
# waku_protocol
|
../../waku/protocol/v2/waku_protocol
|
||||||
|
|
||||||
when libp2p_secure == "noise":
|
when libp2p_secure == "noise":
|
||||||
import libp2p/protocols/secure/noise
|
import libp2p/protocols/secure/noise
|
||||||
@ -42,6 +42,7 @@ proc newStandardSwitch*(privKey = none(PrivateKey),
|
|||||||
else:
|
else:
|
||||||
# Creating switch from generate node
|
# Creating switch from generate node
|
||||||
# XXX: Hacky test, hijacking WakuSub here
|
# XXX: Hacky test, hijacking WakuSub here
|
||||||
|
# XXX: If I use WakuSub here I get a SIGSERV
|
||||||
#echo "Using WakuSub here"
|
#echo "Using WakuSub here"
|
||||||
PubSub newPubSub(FloodSub, peerInfo, triggerSelf)
|
PubSub newPubSub(FloodSub, peerInfo, triggerSelf)
|
||||||
#PubSub newPubSub(WakuSub, peerInfo, triggerSelf)
|
#PubSub newPubSub(WakuSub, peerInfo, triggerSelf)
|
||||||
|
|||||||
@ -15,11 +15,8 @@ import utils,
|
|||||||
connection,
|
connection,
|
||||||
stream/bufferstream,
|
stream/bufferstream,
|
||||||
crypto/crypto,
|
crypto/crypto,
|
||||||
#protocols/pubsub/pubsub,
|
protocols/pubsub/floodsub]
|
||||||
protocols/pubsub/floodsub,
|
import ../../waku/protocol/v2/waku_protocol
|
||||||
#protocols/pubsub/rpc/messages,
|
|
||||||
#protocols/pubsub/rpc/message
|
|
||||||
]
|
|
||||||
|
|
||||||
const
|
const
|
||||||
StreamTransportTrackerName = "stream.transport"
|
StreamTransportTrackerName = "stream.transport"
|
||||||
@ -27,6 +24,7 @@ const
|
|||||||
|
|
||||||
# TODO: Start with floodsub here, then move other logic here
|
# TODO: Start with floodsub here, then move other logic here
|
||||||
|
|
||||||
|
# XXX: If I cast to WakuSub here I get a SIGSEGV
|
||||||
proc waitSub(sender, receiver: auto; key: string) {.async, gcsafe.} =
|
proc waitSub(sender, receiver: auto; key: string) {.async, gcsafe.} =
|
||||||
# turn things deterministic
|
# turn things deterministic
|
||||||
# this is for testing purposes only
|
# this is for testing purposes only
|
||||||
@ -57,6 +55,7 @@ suite "FloodSub":
|
|||||||
proc runTests(): Future[bool] {.async.} =
|
proc runTests(): Future[bool] {.async.} =
|
||||||
var completionFut = newFuture[bool]()
|
var completionFut = newFuture[bool]()
|
||||||
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
||||||
|
echo "Hit handler", topic
|
||||||
check topic == "foobar"
|
check topic == "foobar"
|
||||||
completionFut.complete(true)
|
completionFut.complete(true)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user