From 55538c7bf8845c492fbc07643f728bd9743794b0 Mon Sep 17 00:00:00 2001 From: kdeme Date: Fri, 1 May 2020 12:05:19 +0200 Subject: [PATCH] Add protocol2 target after rebase + fix some import paths --- Makefile | 5 ++++- waku.nimble | 3 +++ waku/node/v2/quicksim.nim | 2 +- waku/node/v2/rpc/wakucallsigs.nim | 8 ++++---- waku/node/v2/rpc/wakurpc.nim | 4 +--- waku/node/v2/wakunode.nim | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 333557f04..0552ee68a 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ GIT_SUBMODULE_UPDATE := git submodule update --init --recursive else # "variables.mk" was included. Business as usual until the end of this file. # default target, because it's the first one that doesn't start with '.' -all: | wakunode +all: | wakunode wakusim # must be included after the default target -include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk @@ -77,6 +77,9 @@ wakusim2: | build deps wakunode2 echo -e $(BUILD_MSG) "build/$@" && \ $(ENV_SCRIPT) nim wakusim2 $(NIM_PARAMS) waku.nims +protocol2: + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim protocol2 $(NIM_PARAMS) waku.nims # symlink waku.nims: ln -s waku.nimble $@ diff --git a/waku.nimble b/waku.nimble index e5a4df73b..4bdba6cdf 100644 --- a/waku.nimble +++ b/waku.nimble @@ -47,6 +47,9 @@ task wakusim, "Build Waku simulation tools": buildBinary "quicksim", "waku/node/v0/", "-d:chronicles_log_level=INFO" buildBinary "start_network", "waku/node/v0/", "-d:chronicles_log_level=DEBUG" +task protocol2, "Build the experimental Waku protocol": + buildBinary "waku_protocol", "waku/protocol/v2/", "-d:chronicles_log_level=DEBUG" + task wakunode2, "Build Experimental Waku cli": buildBinary "wakunode", "waku/node/v2/", "-d:chronicles_log_level=TRACE" diff --git a/waku/node/v2/quicksim.nim b/waku/node/v2/quicksim.nim index 6039a1d9a..40f280c0f 100644 --- a/waku/node/v2/quicksim.nim +++ b/waku/node/v2/quicksim.nim @@ -3,7 +3,7 @@ import eth/common as eth_common, eth/keys, # XXX: Replace me eth/p2p/rlpx_protocols/waku_protocol, - ../../vendor/nimbus/nimbus/rpc/[hexstrings, rpc_types, waku], + ../v0/rpc/[hexstrings, rpc_types, waku], rpc/wakurpc, options as what # TODO: Huh? Redefinition? diff --git a/waku/node/v2/rpc/wakucallsigs.nim b/waku/node/v2/rpc/wakucallsigs.nim index b04412cf1..d3c4571d6 100644 --- a/waku/node/v2/rpc/wakucallsigs.nim +++ b/waku/node/v2/rpc/wakucallsigs.nim @@ -1,7 +1,7 @@ # NOTE: Taken from v0, only version exists right now proc waku_version(): string -proc waku_info(): WhisperInfo +proc waku_info(): WakuInfo proc waku_setMaxMessageSize(size: uint64): bool proc waku_setMinPoW(pow: float): bool proc waku_markTrustedPeer(enode: string): bool @@ -20,10 +20,10 @@ proc waku_hasSymKey(id: Identifier): bool proc waku_getSymKey(id: Identifier): SymKey proc waku_deleteSymKey(id: Identifier): bool -proc waku_newMessageFilter(options: WhisperFilterOptions): Identifier +proc waku_newMessageFilter(options: WakuFilterOptions): Identifier proc waku_deleteMessageFilter(id: Identifier): bool -proc waku_getFilterMessages(id: Identifier): seq[WhisperFilterMessage] -proc waku_post(message: WhisperPostMessage): bool +proc waku_getFilterMessages(id: Identifier): seq[WakuFilterMessage] +proc waku_post(message: WakuPostMessage): bool proc wakusim_generateTraffic(amount: int): bool proc wakusim_generateRandomTraffic(amount: int): bool diff --git a/waku/node/v2/rpc/wakurpc.nim b/waku/node/v2/rpc/wakurpc.nim index 0793b4f2e..9f79387c3 100644 --- a/waku/node/v2/rpc/wakurpc.nim +++ b/waku/node/v2/rpc/wakurpc.nim @@ -5,9 +5,7 @@ import #eth/p2p/rlpx_protocols/waku_protocol, ../../../protocol/v2/waku_protocol, nimcrypto/[sysrand, hmac, sha2, pbkdf2], - ../../../vendor/nimbus/nimbus/rpc/rpc_types, - ../../../vendor/nimbus/nimbus/rpc/hexstrings, - ../../../vendor/nimbus/nimbus/rpc/key_storage + ../../v0/rpc/[rpc_types, hexstrings, key_storage] from stew/byteutils import hexToSeqByte, hexToByteArray diff --git a/waku/node/v2/wakunode.nim b/waku/node/v2/wakunode.nim index 6e9cebd5c..cedcd679d 100644 --- a/waku/node/v2/wakunode.nim +++ b/waku/node/v2/wakunode.nim @@ -5,7 +5,7 @@ import eth/p2p/[discovery, enode, peer_pool, bootnodes, whispernodes], eth/p2p/rlpx_protocols/[whisper_protocol, waku_protocol, waku_bridge], # TODO remove me - ../../vendor/nimbus/nimbus/rpc/[wakusim, key_storage], + ../v0/rpc/[wakusim, key_storage], ../../vendor/nim-libp2p/libp2p/standard_setup, ../../vendor/nim-libp2p/libp2p/multiaddress, ../../vendor/nim-libp2p/libp2p/crypto/crypto,