deploy: 757804c9ee76fd53406fed96dfbc1b08f02c066a

This commit is contained in:
LNSD 2022-10-18 18:12:14 +00:00
parent 63026e957e
commit dc0b58ee37
13 changed files with 88 additions and 78 deletions

5
apps/wakunode2/nim.cfg Normal file
View File

@ -0,0 +1,5 @@
-d:chronicles_line_numbers
-d:"chronicles_runtime_filtering=on"
-d:nimDebugDlOpen
# Results in empty output for some reason
#-d:"chronicles_enabled_topics=GossipSub:TRACE,WakuRelay:TRACE"

View File

@ -2,29 +2,54 @@
import import
std/[options, tables, strutils, sequtils, os], std/[options, tables, strutils, sequtils, os],
chronos, chronicles, metrics,
stew/shims/net as stewNet, stew/shims/net as stewNet,
chronicles,
chronos,
metrics,
confutils,
toml_serialization,
system/ansi_c,
eth/keys, eth/keys,
eth/p2p/discoveryv5/enr, eth/p2p/discoveryv5/enr,
libp2p/[builders, multihash],
libp2p/crypto/crypto, libp2p/crypto/crypto,
libp2p/protocols/ping, libp2p/protocols/ping,
libp2p/protocols/pubsub/[gossipsub, rpc/messages], libp2p/protocols/pubsub/[gossipsub, rpc/messages],
libp2p/[builders, multihash], libp2p/transports/[transport, wstransport],
libp2p/transports/[transport, wstransport] libp2p/nameresolving/dnsresolver
import import
../protocol/waku_store, ../../waku/v2/protocol/waku_store,
../protocol/waku_filter, ../../waku/v2/protocol/waku_filter,
../protocol/waku_rln_relay/waku_rln_relay_types, ../../waku/v2/protocol/waku_peer_exchange,
../protocol/waku_peer_exchange, ../../waku/v2/node/peer_manager/peer_manager,
../utils/[peers, wakuenr], ../../waku/v2/node/dnsdisc/waku_dnsdisc,
./peer_manager/peer_manager, ../../waku/v2/node/discv5/waku_discv5,
./storage/message/waku_store_queue, ../../waku/v2/node/storage/sqlite,
./storage/message/message_retention_policy_capacity, ../../waku/v2/node/storage/peer/waku_peer_storage,
./storage/message/message_retention_policy_time, ../../waku/v2/node/storage/message/waku_store_queue,
./dnsdisc/waku_dnsdisc, ../../waku/v2/node/storage/message/dual_message_store,
./discv5/waku_discv5, ../../waku/v2/node/storage/message/sqlite_store,
./wakuswitch, ../../waku/v2/node/storage/message/message_retention_policy_capacity,
./waku_node ../../waku/v2/node/storage/message/message_retention_policy_time,
../../waku/v2/node/wakuswitch,
../../waku/v2/node/waku_node,
../../waku/v2/utils/peers,
../../waku/v2/utils/wakuenr,
../../waku/common/utils/nat,
./wakunode2_setup_rest,
./wakunode2_setup_metrics,
./wakunode2_setup_rpc,
./wakunode2_setup_sql_migrations,
./config
when defined(rln) or defined(rlnzerokit):
import
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils
logScope:
topics = "wakunode.setup"
{.pop.} # @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError {.pop.} # @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
@ -36,34 +61,13 @@ when isMainModule:
## 4. Start node and mounted protocols ## 4. Start node and mounted protocols
## 5. Start monitoring tools and external interfaces ## 5. Start monitoring tools and external interfaces
## 6. Setup graceful shutdown hooks ## 6. Setup graceful shutdown hooks
import
confutils, toml_serialization,
system/ansi_c,
libp2p/nameresolving/dnsresolver,
../../common/utils/nat,
./config,
./wakunode2_setup,
./wakunode2_setup_rest,
./wakunode2_setup_metrics,
./wakunode2_setup_rpc,
./wakunode2_setup_sql_migrations,
./storage/sqlite,
./storage/message/dual_message_store,
./storage/message/sqlite_store,
./storage/peer/waku_peer_storage
when defined(rln) or defined(rlnzerokit):
import ../protocol/waku_rln_relay/waku_rln_relay_utils
logScope:
topics = "wakunode.setup"
################### ###################
# Setup functions # # Setup functions #
################### ###################
type SetupResult[T] = Result[T, string]
# 1/7 Setup storage # 1/7 Setup storage
proc setupStorage(conf: WakuNodeConf): proc setupStorage(conf: WakuNodeConf):
SetupResult[tuple[pStorage: WakuPeerStorage, mStorage: MessageStore]] = SetupResult[tuple[pStorage: WakuPeerStorage, mStorage: MessageStore]] =

View File

@ -6,17 +6,21 @@ import
chronicles, chronicles,
chronos, chronos,
metrics, metrics,
metrics/chronos_httpserver, metrics/chronos_httpserver
./config, import
./waku_node, ../../waku/v2/protocol/waku_filter,
./peer_manager/peer_manager, ../../waku/v2/protocol/waku_store,
../protocol/waku_filter, ../../waku/v2/protocol/waku_lightpush,
../protocol/waku_store, ../../waku/v2/protocol/waku_swap/waku_swap,
../protocol/waku_lightpush, ../../waku/v2/protocol/waku_peer_exchange,
../protocol/waku_swap/waku_swap, ../../waku/v2/utils/collector,
../protocol/waku_peer_exchange, ../../waku/v2/node/peer_manager/peer_manager,
../protocol/waku_rln_relay/waku_rln_relay_metrics, ../../waku/v2/node/waku_node,
../utils/collector ./config
when defined(rln) or defined(rlnzerokit):
import ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_metrics
logScope: logScope:
topics = "wakunode.setup.metrics" topics = "wakunode.setup.metrics"

View File

@ -5,11 +5,11 @@ import
chronicles, chronicles,
presto presto
import import
./config, ../../waku/v2/node/waku_node,
./waku_node, ../../waku/v2/node/rest/server,
./rest/server, ../../waku/v2/node/rest/debug/debug_api,
./rest/debug/debug_api, ../../waku/v2/node/rest/relay/[relay_api, topic_cache],
./rest/relay/[relay_api, topic_cache] ./config
logScope: logScope:

View File

@ -6,16 +6,16 @@ import
chronicles, chronicles,
json_rpc/rpcserver json_rpc/rpcserver
import import
./config, ../../waku/v2/protocol/waku_message,
../protocol/waku_message, ../../waku/v2/node/waku_node,
./waku_node, ../../waku/v2/node/jsonrpc/[admin_api,
./jsonrpc/[admin_api, debug_api,
debug_api, filter_api,
filter_api, relay_api,
relay_api, store_api,
store_api, private_api,
private_api, debug_api],
debug_api] ./config
logScope: logScope:
topics = "wakunode.setup.rpc" topics = "wakunode.setup.rpc"

View File

@ -2,9 +2,10 @@
import import
stew/results, stew/results,
chronicles, chronicles
./storage/sqlite, import
./storage/migration, ../../waku/v2/node/storage/sqlite,
../../waku/v2/node/storage/migration,
./config ./config
logScope: logScope:

View File

@ -8,7 +8,8 @@ import
libp2p/crypto/[crypto,secp], libp2p/crypto/[crypto,secp],
eth/keys, eth/keys,
json_rpc/[rpcclient, rpcserver], json_rpc/[rpcclient, rpcserver],
../../waku/v2/node/[config, waku_node], ../../waku/v2/node/waku_node,
../../apps/wakunode2/config,
../../waku/common/utils/nat, ../../waku/common/utils/nat,
../../waku/v2/protocol/waku_message ../../waku/v2/protocol/waku_message

View File

@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services. # libtool - Provide generalized library-building support services.
# Generated automatically by config.status (libbacktrace) version-unused # Generated automatically by config.status (libbacktrace) version-unused
# Libtool was configured on host fv-az628-669: # Libtool was configured on host fv-az193-727:
# NOTE: Changes made to this file will be lost: look at ltmain.sh. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
# #
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,

View File

@ -65,7 +65,7 @@ task test1, "Build & run Waku v1 tests":
### Waku v2 tasks ### Waku v2 tasks
task wakunode2, "Build Waku v2 (experimental) cli node": task wakunode2, "Build Waku v2 (experimental) cli node":
let name = "wakunode2" let name = "wakunode2"
buildBinary name, "waku/v2/node/", "-d:chronicles_log_level=DEBUG" buildBinary name, "apps/wakunode2/", "-d:chronicles_log_level=DEBUG"
task bridge, "Build Waku v1 - v2 bridge": task bridge, "Build Waku v1 - v2 bridge":
let name = "wakubridge" let name = "wakubridge"

View File

@ -6,7 +6,7 @@ import
eth/keys, eth/keys,
eth/p2p/discoveryv5/[enr, node, protocol], eth/p2p/discoveryv5/[enr, node, protocol],
stew/results, stew/results,
../config, ../../../../apps/wakunode2/config, ## TODO: Remove dependency on wakunode2 config module
../../utils/[peers, wakuenr] ../../utils/[peers, wakuenr]
export protocol, wakuenr export protocol, wakuenr

View File

@ -1,5 +0,0 @@
{.push raises: [Defect].}
import stew/results
type SetupResult*[T] = Result[T, string]

View File

@ -17,7 +17,7 @@ import
waku_rln_relay_metrics, waku_rln_relay_metrics,
../../utils/time, ../../utils/time,
../../node/waku_node, ../../node/waku_node,
../../node/config, ## TODO: Decouple the protocol code from the app configuration ../../../../../apps/wakunode2/config, ## TODO: Decouple the protocol code from the app configuration
../../../../../apps/chat2/config_chat2, ## TODO: Decouple the protocol code from the app configuration ../../../../../apps/chat2/config_chat2, ## TODO: Decouple the protocol code from the app configuration
../waku_message ../waku_message