mirror of https://github.com/waku-org/nwaku.git
Basic waku protocol stub floodsub
This commit is contained in:
parent
e227959a34
commit
57953b57bf
3
Makefile
3
Makefile
|
@ -14,3 +14,6 @@ wakunode2: node/v2/wakunode.nim
|
||||||
|
|
||||||
quicksim2: node/v2/quicksim.nim
|
quicksim2: node/v2/quicksim.nim
|
||||||
nim c --threads:on -o:build/quicksim2 node/v2/quicksim.nim
|
nim c --threads:on -o:build/quicksim2 node/v2/quicksim.nim
|
||||||
|
|
||||||
|
protocol2: protocol/v2/waku_protocol.nim
|
||||||
|
nim c --threads:on -o:build/protocol2 protocol/v2/waku_protocol.nim
|
||||||
|
|
|
@ -3,4 +3,36 @@
|
||||||
## This file should eventually correspond to waku_protocol as RLPx subprotocol.
|
## This file should eventually correspond to waku_protocol as RLPx subprotocol.
|
||||||
## Instead, it should likely be on top of GossipSub with a similar interface.
|
## Instead, it should likely be on top of GossipSub with a similar interface.
|
||||||
|
|
||||||
const wakuVersionStr = "2.0.0-alpha1"
|
import sequtils, tables, options, sets, strutils
|
||||||
|
import chronos, chronicles
|
||||||
|
import ../../vendor/nim-libp2p/libp2p/protocols/pubsub/pubsub,
|
||||||
|
../../vendor/nim-libp2p/libp2p/protocols/pubsub/pubsubpeer,
|
||||||
|
../../vendor/nim-libp2p/libp2p/protocols/pubsub/floodsub
|
||||||
|
|
||||||
|
logScope:
|
||||||
|
topic = "WakuSub"
|
||||||
|
|
||||||
|
# For spike
|
||||||
|
const WakuSubCodec* = "/WakuSub/0.0.1"
|
||||||
|
|
||||||
|
#const wakuVersionStr = "2.0.0-alpha1"
|
||||||
|
|
||||||
|
# So this should already have floodsub table, seen, as well as peerinfo, topics, peers, etc
|
||||||
|
# How do we verify that in nim?
|
||||||
|
type
|
||||||
|
WakuSub* = ref object of FloodSub
|
||||||
|
# XXX: just playing
|
||||||
|
text*: string
|
||||||
|
|
||||||
|
# method subscribeTopic
|
||||||
|
# method handleDisconnect
|
||||||
|
# method rpcHandler
|
||||||
|
# method init
|
||||||
|
# method publish
|
||||||
|
# method unsubscribe
|
||||||
|
# method initPubSub
|
||||||
|
|
||||||
|
# To defer to parent object something like:
|
||||||
|
# procCall PubSub(f).publish(topic, data)
|
||||||
|
|
||||||
|
# Then we should be able to write tests like floodsub test
|
||||||
|
|
Loading…
Reference in New Issue