From 93de2f4792abd384b1623cb0299a067bee740255 Mon Sep 17 00:00:00 2001 From: Emil Ivanichkov Date: Tue, 5 Mar 2024 10:44:50 +0200 Subject: [PATCH] fix(build): Fix build after `nwaku` pkg bump --- libs/waku_utils/example/js-waku/initiator.nim | 14 +++++------ libs/waku_utils/example/nwaku/agentA.nim | 12 +++++----- libs/waku_utils/waku_handshake_utils.nim | 4 ++-- libs/waku_utils/waku_node.nim | 1 + scripts/x.sh | 23 +++++++++++++++++++ 5 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 scripts/x.sh diff --git a/libs/waku_utils/example/js-waku/initiator.nim b/libs/waku_utils/example/js-waku/initiator.nim index 6f7604b..8510726 100644 --- a/libs/waku_utils/example/js-waku/initiator.nim +++ b/libs/waku_utils/example/js-waku/initiator.nim @@ -71,7 +71,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} = initiatorHSResult.nametagsOutbound) let wakuMsg = encodePayloadV2(payload, contentTopic) - await node.publish(some(pubSubTopic), wakuMsg.get) + discard await node.publish(some(pubSubTopic), wakuMsg.get) notice "Sending real message", payload = payload.messageNametag await sleepAsync(100) i = i - 1 @@ -85,7 +85,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} = initiatorHSResult.nametagsOutbound) wakuMessage1 = encodePayloadV2(payload1, contentTopic) notice "Sending first message" - await node.publish(some(pubSubTopic), wakuMessage1.get) + discard await node.publish(some(pubSubTopic), wakuMessage1.get) let lostMessage1 = @[(byte)1, 5, 5, 5] @@ -105,7 +105,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} = initiatorHSResult.nametagsOutbound) wakuMessage2 = encodePayloadV2(payload2, contentTopic) notice "Sending second message" - await node.publish(some(pubSubTopic), wakuMessage2.get) + discard await node.publish(some(pubSubTopic), wakuMessage2.get) let lostMessage3 = @[(byte)3, 5, 5, 5] @@ -115,7 +115,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} = await sleepAsync(10000) notice "Sending first lost message" - await node.publish(some(pubSubTopic), wakuLostMessage1.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage1.get) let message3 = @[(byte)3, 42, 42, 42] @@ -123,15 +123,15 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} = initiatorHSResult.nametagsOutbound) wakuMessage3 = encodePayloadV2(payload3, contentTopic) notice "Sending third message" - await node.publish(some(pubSubTopic), wakuMessage3.get) + discard await node.publish(some(pubSubTopic), wakuMessage3.get) await sleepAsync(10000) notice "Sending second lost message" - await node.publish(some(pubSubTopic), wakuLostMessage2.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage2.get) await sleepAsync(1000) notice "Sending third lost message" - await node.publish(some(pubSubTopic), wakuLostMessage3.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage3.get) when isMainModule: diff --git a/libs/waku_utils/example/nwaku/agentA.nim b/libs/waku_utils/example/nwaku/agentA.nim index f626d3c..cc707df 100644 --- a/libs/waku_utils/example/nwaku/agentA.nim +++ b/libs/waku_utils/example/nwaku/agentA.nim @@ -60,7 +60,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} = agentAHSResult.nametagsOutbound) wakuMessage1 = encodePayloadV2(payload1, contentTopic) notice "Sending first message" - await node.publish(some(pubSubTopic), wakuMessage1.get) + discard await node.publish(some(pubSubTopic), wakuMessage1.get) let lostMessage1 = @[(byte)1, 5, 5, 5] @@ -80,7 +80,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} = agentAHSResult.nametagsOutbound) wakuMessage2 = encodePayloadV2(payload2, contentTopic) notice "Sending second message" - await node.publish(some(pubSubTopic), wakuMessage2.get) + discard await node.publish(some(pubSubTopic), wakuMessage2.get) let lostMessage3 = @[(byte)3, 5, 5, 5] @@ -90,7 +90,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} = await sleepAsync(10000) notice "Sending first lost message" - await node.publish(some(pubSubTopic), wakuLostMessage1.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage1.get) let message3 = @[(byte)3, 42, 42, 42] @@ -98,15 +98,15 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} = agentAHSResult.nametagsOutbound) wakuMessage3 = encodePayloadV2(payload3, contentTopic) notice "Sending third message" - await node.publish(some(pubSubTopic), wakuMessage3.get) + discard await node.publish(some(pubSubTopic), wakuMessage3.get) await sleepAsync(10000) notice "Sending second lost message" - await node.publish(some(pubSubTopic), wakuLostMessage2.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage2.get) await sleepAsync(1000) notice "Sending third lost message" - await node.publish(some(pubSubTopic), wakuLostMessage3.get) + discard await node.publish(some(pubSubTopic), wakuLostMessage3.get) when isMainModule: let rng = crypto.newRng() diff --git a/libs/waku_utils/waku_handshake_utils.nim b/libs/waku_utils/waku_handshake_utils.nim index b8bc4dc..7497b3d 100644 --- a/libs/waku_utils/waku_handshake_utils.nim +++ b/libs/waku_utils/waku_handshake_utils.nim @@ -107,7 +107,7 @@ proc publishHandShakeInitiatorMsg*(node: WakuNode, contentTopic: ContentTopic, message: WakuMessage) {.async.} = notice "Publishing handshake initiator message", step = 1 - await node.publish(some(pubSubTopic), message) + discard await node.publish(some(pubSubTopic), message) notice "Published handshake initiator message", step = 1, psTopic = pubSubTopic, @@ -168,7 +168,7 @@ proc publishHandShakeMsg*(node: WakuNode, message: WakuMessage, step: int) {.async.} = notice "Publishing handshake message for step:", step = step - await node.publish(some(pubSubTopic), message) + discard await node.publish(some(pubSubTopic), message) notice "Published handshake message for step:", step = step, psTopic = pubSubTopic, contentTopic = contentTopic, diff --git a/libs/waku_utils/waku_node.nim b/libs/waku_utils/waku_node.nim index a405c8e..3feea8f 100644 --- a/libs/waku_utils/waku_node.nim +++ b/libs/waku_utils/waku_node.nim @@ -9,6 +9,7 @@ import import waku/[waku_core, waku_node, waku_enr, waku_discv5], + waku/factory/builder, waku/node/peer_manager, waku/common/[logging, protobuf] diff --git a/scripts/x.sh b/scripts/x.sh new file mode 100644 index 0000000..1d96a81 --- /dev/null +++ b/scripts/x.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Navigate to the directory containing the repositories +cd nimble_develop + +# Loop through each folder +for repo in */; do + # Navigate into the repository + cd "$repo" + + # Check if it's a Git repository + if [ -d .git ]; then + echo "Repository: $repo" + git rev-parse HEAD + git fetch + echo + else + echo "$repo is not a Git repository" + fi + + # Return to the parent directory + cd .. +done