Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Daily logos-delivery CI
on:
schedule:
- cron: '30 6 * * *'
workflow_dispatch:

env:
NPROC: 2
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export PATH := $(HOME)/.nimble/bin:$(PATH)
# NIM binary location
NIM_BINARY := $(shell which nim 2>/dev/null)
NPH := $(HOME)/.nimble/bin/nph
NIMBLE := $(HOME)/.nimble/bin/nimble
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this applies to all ci run on all platform?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will work fine as long as the NIMBLE_DIR is not overridden, which is the case.

NIMBLEDEPS_STAMP := nimbledeps/.nimble-setup

# Compilation parameters
Expand Down Expand Up @@ -71,7 +72,7 @@ waku.nims:

$(NIMBLEDEPS_STAMP): nimble.lock | waku.nims
$(MAKE) install-nimble
nimble setup --localdeps
$(NIMBLE) setup --localdeps
$(MAKE) build-nph
$(MAKE) rebuild-bearssl-nimbledeps
$(MAKE) rebuild-nat-libs-nimbledeps
Expand All @@ -80,7 +81,7 @@ $(NIMBLEDEPS_STAMP): nimble.lock | waku.nims
update:
rm -f $(NIMBLEDEPS_STAMP)
$(MAKE) $(NIMBLEDEPS_STAMP)
nimble lock
$(NIMBLE) lock

clean:
rm -rf build 2> /dev/null || true
Expand Down
3 changes: 2 additions & 1 deletion apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import
chronos,
eth/keys,
bearssl,
stew/[byteutils, results],
stew/byteutils,
results,
metrics,
metrics/chronos_httpserver
import
Expand Down
9 changes: 7 additions & 2 deletions apps/chat2/config_chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ type

metricsServerAddress* {.
desc: "Listening address of the metrics server.",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "metrics-server-address"
.}: IpAddress

Expand Down Expand Up @@ -173,7 +174,11 @@ type
dnsAddrsNameServers* {.
desc:
"DNS name server IPs to query for DNS multiaddrs resolution. Argument may be repeated.",
defaultValue: @[parseIpAddress("1.1.1.1"), parseIpAddress("1.0.0.1")],
defaultValue:
@[
IpAddress(family: IpAddressFamily.IPv4, address_v4: [1'u8, 1, 1, 1]),
IpAddress(family: IpAddressFamily.IPv4, address_v4: [1'u8, 0, 0, 1]),
],
name: "dns-addrs-name-server"
.}: seq[IpAddress]

Expand Down
10 changes: 8 additions & 2 deletions apps/chat2bridge/chat2bridge.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{.push raises: [].}

import
std/[tables, times, strutils, hashes, sequtils, json],
std/[tables, times, strutils, hashes, sequtils, json, options],
chronos,
confutils,
chronicles,
Expand Down Expand Up @@ -267,10 +267,16 @@ when isMainModule:
else:
nodev2ExtPort

let nodev2Key =
if conf.nodekey.isSome():
conf.nodekey.get()
else:
crypto.PrivateKey.random(Secp256k1, rng[]).tryGet()

let bridge = Chat2Matterbridge.new(
mbHostUri = "http://" & $initTAddress(conf.mbHostAddress, Port(conf.mbHostPort)),
mbGateway = conf.mbGateway,
nodev2Key = conf.nodekey,
nodev2Key = nodev2Key,
nodev2BindIp = conf.listenAddress,
nodev2BindPort = Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
nodev2ExtIp = nodev2ExtIp,
Expand Down
11 changes: 7 additions & 4 deletions apps/chat2bridge/config_chat2bridge.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import
std/options,
confutils,
confutils/defs,
confutils/std/net,
Expand Down Expand Up @@ -45,7 +46,8 @@ type Chat2MatterbridgeConf* = object

metricsServerAddress* {.
desc: "Listening address of the metrics server",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "metrics-server-address"
.}: IpAddress

Expand All @@ -63,9 +65,9 @@ type Chat2MatterbridgeConf* = object

nodekey* {.
desc: "P2P node private key as hex",
defaultValue: crypto.PrivateKey.random(Secp256k1, newRng()[]).tryGet(),
defaultValueDesc: "random",
name: "nodekey"
.}: crypto.PrivateKey
.}: Option[crypto.PrivateKey]

store* {.
desc: "Flag whether to start store protocol", defaultValue: true, name: "store"
Expand Down Expand Up @@ -94,7 +96,8 @@ type Chat2MatterbridgeConf* = object
# Matterbridge options
mbHostAddress* {.
desc: "Listening address of the Matterbridge host",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "mb-host-address"
.}: IpAddress

Expand Down
9 changes: 7 additions & 2 deletions apps/chat2mix/config_chat2mix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ type

metricsServerAddress* {.
desc: "Listening address of the metrics server.",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "metrics-server-address"
.}: IpAddress

Expand Down Expand Up @@ -194,7 +195,11 @@ type

dnsDiscoveryNameServers* {.
desc: "DNS name server IPs to query. Argument may be repeated.",
defaultValue: @[parseIpAddress("1.1.1.1"), parseIpAddress("1.0.0.1")],
defaultValue:
@[
IpAddress(family: IpAddressFamily.IPv4, address_v4: [1'u8, 1, 1, 1]),
IpAddress(family: IpAddressFamily.IPv4, address_v4: [1'u8, 0, 0, 1]),
],
name: "dns-discovery-name-server"
.}: seq[IpAddress]

Expand Down
3 changes: 2 additions & 1 deletion apps/liteprotocoltester/tester_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ type LiteProtocolTesterConf* = object
## Tester REST service configuration
restAddress* {.
desc: "Listening address of the REST HTTP server.",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "rest-address"
.}: IpAddress

Expand Down
3 changes: 2 additions & 1 deletion apps/networkmonitor/networkmonitor_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ type NetworkMonitorConf* = object

metricsServerAddress* {.
desc: "Listening address of the metrics server.",
defaultValue: parseIpAddress("127.0.0.1"),
defaultValue:
IpAddress(family: IpAddressFamily.IPv4, address_v4: [127'u8, 0, 0, 1]),
name: "metrics-server-address"
.}: IpAddress

Expand Down
6 changes: 3 additions & 3 deletions nimble.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"version": 2,
"packages": {
"nim": {
"version": "2.2.4",
"vcsRevision": "911e0dbb1f76de61fa0215ab1bb85af5334cc9a8",
"version": "2.2.10",
"vcsRevision": "9fe2137fa2f3f66cf5a44f357d461829ac9e20c4",
Comment on lines +5 to +6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, we need to keep compiler version we know as producing good code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, not needed to change nimble.lock

"url": "https://github.com/nim-lang/Nim.git",
"downloadMethod": "git",
"dependencies": [],
"checksums": {
"sha1": "68bb85cbfb1832ce4db43943911b046c3af3caab"
"sha1": "17ec440fdb89f8903db29a17898af590087d2b64"
}
},
"unittest2": {
Expand Down
4 changes: 2 additions & 2 deletions tests/node/peer_manager/peer_store/test_migrations.nim
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import std/[options], stew/results, testutils/unittests
import std/[options], results, testutils/unittests

import
waku/node/peer_manager/peer_store/migrations,
../../waku_archive/archive_utils,
../../testlib/[simple_mock]

import std/[tables, strutils, os], stew/results, chronicles
import std/[tables, strutils, os], results, chronicles

import waku/common/databases/db_sqlite, waku/common/databases/common

Expand Down
2 changes: 1 addition & 1 deletion tests/node/peer_manager/peer_store/test_peer_storage.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stew/results, testutils/unittests
import results, testutils/unittests

import waku/node/peer_manager/peer_store/peer_storage, waku/waku_core/peers

Expand Down
2 changes: 1 addition & 1 deletion tests/node/test_wakunode_relay_rln.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import
std/[tempfiles, strutils, options],
stew/results,
results,
testutils/unittests,
chronos,
libp2p/switch,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils_compat.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{.used.}

import testutils/unittests
import stew/results, waku/waku_core/message, waku/waku_core/time, ./testlib/common
import results, waku/waku_core/message, waku/waku_core/time, ./testlib/common

suite "Waku Payload":
test "Encode/Decode waku message with timestamp":
Expand Down
2 changes: 1 addition & 1 deletion tests/waku_enr/test_sharding.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{.used.}

import
stew/results,
results,
chronos,
testutils/unittests,
libp2p/crypto/crypto as libp2p_keys,
Expand Down
2 changes: 1 addition & 1 deletion tests/waku_rln_relay/rln/test_wrappers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import
chronos,
eth/keys,
bearssl,
stew/[results],
results,
metrics,
metrics/chronos_httpserver

Expand Down
5 changes: 2 additions & 3 deletions waku.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ author = "Status Research & Development GmbH"
description = "Waku, Private P2P Messaging for Resource-Restricted Devices"
license = "MIT or Apache License 2.0"

const RequiredNimVersion = "2.2.4"
const RequiredNimVersion = "2.2.10"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not needed yet.
First we will need to validate the build with new compiler on a know good version of master -> run complete tests on fleets and maybe DST. @Ivansete-status

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, we will stick to 2.2.4 for now ( cc @darshankabariya .)

## This is the nim compiler version that we are working on. Other versions may behave differently.
const RequiredNimbleVersion = "0.22.3"
## Enforced nimble version to ensure a reproducible flow

### Dependencies
requires "nim >= 2.2.4",
"chronos >= 4.2.0",
requires "chronos >= 4.2.0",
"taskpools",
# Logging & Configuration
"chronicles",
Expand Down
Loading