2020-04-30 15:51:30 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
|
|
### Package
|
|
|
|
version = "0.1.0"
|
|
|
|
author = "Status Research & Development GmbH"
|
2020-06-16 12:22:24 +00:00
|
|
|
description = "Waku, Private P2P Messaging for Resource-Restricted Devices"
|
2020-04-30 15:51:30 +00:00
|
|
|
license = "MIT or Apache License 2.0"
|
|
|
|
srcDir = "src"
|
|
|
|
#bin = @["build/waku"]
|
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
"chronicles",
|
|
|
|
"confutils",
|
|
|
|
"chronos",
|
|
|
|
"eth",
|
|
|
|
"json_rpc",
|
|
|
|
"libbacktrace",
|
|
|
|
"nimcrypto",
|
|
|
|
"stew",
|
|
|
|
"stint",
|
|
|
|
"metrics",
|
2020-12-04 04:41:28 +00:00
|
|
|
"libp2p", # Only for Waku v2
|
2021-03-02 20:57:48 +00:00
|
|
|
"web3",
|
|
|
|
"rln"
|
2020-04-30 15:51:30 +00:00
|
|
|
|
|
|
|
### Helper functions
|
|
|
|
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
|
|
|
exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
|
|
|
|
|
|
|
|
proc test(name: string, lang = "c") =
|
2020-09-16 04:23:10 +00:00
|
|
|
# XXX: When running `> NIM_PARAMS="-d:chronicles_log_level=INFO" make test2`
|
|
|
|
# I expect compiler flag to be overridden, however it stays with whatever is
|
|
|
|
# specified here.
|
|
|
|
buildBinary name, "tests/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
#buildBinary name, "tests/", "-d:chronicles_log_level=ERROR"
|
2020-04-30 15:51:30 +00:00
|
|
|
exec "build/" & name
|
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
### Waku v1 tasks
|
2020-10-03 05:26:49 +00:00
|
|
|
task wakunode1, "Build Waku v1 cli node":
|
2020-11-30 13:12:52 +00:00
|
|
|
buildBinary "wakunode1", "waku/v1/node/", "-d:chronicles_log_level=TRACE"
|
2020-04-30 15:51:30 +00:00
|
|
|
|
2020-10-03 05:26:49 +00:00
|
|
|
task sim1, "Build Waku v1 simulation tools":
|
2020-11-17 09:34:53 +00:00
|
|
|
buildBinary "quicksim", "waku/v1/node/", "-d:chronicles_log_level=INFO"
|
|
|
|
buildBinary "start_network", "waku/v1/node/", "-d:chronicles_log_level=DEBUG"
|
2020-04-30 15:51:30 +00:00
|
|
|
|
2020-10-03 05:26:49 +00:00
|
|
|
task example1, "Build Waku v1 example":
|
2020-08-26 12:20:04 +00:00
|
|
|
buildBinary "example", "examples/v1/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
task test1, "Build & run Waku v1 tests":
|
|
|
|
test "all_tests_v1"
|
2020-05-01 10:05:19 +00:00
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
### Waku v2 tasks
|
|
|
|
task wakunode2, "Build Waku v2 (experimental) cli node":
|
2020-11-17 09:34:53 +00:00
|
|
|
buildBinary "wakunode2", "waku/v2/node/", "-d:chronicles_log_level=TRACE"
|
2020-04-30 15:51:30 +00:00
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
task sim2, "Build Waku v2 simulation tools":
|
2020-11-17 09:34:53 +00:00
|
|
|
buildBinary "quicksim2", "waku/v2/node/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
buildBinary "start_network2", "waku/v2/node/", "-d:chronicles_log_level=TRACE"
|
2020-07-20 04:40:35 +00:00
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
task example2, "Build Waku v2 example":
|
|
|
|
let name = "basic2"
|
|
|
|
buildBinary name, "examples/v2/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
|
|
|
|
task test2, "Build & run Waku v2 tests":
|
|
|
|
test "all_tests_v2"
|
|
|
|
|
2020-09-10 04:18:35 +00:00
|
|
|
task scripts2, "Build Waku v2 scripts":
|
2021-02-04 08:39:55 +00:00
|
|
|
buildBinary "rpc_publish", "waku/v2/node/scripts/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
buildBinary "rpc_subscribe", "waku/v2/node/scripts/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
buildBinary "rpc_subscribe_filter", "waku/v2/node/scripts/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
buildBinary "rpc_query", "waku/v2/node/scripts/", "-d:chronicles_log_level=DEBUG"
|
|
|
|
buildBinary "rpc_info", "waku/v2/node/scripts/", "-d:chronicles_log_level=DEBUG"
|
2020-09-10 04:18:35 +00:00
|
|
|
|
2020-10-08 09:10:45 +00:00
|
|
|
task chat2, "Build example Waku v2 chat usage":
|
2020-10-01 11:38:32 +00:00
|
|
|
let name = "chat2"
|
|
|
|
# NOTE For debugging, set debug level. For chat usage we want minimal log
|
|
|
|
# output to STDOUT. Can be fixed by redirecting logs to file (e.g.)
|
2020-10-14 10:34:29 +00:00
|
|
|
#buildBinary name, "examples/v2/", "-d:chronicles_log_level=WARN"
|
2021-03-03 08:40:19 +00:00
|
|
|
buildBinary name, "examples/v2/", "-d:chronicles_log_level=DEBUG -d:chronicles_sinks=textlines[file] -d:ssl"
|
2020-10-21 09:54:29 +00:00
|
|
|
|
|
|
|
task bridge, "Build Waku v1 - v2 bridge":
|
2020-11-17 09:34:53 +00:00
|
|
|
buildBinary "wakubridge", "waku/common/", "-d:chronicles_log_level=DEBUG"
|