Skip to content

Commit

Permalink
Merge branch 'master' into rln-keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
s1fr0 authored Oct 22, 2022
2 parents 2a6464b + 9b59052 commit fc5f48f
Show file tree
Hide file tree
Showing 38 changed files with 1,461 additions and 920 deletions.
118 changes: 0 additions & 118 deletions .github/workflows/test.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/test1-ignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test1

on:
pull_request:
paths:
- 'waku/v2/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'

- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}

name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- run: 'echo "No test required"'
66 changes: 66 additions & 0 deletions .github/workflows/test1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: test1

on:
pull_request:
paths-ignore:
- 'waku/v2/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'

- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
test:
strategy:
matrix:
env:
- NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC}"
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
timeout-minutes: 60

name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3

# We need to do this because of how github cache works
# I am not sure we can move the cache file, so if we do not do this
# make update breaks because the cached compiler is there where the submodules
# are meant to go.
- name: Submodules
run: git submodule update --init --recursive

- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}

- name: Update dependencies
run: make V=1 update

- name: Build V1 binaries
run: make LOG_LEVEL=TRACE v1

- name: Run V1 Tests
run: make test1
41 changes: 41 additions & 0 deletions .github/workflows/test2-ignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: test2

on:
pull_request:
paths:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'

- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'

- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}

name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- run: 'echo "No test required"'
70 changes: 70 additions & 0 deletions .github/workflows/test2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: test2

on:
pull_request:
paths-ignore:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'

- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'

- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
test:
strategy:
matrix:
env:
- NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC}"
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
timeout-minutes: 60

name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3

# We need to do this because of how github cache works
# I am not sure we can move the cache file, so if we do not do this
# make update breaks because the cached compiler is there where the submodules
# are meant to go.
- name: Submodules
run: git submodule update --init --recursive

- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}

- name: Update dependencies
run: make V=1 update

- name: Build V2 binaries
run: make LOG_LEVEL=TRACE v2

- name: Run V2 Tests
run: make test2
10 changes: 9 additions & 1 deletion apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import
../../waku/v2/protocol/waku_lightpush,
../../waku/v2/protocol/waku_filter,
../../waku/v2/protocol/waku_store,
../../waku/v2/node/[waku_node, waku_payload],
../../waku/v2/node/[waku_node, waku_payload, waku_metrics],
../../waku/v2/node/dnsdisc/waku_dnsdisc,
../../waku/v2/node/peer_manager/peer_manager,
../../waku/v2/utils/[peers, time],
Expand Down Expand Up @@ -551,6 +551,14 @@ proc processInput(rfd: AsyncFD) {.async.} =
echo "your rln identity key is: ", node.wakuRlnRelay.membershipKeyPair.idKey.inHex()
echo "your rln identity commitment key is: ", node.wakuRlnRelay.membershipKeyPair.idCommitment.inHex()

if conf.metricsLogging:
startMetricsLog()

if conf.metricsServer:
startMetricsServer(conf.metricsServerAddress,
Port(conf.metricsServerPort + conf.portsShift))


await chat.readWriteLoop()

if conf.keepAlive:
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 @@ -180,7 +180,7 @@ type

metricsLogging* {.
desc: "Enable metrics logging: true|false"
defaultValue: false
defaultValue: true
name: "metrics-logging" }: bool

## DNS discovery config
Expand Down
Loading

0 comments on commit fc5f48f

Please sign in to comment.