Skip to content

Commit

Permalink
Merge 9ece97d into c93f804
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya authored Jul 4, 2024
2 parents c93f804 + 9ece97d commit 6332392
Show file tree
Hide file tree
Showing 146 changed files with 617 additions and 568 deletions.
12 changes: 7 additions & 5 deletions apps/benchmarks/benchmarks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import
std/sequtils,
stew/results,
options,
../../waku/waku_rln_relay/protocol_types,
../../waku/waku_rln_relay/rln,
../../waku/waku_rln_relay,
../../waku/waku_rln_relay/conversion_utils,
../../waku/waku_rln_relay/group_manager/static/group_manager
waku/[
waku_rln_relay/protocol_types,
waku_rln_relay/rln,
waku_rln_relay,
waku_rln_relay/conversion_utils,
waku_rln_relay/group_manager/static/group_manager,
]

import std/[times, os]

Expand Down
26 changes: 14 additions & 12 deletions apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ import
nameresolving/dnsresolver,
] # define DNS resolution
import
../../waku/waku_core,
../../waku/waku_lightpush/common,
../../waku/waku_lightpush/rpc,
../../waku/waku_enr,
../../waku/discovery/waku_dnsdisc,
../../waku/waku_store_legacy,
../../waku/waku_node,
../../waku/node/waku_metrics,
../../waku/node/peer_manager,
../../waku/factory/builder,
../../waku/common/utils/nat,
../../waku/waku_relay,
waku/[
waku_core,
waku_lightpush/common,
waku_lightpush/rpc,
waku_enr,
discovery/waku_dnsdisc,
waku_store_legacy,
waku_node,
node/waku_metrics,
node/peer_manager,
factory/builder,
common/utils/nat,
waku_relay,
],
./config_chat2

import libp2p/protocols/pubsub/rpc/messages, libp2p/protocols/pubsub/pubsub
Expand Down
2 changes: 1 addition & 1 deletion apps/chat2/config_chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import
nimcrypto/utils,
std/strutils,
regex
import ../../../waku/waku_core
import waku/waku_core

type
Fleet* = enum
Expand Down
1 change: 1 addition & 0 deletions apps/chat2/nim.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-d:chronicles_line_numbers
-d:chronicles_runtime_filtering:on
-d:discv5_protocol_id:d5waku
path = "../.."
19 changes: 11 additions & 8 deletions apps/chat2bridge/chat2bridge.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ import
eth/net/nat,
json_rpc/rpcserver,
# Matterbridge client imports
../../waku/common/utils/matterbridge_client,
# Waku v2 imports
libp2p/crypto/crypto,
libp2p/errors,
../../../waku/waku_core,
../../../waku/waku_node,
../../../waku/node/peer_manager,
../../waku/waku_filter_v2,
../../waku/waku_store,
../../waku/factory/builder,
waku/[
waku_core,
waku_node,
node/peer_manager,
waku_filter_v2,
waku_store,
factory/builder,
common/utils/matterbridge_client,
],
# Chat 2 imports
../chat2/chat2,
# Common cli config
Expand Down Expand Up @@ -178,6 +180,7 @@ proc new*(
let nodev2 = block:
var builder = WakuNodeBuilder.init()
builder.withNodeKey(nodev2Key)

builder
.withNetworkConfigurationDetails(
nodev2BindIp, nodev2BindPort, nodev2ExtIp, nodev2ExtPort
Expand Down Expand Up @@ -239,7 +242,7 @@ proc stop*(cmb: Chat2MatterBridge) {.async: (raises: [Exception]).} =
{.pop.}
# @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
when isMainModule:
import ../../../waku/common/utils/nat, ../../waku/waku_api/message_cache
import waku/common/utils/nat, waku/waku_api/message_cache

let
rng = newRng()
Expand Down
1 change: 1 addition & 0 deletions apps/chat2bridge/nim.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-d:chronicles_line_numbers
-d:chronicles_runtime_filtering:on
-d:discv5_protocol_id:d5waku
path = "../.."
6 changes: 1 addition & 5 deletions apps/liteprotocoltester/filter_subscriber.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ import
json_serialization as js,
times
import
../../../waku/common/logging,
../../../waku/node/peer_manager,
../../../waku/waku_node,
../../../waku/waku_core,
../../../waku/waku_filter_v2/client,
waku/[common/logging, node/peer_manager, waku_node, waku_core, waku_filter_v2/client],
./tester_config,
./tester_message,
./statistics
Expand Down
6 changes: 1 addition & 5 deletions apps/liteprotocoltester/lightpush_publisher.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import
stew/results,
json_serialization as js
import
../../../waku/common/logging,
../../../waku/waku_node,
../../../waku/node/peer_manager,
../../../waku/waku_core,
../../../waku/waku_lightpush/client,
waku/[common/logging, waku_node, node/peer_manager, waku_core, waku_lightpush/client],
./tester_config,
./tester_message

Expand Down
14 changes: 8 additions & 6 deletions apps/liteprotocoltester/liteprotocoltester.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import
confutils

import
../../waku/common/logging,
../../waku/factory/waku,
../../waku/factory/external_config,
../../waku/node/health_monitor,
../../waku/node/waku_metrics,
../../waku/waku_api/rest/builder as rest_server_builder,
waku/[
common/logging,
factory/waku,
factory/external_config,
node/health_monitor,
node/waku_metrics,
waku_api/rest/builder as rest_server_builder,
],
./tester_config,
./lightpush_publisher,
./filter_subscriber
Expand Down
12 changes: 7 additions & 5 deletions apps/liteprotocoltester/tester_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import
secp256k1,
json
import
../../waku/common/confutils/envvar/defs as confEnvvarDefs,
../../waku/common/confutils/envvar/std/net as confEnvvarNet,
../../waku/common/logging,
../../waku/factory/external_config,
../../waku/waku_core
waku/[
common/confutils/envvar/defs as confEnvvarDefs,
common/confutils/envvar/std/net as confEnvvarNet,
common/logging,
factory/external_config,
waku/waku_core,
]

export confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet

Expand Down
22 changes: 12 additions & 10 deletions apps/networkmonitor/networkmonitor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ import
metrics/chronos_httpserver,
presto/[route, server, client]
import
../../waku/waku_core,
../../waku/node/peer_manager,
../../waku/waku_node,
../../waku/waku_enr,
../../waku/discovery/waku_discv5,
../../waku/discovery/waku_dnsdisc,
../../waku/waku_relay,
../../waku/waku_rln_relay,
../../waku/factory/builder,
../../waku/factory/networks_config,
waku/[
waku_core,
node/peer_manager,
waku_node,
waku_enr,
discovery/waku_discv5,
discovery/waku_dnsdisc,
waku_relay,
waku_rln_relay,
factory/builder,
factory/networks_config,
],
./networkmonitor_metrics,
./networkmonitor_config,
./networkmonitor_utils
Expand Down
3 changes: 2 additions & 1 deletion apps/networkmonitor/nim.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-d:chronicles_line_numbers
-d:chronicles_runtime_filtering:on
-d:discv5_protocol_id:d5waku
-d:discv5_protocol_id:d5waku
path = "../.."
1 change: 1 addition & 0 deletions apps/wakucanary/nim.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-d:chronicles_line_numbers
-d:chronicles_runtime_filtering:on
-d:discv5_protocol_id:d5waku
path = "../.."
6 changes: 1 addition & 5 deletions apps/wakucanary/wakucanary.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import
libp2p/multicodec
import
./certsgenerator,
../../waku/waku_enr,
../../waku/node/peer_manager,
../../waku/waku_core,
../../waku/waku_node,
../../waku/factory/builder
waku/[waku_enr, node/peer_manager, waku_core, waku_node, factory/builder]

# protocols and their tag
const ProtocolsTable = {
Expand Down
1 change: 1 addition & 0 deletions apps/wakunode2/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
-d:chronicles_disabled_topics="eth,dnsdisc.client"
# Results in empty output for some reason
#-d:"chronicles_enabled_topics=GossipSub:TRACE,WakuRelay:TRACE"
path = "../.."
14 changes: 8 additions & 6 deletions apps/wakunode2/wakunode2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import
import
../../tools/rln_keystore_generator/rln_keystore_generator,
../../tools/rln_db_inspector/rln_db_inspector,
../../waku/common/logging,
../../waku/factory/external_config,
../../waku/factory/waku,
../../waku/node/health_monitor,
../../waku/node/waku_metrics,
../../waku/waku_api/rest/builder as rest_server_builder
waku/[
common/logging,
factory/external_config,
factory/waku,
node/health_monitor,
node/waku_metrics,
waku_api/rest/builder as rest_server_builder,
]

logScope:
topics = "wakunode main"
Expand Down
6 changes: 1 addition & 5 deletions examples/filter_subscriber.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
## subscribe to messages without relay

import chronicles, chronos, stew/byteutils, stew/results
import
../../../waku/common/logging,
../../../waku/node/peer_manager,
../../../waku/waku_core,
../../../waku/waku_filter_v2/client
import waku/[common/logging, node/peer_manager, waku_core, waku_filter_v2/client]

const
FilterPeer =
Expand Down
6 changes: 1 addition & 5 deletions examples/lightpush_publisher.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
## use lightpush to publish messages without relay

import chronicles, chronos, stew/byteutils, stew/results
import
../../../waku/common/logging,
../../../waku/node/peer_manager,
../../../waku/waku_core,
../../../waku/waku_lightpush/client
import waku/[common/logging, node/peer_manager, waku_core, waku_lightpush/client]

const
LightpushPeer =
Expand Down
1 change: 1 addition & 0 deletions examples/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
-d:chronicles_log_level="DEBUG"
-d:chronicles_runtime_filtering=on
-d:discv5_protocol_id="d5waku"
path = "../"
16 changes: 9 additions & 7 deletions examples/publisher.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import
eth/p2p/discoveryv5/enr

import
../../../waku/common/logging,
../../../waku/node/peer_manager,
../../../waku/waku_core,
../../../waku/waku_node,
../../../waku/waku_enr,
../../../waku/discovery/waku_discv5,
../../../waku/factory/builder
waku/[
common/logging,
node/peer_manager,
waku_core,
waku_node,
waku_enr,
discovery/waku_discv5,
factory/builder,
]

proc now*(): Timestamp =
getNanosecondTime(getTime().toUnixFloat())
Expand Down
18 changes: 10 additions & 8 deletions examples/subscriber.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import
eth/p2p/discoveryv5/enr

import
../../../waku/common/logging,
../../../waku/node/peer_manager,
../../../waku/waku_core,
../../../waku/waku_node,
../../../waku/waku_enr,
../../../waku/discovery/waku_discv5,
../../../waku/factory/builder,
../../../waku/waku_relay
waku/[
common/logging,
node/peer_manager,
waku_core,
waku_node,
waku_enr,
discovery/waku_discv5,
factory/builder,
waku_relay,
]

# An accesible bootstrap node. See waku.sandbox fleets.status.im
const bootstrapNode =
Expand Down
1 change: 1 addition & 0 deletions examples/wakustealthcommitments/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
-d:chronicles_log_level=INFO
# Results in empty output for some reason
#-d:"chronicles_enabled_topics=GossipSub:TRACE,WakuRelay:TRACE"
path = "../../"
2 changes: 1 addition & 1 deletion examples/wakustealthcommitments/node_spec.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{.push raises: [].}

import
../../waku/common/logging, ../../waku/factory/[waku, networks_config, external_config]
waku/[common/logging, factory/[waku, networks_config, external_config]]
import
std/[options, strutils, os, sequtils],
stew/shims/net as stewNet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import
stew/results,
../../waku/common/logging,
../../waku/waku_node,
../../waku/waku_rln_relay,
waku/[common/logging,
waku_node,
waku_rln_relay,],
./erc_5564_interface as StealthCommitmentFFI,
./node_spec,
./wire_spec
Expand Down
2 changes: 1 addition & 1 deletion examples/wakustealthcommitments/wire_spec.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import std/[times, options]
import confutils, chronicles, chronos, stew/results

import ../../waku/waku_core, ../../waku/common/protobuf
import waku/[waku_core, common/protobuf]
import libp2p/protobuf/minprotobuf

export
Expand Down
2 changes: 1 addition & 1 deletion tests/common/test_base64_codec.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{.used.}

import std/strutils, stew/[results, byteutils], testutils/unittests
import ../../waku/common/base64
import waku/common/base64

suite "Waku Common - stew base64 wrapper":
const TestData =
Expand Down
4 changes: 2 additions & 2 deletions tests/common/test_confutils_envvar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import
confutils/defs,
confutils/std/net
import
../../waku/common/confutils/envvar/defs as confEnvvarDefs,
../../waku/common/confutils/envvar/std/net as confEnvvarNet
waku/common/confutils/envvar/defs as confEnvvarDefs,
waku/common/confutils/envvar/std/net as confEnvvarNet

type ConfResult[T] = Result[T, string]

Expand Down
Loading

0 comments on commit 6332392

Please sign in to comment.